text:
How to calculate coins mined per day?
Sorry for the noob question I'm pretty new to crypto coins and all this stuff. :)
I wonder why the formula <your hashrate> / <coin difficulty> gives the mined coins as a result...Formula mentioned on xmg.minerclaim.comQuote:

"XMG/Day" is calculated by the current Hashrate/Difficulty. Due to the
  fact that difficulty is constantly changing, this is only a rough
  estimate.

Example (from altcoin Coin Magi):
If I have a hashrate of 3.211 MH/s and the coins difficulty is 2.599 (approximately) then my earnings per second (because it's H/s) should be

3,211,000 / 2.599 = ~1235.47 coins per second

and

1235.47 * ( 60 * 60 *24 ) = 106744608 coins per day

How can this be? The 'fastest' miner (highest hashrate) has 3.211 MH/s and is 'only' earning 32.892 XMG per day?
Did I do something wrong? Is minerclaim wrong? And what's a good formula to calculate mined coins per day?
Thanks in advance!

Average coins/day for a miner can be estimated by comparing the miner's hashrate with the hashrate of the network.

where,
Cm is total coins for the miner
subsidy is the number of coins/block a miner gets as a reward
blocktime is the average time per block
Hm is the miner's hashrate (Hash/sec)
Hn is the total network hashpower (Hash/sec)
1440 is minutes per day
Bitcoin
Since the total network hashpower is unknown, it must be estimated based on the current difficulty. This can be done by noting that Difficulty D

Because
difficulty = hashrate / (2^256 / max_target / intended_time_per_block)
           = hashrate / (2^256 / (2^208*65535) / 600)
           = hashrate / (2^48 / 65535 / 600)
           = hashrate / 7158388.055

see Relationship Between Hashrate and Difficulty
So, for bitcoin given a current difficulty of 5,949,437,371,610 an Antminer S9 with a hashrate of about 14TH/s:

Note: This is an average value, so with a large enough pool and enough days, your earnings will average to this formula (this does not account for the difficulty and network hashpower changing, of course).

Thank you for your answer! Everything's clear now. But one question: D=hashrate/7158388.055 what is 7158388.055 in this formula?

https://bitcoin.stackexchange.com/a/5557/60443

Cm/day = subsidy * (1440 / blocktime) * (Hm/Hn) seems wrong to me, because hash ratio is represented in Hash/Sec, but 1440 factor is number of minutes in day. To get true result of mined coin in 24h, we need to change minutes/day factor into seconds/day factor which is 86400

Hash ratio Hm/Hn is unitless. Block time is in minutes thus 1440 min/day


text:
I am not able to send BTC in Blockchain
I have 0.98 BTC confirmed, but my wallet only lets me send 0.1 BTC. My wallet has received a lot of small payments, what can I do? Thanks

It's possible you've hit the limit on number of transaction inputs for the wallet software (or total tx size).
Some wallets have a feature to "sweep dust", meaning consolidating all of those small UTXOs (unspent tx outputs). Note this will cost a small amount for tx fees. If it doesn't have this option, you can just make a few large transfers to an address you own using the same wallet (this will also cost tx fees).

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Expected property "0" of type ECPair, got p
When I'm trying to create a wallet in react app using the following code:
const seed = bip39.mnemonicToSeed(mnemonic);
const master = bitcoin.HDNode.fromSeedBuffer(seed, "testnet");

I got error: Expected property "0" of type ECPair, got p

HDNode was removed and is now a separated package.
npm install bip32 See Issue #1243

const bitcoin = require('bitcoinjs-lib')
const bip39 = require('bip39')
const bip32 = require('bip32')

const mnemonic = 'praise you muffin lion enable neck grocery crumble super myself license ghost'
const seed = bip39.mnemonicToSeed(mnemonic)
const node = bip32.fromSeed(seed)

Test examples: bitcoinjs-lib tests

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Is there a way to know the type of dogecoin wallet through the receiver address?
I am confused right now! I mistakenly withdrew my dogecoins to an old wallet that I have no memory of. So I want to know if there is a way one can guess a wallet type through the receiver address.
This is my receiver address:
D6zUZ42K8bo7qwbHXsMEerjuEYbdqvFAHK

This is not possible. Addresses are indistinguishable, and there is no way to determine which wallet generated any address, since the process is wallet agnostic.


text:
Can't generate same addresses as bitcoincore using xprv from bitcoin-core
First of all all addresses below are for testing purposes so I don't care about private keys.
So dumped wallet created by Bitcoin-qt v0.16.2:
extended private masterkey: xprv9s21ZrQH143K3mYiBBH7MwWV9VTkeB5q5sxEFGgvLbLqRZ3xPVAKvwyxSLVtTcL2tz665vdZnHLrMQPr6MWGKdDHYoncZmUNiUgtShGCmZE

From what I can understand from the rest of the dump the first receive address is:
addr=3DhmoRSx2bjxyJm7A1Crs3bCPnVcEx51fE hdkeypath=m/0'/0'/0'
Now I am trying to generate same addess using bitcoinjs-lib but haven't had any success so far with it.
import { HDNode } from "bitcoinjs-lib";
const key = HDNode.fromBase58(
 "xprv9s21ZrQH143K3mYiBBH7MwWV9VTkeB5q5sxEFGgvLbLqRZ3xPVAKvwyxSLVtTcL2tz665vdZnHLrMQPr6MWGKdDHYoncZmUNiUgtShGCmZE"
);
console.log(key.derivePath("m/0'/0'/0'").getAddress()); // prints 1NoQERVA18v5WcFUbgvz22tDGigmAkqy4U

Now I get confused becuase I use same derive path but I get 2 different addresses and on top of that looks like address from dump is multisig? Is it becuase of multisig?
If so how should I generate wallet.dat that is not multisig and is HD.

looks like address from dump is multisig?

It is not multisig. Bitcoin Core does not generate multisig addresses.
That address is a P2SH wrapped Segwit address. The same private key can be associated with multiple addresses since there are different types of addresses. The type of address you that you are generating with bitcoinjs-lib are P2PKH addresses. However Bitcoin Core is making P2SH-P2WPKH addresses.
You should be able to get the same address if you do something like
bitcoin.payments.p2sh({
      redeem: bitcoin.payments.p2wpkh({ pubkey: key.derivePath("m/0'/0'/0'").publicKey })
})

Thanks! One more question. Is it possible to use this api to generate addresses using from xpub? I get TypeError: Missing private key for hardened child key error.

No, you cannot derive hardened keys from an xpub. However you can use the xpub and derive keys with a non-hardened path. This means that your keypath cannot contain ', h, or H which indicate that that index should use hardened derivation.

If I remove ' from keypath now I can generate addresses using xpub now I believe that bitcoin-qt won't monitor these addresses right?

Yes, those will be different addresses.


text:
What am I doing wrong in calculating child private key in HD wallets and reversing back parent private key?
I'm trying to understand the process of creating the children's private key and, in the case of knowing the children's private key and the left 256-bit hash result, the process of returning the parent's private key.
There is a bit more text as I have tried to explain in detail exactly what I am doing as well as to mark all the articles I refer to.
I'll explain what I'm doing through an example and link the article I'm referring to.
Example and numbers are taken from here (code only)
So let's start with that we have the left 256-bit hash result (L256B) and the parent's private key (PPK):
L256B (hex): 6539ae80b3618c22f5f8cc4171d04835570bda8db11b5bf1779afae7ec7c79c3
L256B (decimal): 45785512363230816970838539051071102444734444055822171970071151407697781094851

PPK (hex): e8f32e723decf4051aefac8e2c93c9c5b214313817cdb01a1494b917c8436b35
PPK (decimal): 105366245268346348601399826821003822098691517983742654654633135381666943167285

The process of obtaining the children's private key is based on the following formula according to this:
children_private_key == (parent_private_key + lefthand_hash_output) % G

That is, on the following formula according to this (where parse256(IL) is the left 256-bit of the hash result, kpar is the parent's private key, and ki denotes the child's private key):
Child private key formula -> parse256(IL) + kpar (mod n) = ki

Also, according to this again a similar formula:
The returned child key ki is parse256(IL) + kpar (mod n)

1. So my first question: is the plus (+) in all these formulas related to a normal plus operation like 2+2 = 4, 6+3 = 9, etc. or is it some kind of concatenation like 2+2 = 22, 6+3 =63 etc.? I ask because in this answer Michael Folkson said it is a concatenation…

There is concatenation where 256 bits placed next to another 256 bits
makes 512 bits.

This totally confuses me.
But let's continue with the assumption that normal addition is what we have to do here.
EDIT: I misinterpreted his answer. He wrote that scalar addition is used here (as I thought), not concatenation. My mistake.
So the first thing we need to do is add L256B and PPK:
L256B (decimal): 45785512363230816970838539051071102444734444055822171970071151407697781094851

PPK (decimal): 105366245268346348601399826821003822098691517983742654654633135381666943167285

L256B + PPK (decimal): 151151757631577165572238365872074924543425962039564826624704286789364724262136

The next thing we need to do is the modulo operation with n or G (whatever is the correct label). n is (according to this):
n = 115792089237316195423570985008687907852837564279074904382605163141518161494337

So the children's private key (CPK) is:
CPK = (L256B + PPK) mod n
CPK = 151151757631577165572238365872074924543425962039564826624704286789364724262136 mod 115792089237316195423570985008687907852837564279074904382605163141518161494337

CPK (decimal): 35359668394260970148667380863387016690588397760489922242099123647846562767799
CPK (hex): 4e2cdcf2f14e802810e878cf9e6411fc4e712edf19a06bcfcc5d5572e489a3b7

That's exactly what they got in example I am using.
Everything looks fine and correct (assuming the normal + operation is used here and not concatenation).
Now comes the bigger problem. In the example I'm using, they say you can get the parent's private key back from the children's private key. Formula taken from here says:
Solve for kpar -> kpar = ki - parse256(IL) (mod n)

This minus confuses me.
2. So my second question would be what does the minus mean in the formula above? Normal subtraction operation or something else?
I ask because when I try to return the parent's private key from the children's private key, I get the wrong result compared to what they get. The process I use is as follows:
PPK = (CPK - L256) mod n

CPK (decimal): 35359668394260970148667380863387016690588397760489922242099123647846562767799

L256B (decimal): 45785512363230816970838539051071102444734444055822171970071151407697781094851

CPK - L256B (decimal): -10425843968969846822171158187684085754146046295332249727972027759851218327052

PPK = -10425843968969846822171158187684085754146046295332249727972027759851218327052 mod 115792089237316195423570985008687907852837564279074904382605163141518161494337

PPK (decimal): -10425843968969846822171158187684085754146046295332249727972027759851218327052
PPK (hex): -170CD18DC2130BFAE5105371D36C3639089AABAE977AF021AB3DA57507F2D60C

So as you can see, I'm not getting the correct parent private key:
-170CD18DC2130BFAE5105371D36C3639089AABAE977AF021AB3DA57507F2D60C != e8f32e723decf4051aefac8e2c93c9c5b214313817cdb01a1494b917c8436b35

... unlike those who get the correct key in their solution.
What am I doing wrong? Any help would be appreciated.

I am attempting to write an answer but I do agree this hinges on who is correct: Michael with literal bit string concatenation or Malone with summative concatenation, I suppose it would not be proper to give a full answer until this is discovered.

@Poseidon Thanks for the comment. The answer would be acceptable to me if it showed me how to get back to the parent's private key. In other words, how to use the minus and where I am wrong in that calculation. So feel free to make some answer, it would help a lot.

I am going through it in detail at the moment, I do agree that upon first glance the minus operation is confusing as it results in a negative. The write up of the solution is not easy to reason about at the moment for me.

@Poseidon Yes, I was also confused by that negative result. Well, if you find a solution or something useful about this topic, comment, it would help a lot.

The next thing we need to do is the modulo operation with n or G (whatever is the correct label). n is (according to this):

In this specific operation the modulo is against N(Curve Order) not G(Curve Generator) because modulo G does nothing to the Parent Private Key in this instance. Not sure exactly why. Furthermore modulo N results in the expected Child Private Key.
I happened to identify exactly where you went wrong and it is quite small but entirely relevant.
Basically you did not modulo N before receiving the negative number (which was what confused me). When you modulo N on that negative you receive the correct private key.
Python Implementation:
G_hex = '0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798' #grabbed from https://en.bitcoin.it/wiki/Secp256k1 ***

G = int.from_bytes(bytes.fromhex(G_hex), byteorder='big')
#286650441496909734516720688912544350032790572785058722254415355376215376009112

N_hex = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141' # ***

N = int.from_bytes(bytes.fromhex(N_hex), byteorder='big')
#115792089237316195423570985008687907852837564279074904382605163141518161494337

#print(G)

#print(N)

L256B = 45785512363230816970838539051071102444734444055822171970071151407697781094851

PPK = 105366245268346348601399826821003822098691517983742654654633135381666943167285

CPrivK1 = (PPK + L256B)
#print("CPrivK1", CPrivK1)

CPrivK2 = (PPK + L256B) % G
#print("CPrivK2", CPrivK2)

assert(CPrivK1 == CPrivK2) #proof that % G does nothing in this instance

CPrivK = (PPK + L256B) % N #therefore we deduce that N is used for the modulo operation
                            #resulting in expected key 35359668394260970148667380863387016690588397760489922242099123647846562767799
print(CPrivK)

assert(CPrivK == 35359668394260970148667380863387016690588397760489922242099123647846562767799) #checked against expected key

Left256Bits_hex = '6539ae80b3618c22f5f8cc4171d04835570bda8db11b5bf1779afae7ec7c79c3'

L256 = int.from_bytes(bytes.fromhex(Left256Bits_hex), byteorder='big')

print(L256)

PPK_Formula = (CPrivK - L256) % N

PPK_No_modulo = (CPrivK - L256)

print("PPK without doing % N:", PPK_No_modulo)

print(PPK_Formula)

PPK_hex = format(PPK_Formula, 'x')

print(PPK_hex)

assert(PPK_hex == 'e8f32e723decf4051aefac8e2c93c9c5b214313817cdb01a1494b917c8436b35') #proof of Parent PrivKey from Child PrivKey

Thank you for your help. Actually I did the modulo operation. Taken from my post: PPK = -10425843968969846822171158187684085754146046295332249727972027759851218327052 mod 115792089237316195423570985008687907852837564279074904382605163141518161494337 . However, you won't believe what actually happened. The tool I was using just didn't do it very well. Look at this: link.

I see, this tool seems to have thrown out the result of the operation. Perhaps they have arbitrary limits on computing integer sizes. Either way, I highly recommend a language like python for reasoning about big integer values like the ones here. Python handles modulo naturally with variable sized integers by just doing int1 % int2 .

Yes, I'm using golang so I retyped your code using golang syntax and got the same result as you (correct result). Otherwise, regular scalar addition is used when obtaining the child's private key. We misinterpreted Michael's response.

@Filip Ah I see, this was partially clear but obviously caused some confusion. I think some workshops refer to adding two byte arrays together as concatenation even though it is not being done at the string literal level.

Well, yes. Anyway, thanks for your help. All the best!


text:
processing input tx in bitcoin's block response and obtain transaction value of each input
so i was parsing the block #496 of bitcoin which contains two transactions, first tx in the list is the reward tx and the second tx contains three inputs and one output. i tried to parse each scriptSig but it's completely different bytes array in compare to the a format like
OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
which get used when we want to make a transaction. the first input's scriptSig is a 73 byte data which is equal to (each byte is in it's decimal form):
<<72,48,69,2,33,0,203,44,107,52,106,151,138,184,198,27,24,
                    181,233,57,119,85,203,209,125,110,178,254,0,131,239,50,224,
                    103,250,108,120,90,2,32,108,228,78,97,63,49,217,166,176,81,
                    126,70,243,219,21,118,233,129,44,201,141,21,155,253,175,
                    117,154,80,20,8,27,92,1>>

my first question is how to parse it, and my next question is, in block response we got only the tx value, is there any way to check how much btc was took from each address?
in block #496 there are 3 input and only 1 total tx value.

See How to parse transaction data

All three inputs in the second transaction of the 496th block consume P2PK outputs, not P2PKH outputs. If they were consuming P2PKH outputs, the scriptSig would be of the format you specified. Since these are P2PK outputs, then scriptSig contains only signature.
Here you can find a table with all standard locking scripts (scriptPubKey) and their corresponding unlocking scripts (scriptSig). The first output type (row) in the given table represents P2PK.
When the input provides the correct scriptSig for the scriptPubKey in the referenced output, it unlocks the entire amount locked in the output. So, nowhere in the input is it written how much amount it unlocks, that is, it spends, since it is the entire amount. To see exactly what that amount is, you need to look at the referenced transaction and the referenced output in it.

thanks for answer, can you explain more on this : To see exactly what that amount is, you need to look at the referenced transaction and the referenced output in it.
thats my script sig that i specified and i get pubkey of destination on tx_out which can be translated to dest address. but all block explorers have the source destination, how they take it?
i'm trying to use bitcoin protocol to take them, not APIs.

@MonteConte The output contains the amount of satoshis that are locked with the scriptPubKey (say 1,000,000). When the input offers the correct scriptSig, all satoshis (all 1,000,000 satoshis) from the referenced output are unlocked. However, that amount is not written anywhere in the input. To see how much is being spent, it is necessary to look at the referenced transaction and output. Block explorers do the same when they show how many bitcoins are spent/taken with some input.


text:
What Satoshi Nakomoto quotes are there in relation to forks and altcoins?
What Satoshi Nakomoto quotes are there in relation to:

forks of Bitcoin?
forks in general?
altcoin/similar projects?

Here I mean forks that form distinct new coins/ecosystems, not in relation to proof of work rivalry.
I think I remember a quote that had the idea that people would tend not to choose a new project over the first one, the one with sociocultural inertia. I can't seem to find it though.
I'm interested in all of Satoshi Nakomoto's quotes in relation to forks/alternative cryptocurrencies (ones that started after bitcoin genesis).

I think thats too much of an open ended and broad set of multiple  questions to be answerable here but you can find the complete public writings of Satoshi Nakamoto using a search engine. I think there are several collections, some allow you to download the whole set which I found made it easier to search them. Some online collections have a built in search facility.
Some examples:

https://satoshi.nakamotoinstitute.org/
https://www.bitcoin.com/satoshi-archive/
"The Book of Satoshi: The Collected Writings of Bitcoin Creator Satoshi Nakamoto" by Phil Champagne (not an endorsement, I haven't read it)

Here is the result of my searches. Note this omits discussions on the intermittent forking natural in Proof of Work. Also, I alas didn't find the quote I had in mind in the question.
1. Forks of Bitcoin
SHA256 breaking
Bitcoin Forum: Re: Dealing with SHA-256 Collisions June 14, 2010, 08:39:50 PM

If SHA-256 became completely broken, I think we could come to some
agreement about what the honest block chain was before the trouble
started, lock that in and continue from there with a new hash
function.
If the hash breakdown came gradually, we could transition to a new
hash in an orderly way.  The software would be programmed to start
using a new hash after a certain block number.  Everyone would have to
upgrade by that time.  The software could save the new hash of all the
old blocks to make sure a different block with the same old hash can't
be used.

see also Re: Hash() function not secure July 16, 2010, 04:13:53 PM
Internet segmentation
Bitcoin Forum: Re: Anonymity July 08, 2010, 07:12:00 PM

...
Any node with access to both sides would automatically flow the
block chain over, such as someone getting around the blockade with a
dial-up modem or sat-phone.  It would only take one node to do it.
Anyone who wants to keep doing business would be motivated.
...

Signature compromise
Bitcoin Forum: Re: Major Meltdown July 10, 2010, 01:36:17 PM

Quote from "llama" > However, if something happened and the signatures were compromised (perhaps integer factorization is solved, quantum
computers?), then even agreeing upon the last valid block would be
worthless.

True, if it happened suddenly.  If it happens gradually, we can still
transition to something stronger.  When you run the upgraded software
for the first time, it would re-sign all your money with the new
stronger signature algorithm.  (by creating a transaction sending the
money to yourself with the stronger sig)

Longest chain
re. Hal Finney Bitcoin P2P e-cash paper - 2008-11-09 01:58:48 UTC

... The only way for everyone to stay on the same page is to believe that
the longest chain is always the valid one, no matter what.

2. Forks in general
I didn't find anything.
3. Altcoin/similar projects
BitDNS
re. Mike Hearn <mike@plan99.net> Wed, Mar 9, 2011 at 7:39 PM

Procedure to hash a BitDNS block:

hash the BitDNS block
construct a Bitcoin block
insert the BitDNS hash into the scriptSig of tx 0 in the Bitcoin block
hash the Bitcoin block   The BitDNS block is valid if that hash is below BitDNS's target.

(quote truncated, see source)
Ripple
p2presearch@listcultures.org Fri, 13 Feb 2009 02:31

> Are you familiar with Ripple?
As trust systems go, Ripple is unique in spreading trust around rather
than concentrating it.


text:
how use importmulti with import multiple accounts
i'm use:
importmulti '[{ "scriptPubKey": { "address": ["3M5egggggggggggttttttttttttttttKEDy","18nbE6bEyyyyyyyyyyyyyyyyyyyyyyBiu","1Faew4y2j2TJDGFyyyyyyyyyyyyyyyyy2W"] }, "timestamp":"now", "keys": [ "Kwngf5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxMftBh92c","5KWxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxu7KXDLjnmgDDtNepR","L4fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxU7s2C4jpQC3cF" ], "redeemscript": ["00144yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyc3c9f59ab"]}]'

return error
help m pls

What error do you get?

Each outer {...} is for one individual thing being imported. Importing multiple addresses and their keys is not done by making address an array, but rather by having the top level array contain multiple items. Additionally, redeemScript is not an array either.
Your command should look something like:
importmulti '[{ "scriptPubKey": { "address":"3M5egggggggggggttttttttttttttttKEDy"}, "timestamp": "now", "keys": ["Kwngf5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxMftBh92c"], "redeemscript": "00144yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyc3c9f59ab"},{ "scriptPubKey": { "address":"18nbE6bEyyyyyyyyyyyyyyyyyyyyyyBiu"}, "timestamp": "now", "keys": ["5KWxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxu7KXDLjnmgDDtNepR"]},{ "scriptPubKey": { "address":"1Faew4y2j2TJDGFyyyyyyyyyyyyyyyyy2W"}, "timestamp": "now", "keys": ["L4fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxU7s2C4jpQC3cF"]}]'


text:
From where can I download a precompiled Windows installable Bitcoin core with support of hardware wallet for BitBox02
I wanted to integrate my BitBox02 into the existing Bitcoin Core Version v24.0.1 on my Windows 10 laptop.
In the customization menu I receive the notice that this node does not contain the hardware wallet support.
From where can I now download an installable Windows 10 BitCoin Core v25 with precompiled hardware wallet support?
Kind regards
Thomas

Bitcoin Core does not have hardware wallet support built in. It instead makes use of external software which it calls as needed.
You can simply install Bitcoin Core as normal and set in the settings the path to the external program.
The typical external program for hardware wallet support is HWI. You can download the latest version from https://github.com/bitcoin-core/HWI/releases. Simply download and unzip the Windows binaries and place the files wherever you want. Then set the path to the hwi.exe file in Bitcoin Core's settings.


text:
Feedback system possible
I grasp the concept of point negation and addition quite well. Point negation involves taking a public key, inverting it, and adding it to a target. The resulting difference between the target and the arrived point constitutes the private key of the public key that was inverted and added to the target, correct? Now, the question arises: can we calculate the distance between one public key and another? By 'distance,' I mean, just as I mentioned earlier, the gap between the target public key and the arrived public key represents the private key of the number that was inverted and added to the target. In a similar vein, is it feasible to compute the distance between two public keys? When I mention 'distance,' I refer to any metric, including time, serving as a feedback system, a means to ascertain whether we are progressing or regressing on the elliptic curve points from a specific standpoint.

Yes, they are points on an elliptic curve, so they have an x and a y coordinate. However your line of inquiry doesn’t make any sense to me. What are you trying to do with the distance between public keys? You seem to think that this reveals something about the private keys, but you can’t get from the public keys to the private keys, so it does not.

No metric is known that can tell you whether you're getting closer or not to a certain target. It's of course not impossible that such a metric might exist, but we do not know.
If such a metric existed, the discrete logarithm assumption for elliptic curves would be broken.

Alright now that I know the distance metrics is something which is not yet discovered, any suggestions on the most effective way to negate the poins without resetting itself to the inverse side would be great if you could explain it with an example...

The negation of a point (x, y) is just (x, -y).


text:
I'm Searching cryptocurrency exchange api
We want complete cryptocurrency trading service from api requirement all api where we can integrate all services in my UI.
long story in short we want any service provider backend in our UI.
API

User Registration API
Login API
User Verification API
Document Verification
User Wallet
cryptocurrency buy sell api
Track all transaction
Realtime cryptocurrency price api
Comparison api

Trading cryptocurrency:
   1. BITCOİN (BTC)
   2.   ETHEREUM (ETH)
   3.   DASH COİN (DASH)
   4.   LİTECOİN (LTC)
   5.   ETHEREUM CLASSIC (ETC)
   6.   RİPPELE ( XRP)
   7.   BİTCOİN CASH ( BCH)
   8.   MONERO (XMR)
   9.   ZCASH (ZEC)
   10.  QTUM (QTUM)
   11.  BİTCOİN GOLD (BTG)
   12.  EOS (EOS)
   13.  ICON (ICX)
   14.  VCHAIN ( VEN)
   15.  TRON (TRX)
   16.  AELF (ELF)
   17.  MITHRIL(MITH)
   18.  MONACO (MCO)
   19.  OMİSEGO (OMG)
   20.  KYBER NETWORK (KNC)
   21.  GOLEM (GNT)
   22.  HSHARE (HSR)
   23.  STALLER (STL)
   24.  UNIVERSA (UNTP)
   25.  ADA (ADA)
   26. USDT

Please suggest any api provider who can work in turkey.

CCXT is a python/javascript library with the functionality you request. You can then trade with any exchange you'd like such as Binance, Poloniex, etc.
Gekko is a similar open source library for Node with similar functionality.

how i can get apiKey and secret key ?

@Gausul you get your api key and secret key from each exchange you'd like, such as Binance, then you use this within the code to control your wallet buying/selling of other currencies.

my question i want build Binance like website where my user can register login and do all activity like Binance over the any service provider api.

so you want to create an exchange?

Yes we want build exchange website like Binance

here are a few resources I was able to find on this topic:
http://merehead.com/blog/build-online-trading-exchange-platform-bitcoin-crypto-currencies/
https://www.quora.com/How-does-one-start-a-cryptocurrency-exchange

also you may want to look into decentralized exchanges (smart contracts)


text:
How does a completely offline wallet "registers" and runs
A wallet which was made offline and will never ever see the internet how is it "registered" and runs in the blockchain. Is it through the watch-only wallet?

Related: https://bitcoin.stackexchange.com/q/13225/5406, https://bitcoin.stackexchange.com/q/4239/5406, https://bitcoin.stackexchange.com/q/23360/5406, https://bitcoin.stackexchange.com/q/34078/5406, https://bitcoin.stackexchange.com/q/80514/5406

There is no wallet registration in the Bitcoin blockchain. The Bitcoin blockchain is a public ledger that records transactions and nothing more. Wallets are completely isolated components from that. The primary definition of wallets is that they represent a set of private keys. So if you were to write 10 private keys on a piece of paper, that could also be considered a wallet. Anything beyond that is just additional functionality developed by developers for end users to help them manage their keys, sign transactions, etc. more easily. Until the key from your wallet becomes part of the previously mentioned public ledger (blockchain), no one in the world knows of its existence.

And how excatly is an offline wallet mentioned in the public ledger.

@Papi Wallets are not part of the public ledger (blockchain). Therefore, they are not mentioned in any way regardless of whether they are "online" or "offline".


text:
Why is Bitcoin Core not filling in PSBT_GLOBAL_XPUB field
When creating a Partially Signed Bitcoin Transaction (PSBT) on Bitcoin Core using the walletcreatefundedpsbt, walletprocesspsbt and send* RPCs, as well as the send dialog* in the GUI the PSBT_GLOBAL_XPUB field (defined in BIP 174) is not populated. Is there a reason for this omission?


text:
Bitcoin Core balance incorrect after connecting Sparrow wallet
I have a Sparrow wallet with previous transactions that was connected to an Electrum server. I installed Bitcoin Core v25, downloaded entire blockchain (no pruning) and switched my Sparrow settings from Electrum to Bitcoin Core. After the rescanning completed, the balance in Bitcoin Core is off by the amount in a change address (Sparrow has the correct balance). But the transactions tab in Core does show all of my transactions (including the outgoing one that created the change address). I ran a rescanblockchain command but that didn’t work.
I also have another computer with a similar setup (Sparrow connected to Bitcoin Core) but it does not have this problem - although the version of Bitcoin Core is older. Could it be something with v25 or another setting I need to add? Thank you.

There are similar questions (such as this) which don't have answers, so it might be an occasional problem with this combination?

I removed the Sparrow wallet and imported a native Bitcoin Core wallet directly, which finally showed the correct balance. I agree that it might be a bug with v25 and current Sparrow version (as it works with v23).

I found the reason for the unexpected balance - it was because apparently when importing a Sparrow wallet, it does so with "avoid_reuse" being set to true. This is evident when running "getbalances" command and seeing the "used" amount separately from the "trusted" amount. To rectify, simply open the console and run "setwalletflag avoid_reuse false". This updates the balance as expected. See this site for reference: bitcoincore.org/en/doc/0.19.0/rpc/wallet/getbalances

Thanks for returning to share your learnings! While it is generally safe to reuse addresses, it is recommended to use new addresses for every payment due to privacy. You can read more about that for example here: https://bitcoin.stackexchange.com/q/20621/5406

Leo, thank you for coming back to document your successful solution. You finally solved it for me! I tried so many different approaches. I even got close recently by running "getbalances" and finding the discrep between used and trusted. However, I was setting "avoid_reuse" in settings and config files rather than as a flag on the wallet itself.
I agree with Murch that address reuse isn't recommended, but to have wallets default to not showing a reused address as spendable is a bit maddening. Thanks again for your help.


text:
Possible to install Tailscale on a Bitaxe?
Does anyone know how to install Tailscale on a Bitaxe Gamma? I'd like to remotely log into my network and check the status of the Bitaxe outside of my home network. Tailscale is great for this, but not sure how to get into the Terminal on the Bitaxe box. And not sure if I run the Linux commands to install Tailscale, whether this would not break the Bitaxe.
Or any other thoughts on how to access outside the network (maybe via Tor)?

See https://bitcoin.stackexchange.com/q/123880/13866


text:
How does mining verify a transaction?
I’m very much new to understanding this whole bitcoin concept. As far as I’m concerned, nodes mine for a nonce that, when paired with the data of the block, result in a hash that suffices some requirement (like it needs to start with six 0s). I’m also under the impression that this process is what verifies the user isn’t ‘double-spending’ and has sufficient funds. How does doing this help confirm that?
Edit: and also a block is just a bunch of unverified transactions along with some additional data, right?

The purpose of mining is not verification but putting transactions into a sequence, a specific order.
Miners publish blocks of transactions in order.
If two or more miners publish a block at the same time, other nodes will eventually choose the block that forms the chain with the most work. The hash must be less than the current target independently calculated by every node.
When a transaction is included in a block, we say it is confirmed. Confirmation is not verification. Confirmation is of the order of transactions.
Verification is a checking of correctness performed by every Bitcoin node, including wallets. It is not a service performed for others. One of the checks is that a transaction does not spend money already spent by a transaction earlier in the order.

This whole bitcoin thing confuses me. What's the point of a blockchain and why does it need to be maintained? How does one 'double spend' and how can they be prevented from doing so? I swear I've read so much on it and it just seems like words to me. You don't have to answer all the questions, I'm just being expressively confused and frustrated

@Johnafoon: Try the search facility here, there are probably good answers to those questions.

Nodes extend their best chain with the first block they hear about. They will only reorganize if they learn about a chaintip with more work. As long as two chaintips are tied in work, nodes will stick to whatever chaintip they first heard about. If a lower hash were a tie breaker between competing chaintips that would enable selfish-mining and a variant of the Finney attack: https://bitcoin.stackexchange.com/q/53825/5406

You can think of transactions as destroying bills and creating new bills of total same value. Nodes maintain a current database of active bills, and will reject a transaction trying to use an old bill. That's the double-spend check. It requires look-up / delete / insert operations with the UTXO database.
Popular belief is that miners get paid for the job of verifying and assembling transactions into blocks, but that is wrong. That is a job any node is capable of doing and it doesn't cost them much. Your RPi node can assemble transactions into a "block template", but it just can't fill in the 1 blank that will satisfy the last consensus rule it needs to satisfy to be a valid block - the PoW difficulty check. That's why you can't simply kick out one block and replace it with another, because finding that nonce takes time. PoW's purpose is to increase the cost of undo.
Miners get paid for the job of filling in the nonce that will produce a satisfying block header hash, they get paid for the hashes because the only way to find a satisfying nonce is to make lots of guesses and hash the guesses. The network essentially bids for the hashes with block reward subsidy and users bid for the hashes with their transaction fees, and the more total reward the more secure the whole network becomes* since the cost of "undoing" a block will be bigger because difficulty will grow higher.
(*assuming constant price)
Each transaction is a business transaction with a miner, they're the recipient of the implicit output (the fee), which is a payment from user for the service of maintaining the immutability property of the ledger! Of course miners would include their own business transactions into blocks they create!
During the early days of Bitcoin, nodes did all these jobs:

Verified incoming transactions and blocks
Made their own transactions and broadcast them to the network
Assembled transactions into a block template (full block, with just the nonce missing)
Filled in the nonce to make the block header pass the PoW check

Since then, the jobs have been separated.
Now it's mostly pools who do 1-3, and "miners" are just blindly doing the 4.: getting 80 bytes of block header from the pool and grinding the nonce. How do the miners verify what they're mining? Well, they have to get paid eventually, right?
Miners get paid their reward from the pool, so to independently verify they're getting paid correctly in proportion to their work, they also need to have some regular node, which can be off-site and doesn't need to be involved in mining! In that case they run a node to verify they themselves got paid for some past work in the right currency! This gives pools the power to direct hash-power of many as they like, but the pool can't really hide what they're doing, so everyone's on good behavior.
Note that "miners" are not exclusive to a single blockchain network. All Bitcoin miners are sha256d miners, but not all sha256d miners are Bitcoin miners! The era of one blockchain is long gone. Networks bid for the hashes, miners sell the hashes.
What happens if a subset of nodes changes the rules? All nodes under old rules will reject changed rules, and all nodes with changed rules will reject old rules. This happened in 2017 with the BCH fork. If both will be mined, then both will continue to exist independently.
Which will get more hashes? It will depend on market price.
Miners pay for their energy usage and hardware in some external currency, they have to exchange it to pay the bills. If they can exchange the blockchain's native currency (BTC, BCH) for the cost currency (USD, CNY), and still have something left -- then they can make a profit. Their profit depends on there being liquidity for the native currency and the native currency having value! So they don't just arbitrarily decide which network to mine. They have strong incentive to get a ROI on their hardware, and optimal mining is to mine ALL networks which have a liquid market for the rewards, and in proportion to market value of their block rewards.


text:
Why is the blockchain important?
The title says it all. What’s it important for? Is it just important for documenting all transactions and so it’s basically just a database? I know how blocks are made, please remain relevant.

It's not just a database, though it might have an interface similar to one. But it does more things.
First of all the chain helps very efficiently compare your state of the database with others. A single 32-byte value "summarizes" the entire state in a cryptographically secure way, so that if multiple people come together and compare their hashes with each other, if they match, they know that they all have exactly the same view of the database. There are other ways to summarize a database like this, using trees etc that might be more efficient for databases you want to read and write to, but a linear chain is the most efficient way for databases where you only want to write extra data to.
A second important property of the Bitcoin blockchain specifically is that proof-of-work is added to each block in the chain. This means that in the case where different people have different of these summaries, we have a very reliable way to come to agreement on which one of them is the one we want to look at. If in the room multiple summaries are presented, everyone can easily come agreement on a single one in a way that will (a) always work and (b) is very hard to exploit by a cheater that wants to convince people to look at the wrong one.
But ultimately, the question could be "why do we need to keep all transactions since ever in the first place?". That's a legit question. In theory, these summaries could just summarize the current "state" of the database, not all the history. And we would have the same system to decide between histories using the proof-of-work. But then we are trusting the miners that create the proof of work to make honest summaries. The goal of Bitcoin is to minimize trust in unknown third parties, so all history is kept since its inception so that everyone that participates can reconstruct the state of the database by replaying all transactions.
So to conclude, the blockchain is really the thing that enables Bitcoin to run in an almost completely trustless way, where all participants can do all verification on their own and the proof-of-work is only needed to make them decide between two different equally-valid states. This way we have a very robust system of forming consensus on who owns which money and who is allowed to spend it.

I am going to focus on why the blockchain is of vital importance to the Bitcoin currency.
As you say, the blockchain is simply a list of transactions. A transaction journal There's not a lot more to it in fundamental data.
Bitcoin's inventor intended to create a system with the following characteristics:

Digital cash, not accounts at financial institutions.
Purely peer based, all users have identical roles, there are no trusted institutions.
Free from government control.
Limited money supply - capped at ₿21M.

What cash depends on is features that allow end users to detect forgeries. We can bite a purported gold coin to see if it is soft metal, we can look at the printing on a paper banknote to see if it looks like intaglio, we can hold it up to light to look for metal strips in the paper, for watermarks and holograms. Our digital cash needs some equivalent features.
Since Bitcoin is digital and digital data is trivial to duplicate, when we receive digital cash in the form of Bitcoin, how do we know if it genuine or a worthless digital copy?
We do this by every person keeping their own copy of the list of all Bitcoin transactions since the beginning of the Universe. We can each check for ourselves that each transaction has outputs whose total value is no more than the total value of all its inputs. We can each check that those inputs do indeed come from outputs of prior transactions.
Since we get the list of transactions from other anonymous Bitcoin users, how do we know that the transaction data is not faked by some malicious person? Every transaction has digital signatures which we can each check for ourselves.
So the blockchain is absolutely vital to the existence of Bitcoin.

The blockchain provides a canonical order to transaction events. Putting transactions in order breaks ties between competing transactions and solves the double-spend problem. It also permits all participants in the scale-free network to converge on a single shared state by applying all instructions in that order. As every participant has processed the full history of prior events, each node can unilaterally track all existing portions of bitcoins, making it trivial to protect against forged funds. The protocol regulates the cadence of state updates in the network per the proof-of-work requirement. This objective requirement guarantees that an open set of authors can collaborate on writing the blockchain updates and that there is sufficient time for all participants to apply the latest set of changes.
The blockchain ensures that all processes in the network are open and auditable to all participants.


text:
What to pass in Transaction Input using Bitcoinj library
URGENT - Need help with setting up Transaction Input and Output objects

Transaction rawTransaction = new Transaction(params);
txnAmount = Coin.valueOf(50000000);
rawTransaction.addOutput(txnAmount, toAddress);

txFee = Coin.valueOf(12800);
amountToReturn = balance.subtract(txnAmount);
amountToReturn = amountToReturn.subtract(txFee);

rawTransaction.addOutput(amountToReturn, fromAddress);

I am able to setup transaction outputs but not able to figure out how to set transaction inputs for fee
Currently with above code the signed transaction is having 0 fee


text:
Can I have the same wallet opened in multiple computers?
I wanna put my wallet.dat to another node, and keep them online at the same time, Can I do like that?  and is there any problem?
BTW, how can I  do load balance with bitcoin node?  Thx

Provided that your wallet is an HD wallet (Bitcoin Core will show you a small HD  in the bottom toolbar if it is), then you can safely use it on both machines, as addresses are deterministically generated.
If your wallet is individual key based, then after you copy the wallet to the second machine, they will diverge and generate different keys for future addresses.


text:
how to get block information using node js
I have used bitcoin-core package in node js to get the information about the block detail using rpc command.
For example:
var Client = require('bitcoin-core');

const client = new Client({ headers:'false', host:'127.0.0.1', network:'testnet', password:'xxxx',port:'18332', ssl: {
    enabled: false,
    strict: false
  }, timeout:'3000', username:'xxxx' });

client.getBlockchainInformation().then((help) => console.log(help));

It throws below mentioned error:
unhandled rejection rpcerror: not found

Any solution for this.
Thanks in advance.

That code is trying to connect to a bitcoin testnet node RPC running locally (127.0.0.1 port 18332). Do you have one running locally?

Yes I have one running locally.

The function client.getBlockchainInformation and the other methods exposed by the bitcoin-core npm module use bitcoin-core's REST interface. In order to use it, however, it must be enabled when you start bitcoind with the -rest flag.

The REST API can be enabled with the -rest option.
The interface runs on the same port as the JSON-RPC interface, by
  default port 8332 for mainnet, port 18332 for testnet, and port 18443
  for regtest.

e.g.:
$ bitcoind -rest
or in bitcoin.conf
rest=1

Can you please suggest me how tether node is setup like a bitcoin.

If it is unrelated to this post, please create a new question.


text:
How to handle multiple inflight transactions from same address?
How are multiple inflight transactions from the same address handled? From my understanding, there are two options depending on how change is handled, but both seem to have substantial drawbacks:

If change for each transaction generates a new address for the change - the usual handling - then you can't handle two transactions since they will both want to use the same unspent output address. And they will both use it entirely by definition. The ergonomics of this seems poor - I can only ever do one transaction from an address at a time. In that case I would want bitcoins sent to me to always be shredded (no bills larger than $20 please).
If I have change sent sent back to the original address, does it matter in what order they are added to the chain? I can't see why. This however allows everybody to track my wallet and where I'm transacting. Also I don't know if all wallets support this.

Is my understanding correct? (This all started with me diving down the rabbit hole on how Lightening and Plasma worked.)

Addresses are a construct of wallets. The bitcoin system itself doesn't know or care about them.  Coins being spent are identified by their creating txid and output-index.
The network verifies that the provided signature is accepted by the required scriptPubKey, but the scriptPubKey (nor the addresses that wallets map to scriptPubKeys) is never used to lookup or in any way reference the coins being spent.
The model you seem to be imagining is more like some other altcoins and can indeed have poor ergonomics.
Normally change goes to a new address and those coins can be immediately spent without waiting for the first transaction to confirm.  It sounds like from your question that you might have thought the change could not be spent before the transaction creating it was confirmed, but this is not the case.
I am not aware of any reason why reusing an old address for change would benefit a user, but the system will let you do it without it causing any problems.
In Bitcoin for privacy and security reasons users are advised to avoid reusing addresses, but this doesn't have any interaction with the kinetics of spending coins.

How are multiple inflight transactions from the same address handled?

Multiple unspent outputs from the same address can exist at the same time, from which you can send multiple transactions. Also, you can broadcast a transaction which spends output 1 to a new output 2, and then immediately broadcast another transaction which spends output 2 from the previous transaction.

change for each transaction generates a new address for the change

Change doesn't generate addresses, the wallet software does. And it does not have to generate a new address for change, you can send change back to the original address. Of course, this does help protect privacy, and depends on how your wallet software handles change and address generation.

If I have change sent sent back to the original address, does it
  matter in what order they are added to the chain? I can't see why.

You just have to make sure you don't try to spend a previously spent output.

This however allows everybody to track my wallet and where I'm
  transacting. Also I don't know if all wallets support this.

Not necessarily, because it is not apparent which output was the change output, if you use a different address. See https://bitcoin.stackexchange.com/a/77520/60443

I'm think I made some terminology mistakes (accidentally saying address when I meant transaction output id, I think, or whatever it is called). This is leading to confusing answers. I'm going to probably delete this question tomorrow and resubmit it with the terminology fixed and a more detailed description of the issues.

”...they will both want to use the same unspent output address”.

Unspent outputs are not listed by address. Multiple UTXOs can exist for the same address, and each can be spent individually. Each entire UTXO must be spent, not the entire ‘address balance’. The concept of ‘address balance’ doesn’t exist at the technical level of the bitcoin blockchain. It is all individual UTXOs.
A UTXO can only be spent once, and any attempt to spend an already-consumed UTXO will be invalid.
As JBaczuk mentioned, you can also have a chain of transactions within a block, where each transaction spends the output of another transaction that is listed earlier within the same block (ordering is important!).
So it is fine to have multiple transactions incoming/outgoing at the same time. As long as they’re valid, they should confirm.


text:
HD wallet getting every time diffrent derivedPrivatekey from same derivation path
every time i am getting diffrent orderPrivateKey and address for same derivation path. but it should be same as i am not changing derivation path.
var bitcore = require('bitcore-lib');
var DerivationPath = "m/44'/145'/0'/0"
var hdPrivateKey = new bitcore.HDPrivateKey('testnet','xprv8ZgxMBicQKsPdsKyyKSwTJtBXWB1rbDwEAxW3xV6xwNeCHs3n9kvFsCZim8KKMgc3wVGRJR4kJ82t9mRRr8TZ3Ybpxqp8brRA7aMVDJgCt2');
var orderPrivateKey  = hdPrivateKey.derive(DerivationPath).privateKey;
var Address = orderPrivateKey.toAddress().toString();

can anyone explain it??

You have the data and network arguments swapped when you create the hdPrivateKey, see Private Key | Bitcore. Try this:
var bitcore = require('bitcore-lib');
var DerivationPath = "m/44'/145'/0'/0"
var hdPrivateKey = new bitcore.HDPrivateKey('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi', 'testnet');
var orderPrivateKey  = hdPrivateKey.derive(DerivationPath).privateKey;
var Address = orderPrivateKey.toAddress().toString();
console.log('Address: ' + Address);


text:
Trying to find the raw genesis transaction length
I see that many different altcoins have different lengths for the initial genesis tx.  How would I go about finding the length of the initial genesis tx?  I saw another answer but I have no need of making it as complicated; I just need the length and nothing else.
For example, Bitcoin's is
01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000.

However, altcoins have different lengths.  Is there an identifier I can use to determine the length of the genesis tx and nothing else?
EDIT: I am making a block explorer so I cannot use a block explorer to help me in getting info.

The transaction you posted is 204 bytes. Is that what you're looking for?

@NickODell That's only for bitcoin.  What I need is http://bitcoin.stackexchange.com/questions/36321/extract-genesis-block-raw-tx-data in a condensed format, preferably done in bash instead of python.

Unfortunately, the genesis block is not indexed in most altcoins (because they forked from bitcoin and kept the same bug), so you can't really get access to it via the RPC methods.
What you could do instead:

Use a block explorer that will tell you the size of the transaction. For example, blockchain.info makes this information available (204 bytes).
Find the parameters file and put a print the size of the genesis block to stdout.

The second option basically entails putting the following lines at the end of CMainParams() and then compiling.
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION);
ssBlock << genesis;
printf("block: %s\n", HexStr(ssBlock.begin(), ssBlock.end()).c_str());
printf("block size: %i\n", (int)::GetSerializeSize(genesis, SER_NETWORK, PROTOCOL_VERSION));
printf("tx size: %i\n", (int)::GetSerializeSize(genesis.vtx[0], SER_NETWORK, PROTOCOL_VERSION));

This will print the raw block data, it's size, and the transaction's size. (Note, this is untested, but something along these lines should work)
NOTE: It's possible, although not the norm, to put multiple transactions in a genesis block. Just check that your assumption is correct.

Size would definitely work for this situation.  Only problem is that I am trying to make the block explorer for the coin via Abe, so option 1 isn't available to me.  Could you explain the second option?  I am guessing you mean chainparams.cpp but I have no idea how to print the size of the genesis block.

@AnimalTesting, see updated answer.

How would I use the new code?  What command do I have to pass into the daemon?

It requires actually re-compiling the daemon after you have put the code in place. Then just start the daemon and it will print.

Also, will this say the size of the block or transaction?  You said "This will print the raw block data and it's size."  But in the first option, you show how to find the size of the transaction.

It gave this error when compiling: http://pastebin.com/qgAjUFyg

@AnimalTesting, updated answer.

Let us continue this discussion in chat.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Error when trying to use OP_CHECKSEQUENCEVERIFY from bip112 on testnet
When I try to spend an utxo sent to a pay to script hash, with the script 5 OP_CHECKSEQUENCEVERIFY OP_DROP OP_PUBKEY OP_CHECKSIG I get the following error.
Any help would be greatly appreciated.
$ bitcoin-cli --rpcuser=bitcoinrpcuser --rpcpassword=bitcoinrpcpass --rpcport=18332 sendrawtransaction 0200000003530699e6ac0766846d1ce5b2b76014b23c3dbb67eedc69523bb11205435236ea0000000070483045022100d48af25c0e1816dd0007bdb0907ae2c4cf96602fb41a089a975eba017f9295af022000af5806f68ac0ba6ac2ada355e8f6050ccfb4d7020ff7d22788be10a07d51a9012655b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac05000000004a8cd4b96db4a786d560e47a8864a580448de655f716a9ddcf9f25b945a7ff00000000704830450221009914d50bfcc49b1f539824c04f8bc22520906dd24be8cbf5d3c9eafd78e8b1400220305d70a8888e1b8f7bbbaef0e1b3d8d1b9509561f4fff53b194315989122ffb1012655b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac0500000007921ebd8395a377ce80f9bf08295bc7603b9014357fce90508ffb692dbd474d00000000704830450221008fab401cba85dcc1aac10d9949ca066e8c2cd86ca153a1e0059d839372bf8f12022066c97d30d95286185497d2f9622642ef7d9e511e8c4f2686c9d12504273ac80d012655b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac050000000336150000000000001976a9140d98bebd47d04361d889e11a977a9ab61665d59188ac00000000000000001e6a1c0131b3774cfeb0198684fce15e0fdf7709e830c9387a1ac6e99b6647c67401000000000017a9149c202ce4f6cafc3420271e79be29911288c513268700000000
error code: -26
error message:
64: non-mandatory-script-verify-flag (NOPx reserved for soft-fork upgrades)

$ bitcoin-cli --rpcuser=bitcoinrpcuser --rpcpassword=bitcoinrpcpass --rpcport=18332 decoderawtransaction 0200000003530699e6ac0766846d1ce5b2b76014b23c3dbb67eedc69523bb11205435236ea0000000070483045022100d48af25c0e1816dd0007bdb0907ae2c4cf96602fb41a089a975eba017f9295af022000af5806f68ac0ba6ac2ada355e8f6050ccfb4d7020ff7d22788be10a07d51a9012655b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac05000000004a8cd4b96db4a786d560e47a8864a580448de655f716a9ddcf9f25b945a7ff00000000704830450221009914d50bfcc49b1f539824c04f8bc22520906dd24be8cbf5d3c9eafd78e8b1400220305d70a8888e1b8f7bbbaef0e1b3d8d1b9509561f4fff53b194315989122ffb1012655b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac0500000007921ebd8395a377ce80f9bf08295bc7603b9014357fce90508ffb692dbd474d00000000704830450221008fab401cba85dcc1aac10d9949ca066e8c2cd86ca153a1e0059d839372bf8f12022066c97d30d95286185497d2f9622642ef7d9e511e8c4f2686c9d12504273ac80d012655b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac050000000336150000000000001976a9140d98bebd47d04361d889e11a977a9ab61665d59188ac00000000000000001e6a1c0131b3774cfeb0198684fce15e0fdf7709e830c9387a1ac6e99b6647c67401000000000017a9149c202ce4f6cafc3420271e79be29911288c513268700000000
{
  "txid": "c927276d8ac392b88225ae25d596b8e3f658195232200a1fe83788497bc46c66",
  "size": 574,
  "version": 2,
  "locktime": 0,
  "vin": [
    {
      "txid": "ea3652430512b13b5269dcee67bb3d3cb21460b7b2e51c6d846607ace6990653",
      "vout": 0,
      "scriptSig": {
        "asm": "3045022100d48af25c0e1816dd0007bdb0907ae2c4cf96602fb41a089a975eba017f9295af022000af5806f68ac0ba6ac2ada355e8f6050ccfb4d7020ff7d22788be10a07d51a9[ALL] 55b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac",
        "hex": "483045022100d48af25c0e1816dd0007bdb0907ae2c4cf96602fb41a089a975eba017f9295af022000af5806f68ac0ba6ac2ada355e8f6050ccfb4d7020ff7d22788be10a07d51a9012655b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac"
      },
      "sequence": 5
    },
    {
      "txid": "ffa745b9259fcfdda916f755e68d4480a564887ae460d586a7b46db9d48c4a00",
      "vout": 0,
      "scriptSig": {
        "asm": "30450221009914d50bfcc49b1f539824c04f8bc22520906dd24be8cbf5d3c9eafd78e8b1400220305d70a8888e1b8f7bbbaef0e1b3d8d1b9509561f4fff53b194315989122ffb1[ALL] 55b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac",
        "hex": "4830450221009914d50bfcc49b1f539824c04f8bc22520906dd24be8cbf5d3c9eafd78e8b1400220305d70a8888e1b8f7bbbaef0e1b3d8d1b9509561f4fff53b194315989122ffb1012655b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac"
      },
      "sequence": 5
    },
    {
      "txid": "4d47bd2d69fb8f5090ce7f3514903b60c75b2908bff980ce77a39583bd1e9207",
      "vout": 0,
      "scriptSig": {
        "asm": "30450221008fab401cba85dcc1aac10d9949ca066e8c2cd86ca153a1e0059d839372bf8f12022066c97d30d95286185497d2f9622642ef7d9e511e8c4f2686c9d12504273ac80d[ALL] 55b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac",
        "hex": "4830450221008fab401cba85dcc1aac10d9949ca066e8c2cd86ca153a1e0059d839372bf8f12022066c97d30d95286185497d2f9622642ef7d9e511e8c4f2686c9d12504273ac80d012655b27521027690887ac2455b6b19c5f4268a8a9c09228351368b9a7643ad791282c3148759ac"
      },
      "sequence": 5
    }
  ],
  "vout": [
    {
      "value": 0.00005430,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 0d98bebd47d04361d889e11a977a9ab61665d591 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9140d98bebd47d04361d889e11a977a9ab61665d59188ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "mgkr4TjXCGMJSpcoQGi6wDkr72NTtkuMDs"
        ]
      }
    },
    {
      "value": 0.00000000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_RETURN 0131b3774cfeb0198684fce15e0fdf7709e830c9387a1ac6e99b6647",
        "hex": "6a1c0131b3774cfeb0198684fce15e0fdf7709e830c9387a1ac6e99b6647",
        "type": "nulldata"
      }
    },
    {
      "value": 0.00095430,
      "n": 2,
      "scriptPubKey": {
        "asm": "OP_HASH160 9c202ce4f6cafc3420271e79be29911288c51326 OP_EQUAL",
        "hex": "a9149c202ce4f6cafc3420271e79be29911288c5132687",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2N7UjwnxwetBQB8pEaufas4bhS6wh4JjBoy"
        ]
      }
    }
  ]
}

Edit:
When I replace the OP_CHECKSEQUENCEVERIFY with a OP_NOP I can spend it just fine.
As demonstrated by the p2sh address 2N6PWjG9eFjuKcxHf8pvQdHityorvyAerFT for the script 1 OP_NOP OP_DROP OP_PUBKEY OP_CHECKSIG

I was not running version 0.12.1 of bitcoind, as I mistakenly didn't overwrite the binary when upgrading.
Now that I have upgraded it has been accepted into the mempool and I expect it to be included in a block as soon as upgraded miner includes it.

What are you setting the input's nSequence value to?

5 as can be seen in the decoded raw transaction above, however I think I may just have used an outdated bitcoind by mistake. Currently recompiling to verify.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Transaction using OP_CHECKSEQUENCEVERIFY not accepted by the network
When I publish the testnet transaction below, it does not seem to be accepted by the network.
Publishing the transaction seems to work fine as it returns the txid, but the transaction does not show up on any of the blockexplorer services and does not get mined.
$ bitcoin-cli sendrawtransaction 0200000001f4db00105cdc7cab7d26ae018154540faa2a20872a1e263c6948c5a4e44d060f00000000f947304402204c7cbcc610ac5ee744dc7de6fc31421217dbd066e41fd377dbe16dbd70372d3d02201e74b66967b44548c007a011d98bb42a9f22651392232b87a640dcf8ad55e1d20100004cad6352210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135210327f017c35a46b759536309e6de256ad44ad609c1c4aed0e2cdb82f62490f75f852ae6763a914a7ec62542b0d393d43442aadf8d55f7da1e303cb88210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135ac6755b275210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135ac68680500000002c28d0000000000001976a914d36d5a91d3f05b2c23cf4fdcac88e4f8b50cec9088ac00000000000000001e6a1cdbb957b39547c4b841700768d623a3f4c849743272bc7783855c9c4d00000000
d208b659eaca2640f732b07b11ea9800c1a0bb4ffdc03aaf82af76c1787570ac

Here the decoded transaction.
$ bitcoin-cli decoderawtransaction 0200000001f4db00105cdc7cab7d26ae018154540faa2a20872a1e263c6948c5a4e44d060f00000000f947304402204c7cbcc610ac5ee744dc7de6fc31421217dbd066e41fd377dbe16dbd70372d3d02201e74b66967b44548c007a011d98bb42a9f22651392232b87a640dcf8ad55e1d20100004cad6352210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135210327f017c35a46b759536309e6de256ad44ad609c1c4aed0e2cdb82f62490f75f852ae6763a914a7ec62542b0d393d43442aadf8d55f7da1e303cb88210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135ac6755b275210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135ac68680500000002c28d0000000000001976a914d36d5a91d3f05b2c23cf4fdcac88e4f8b50cec9088ac00000000000000001e6a1cdbb957b39547c4b841700768d623a3f4c849743272bc7783855c9c4d00000000
{
  "txid": "d208b659eaca2640f732b07b11ea9800c1a0bb4ffdc03aaf82af76c1787570ac",
  "size": 373,
  "version": 2,
  "locktime": 0,
  "vin": [
    {
      "txid": "0f064de4a4c548693c261e2a87202aaa0f54548101ae267dab7cdc5c1000dbf4",
      "vout": 0,
      "scriptSig": {
        "asm": "304402204c7cbcc610ac5ee744dc7de6fc31421217dbd066e41fd377dbe16dbd70372d3d02201e74b66967b44548c007a011d98bb42a9f22651392232b87a640dcf8ad55e1d2[ALL] 0 0 6352210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135210327f017c35a46b759536309e6de256ad44ad609c1c4aed0e2cdb82f62490f75f852ae6763a914a7ec62542b0d393d43442aadf8d55f7da1e303cb88210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135ac6755b275210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135ac6868",
        "hex": "47304402204c7cbcc610ac5ee744dc7de6fc31421217dbd066e41fd377dbe16dbd70372d3d02201e74b66967b44548c007a011d98bb42a9f22651392232b87a640dcf8ad55e1d20100004cad6352210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135210327f017c35a46b759536309e6de256ad44ad609c1c4aed0e2cdb82f62490f75f852ae6763a914a7ec62542b0d393d43442aadf8d55f7da1e303cb88210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135ac6755b275210399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135ac6868"
      },
      "sequence": 5
    }
  ],
  "vout": [
    {
      "value": 0.00036290,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 d36d5a91d3f05b2c23cf4fdcac88e4f8b50cec90 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914d36d5a91d3f05b2c23cf4fdcac88e4f8b50cec9088ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "mznssZhbYjU5GRNupZ455TKu2BYrkmfQHC"
        ]
      }
    },
    {
      "value": 0.00000000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_RETURN dbb957b39547c4b841700768d623a3f4c849743272bc7783855c9c4d",
        "hex": "6a1cdbb957b39547c4b841700768d623a3f4c849743272bc7783855c9c4d",
        "type": "nulldata"
      }
    }
  ]
}

Here the disassembled P2SH script.
OP_IF
    OP_2 0399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135 0327f017c35a46b759536309e6de256ad44ad609c1c4aed0e2cdb82f62490f75f8 OP_2 OP_CHECKMULTISIG
OP_ELSE
    OP_IF
        OP_HASH160 a7ec62542b0d393d43442aadf8d55f7da1e303cb OP_EQUALVERIFY 0399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135 OP_CHECKSIG
    OP_ELSE
        OP_5 OP_NOP3 OP_DROP 0399e3dde1d1853dbd99c81ba4f2c0cca351b3cceecce7cd0bd59acc5789672135 OP_CHECKSIG
    OP_ENDIF
OP_ENDIF

Edit: It does seem to be in the mempool (at least on my end)
$ bitcoin-cli getrawmempool
[
  "d4147e3350c7135ea8988eaa350d4fec00980462aa2df504b7bf946a28d1f100",
  "2ecf4ebd5f850da38926e58673cec0b5ec87569acf6e1db888c42fbaeb7c430a",
  "f080088e292aedc954826ba6f9c0cbbbb00364305b61203e8720ae3c8cc3c30b",
  "b54d0c1ceaa851a165e6d8f298bcbdb2bcbd8001bb5fe743eb12de2d6335a113",
  "89e46f5baabbf7e60cb608ff2a82b822b575983997af979cc15efd3151d94021",
  "f097c66979654beea2cb11fe704a84f7abccb2ab8d33f40015c7a3c032845c28",
  "82c13c01af677325ee7f7ad74604a37deb75d31ba9749c9125b64b42e5905434",
  "68baab281fb0509c7e8badddf1300ad3e572054566c07c01fcf4598768d0a398",
  "d208b659eaca2640f732b07b11ea9800c1a0bb4ffdc03aaf82af76c1787570ac",
  "136b76344299ad409fbba3877ec409476ed71b243bf688c84b2cb56cf77f2db3"
]

This seems to be an issue with not enough miners being up to date. Eventually the transaction did go through.
https://test-insight.bitpay.com/tx/d208b659eaca2640f732b07b11ea9800c1a0bb4ffdc03aaf82af76c1787570ac


text:
CGMiner and 5830's give my the BSOD and GPU hangs, DEAD threads
I recently switched to CGminer from phoenix from GUIminer. And seem to be having some issues.
System: Windows 7 64bit, x4 5830's
-Timeline-
AMD catalyst: 13.1
GPUs: 5830x2 7770x1
Miner: CGminer newest stable release 10.5 I think.
Sum: Worked well except for flashing squares on the screen when mining and using the desktop. Saw a post that said update catalyst to 13.2 for no squares.
~~Changelog: updated to 13.2 catalyst, returned the 7770 (money issues)
AMD catalyst: 13.1
GPUs: 5830x2
Miner: CGminer newest stable release 10.5
Sum: Works well for a few hours (the upgrade to 13.2 also removed the squares), then I either get a DEAD thread for the gpu doing the desktop, or I cannot get windows to return to desktop after it sleeps, or just a good 'ol BSOD.
I was reading around and it said that CGminer makes some binaries on initial run and only initial run. So do those binaries contain info about old 7770 that I removed and now it is conflicting somehow? Should I just reinstall CGminer?
Or do people know of issues with the 13.2 CataContCent?
OP EDIT: test config 1
{
"pools" : [
    {
        "url" : "stratum.btcguild.com:3333",
        "user" : "MY USER",
        "pass" : "MY PASS"
    }
],
"intensity" : "d,9,9,9",
"temp-cutoff" : "95,95,95,95",
"temp-overheat" : "85,85,85,85",
"temp-target" : "75,75,75,75",
}

What I want my conf to do. Put the three 5830's not doing the desktop balls to the wall. The one I am using for desktop try and do the best it can but do not interfere with desktop.
Turn off any GPU that hits 95C, try to run them all at 75C.
No overclock on any GPU. I do not wish to slow them down or speed them up yet. I just want them to run without crashing my system first. I don't care about fanspeed/noise.
How do I know my 'd' setting will hit GPU0 (my desktop)?
Any other important settings that I removed?

Try to lower GPU clock a little bit to let's say 900MHZ or stock, and also make sure that the memory clock is not lower than 300MHZ. After that try to keep an eye on the GPU temperatures as this may be the cause of the sudden BSOD. Also there is a intensity parameter, if you keep it as 9 then try to lower it to 7. My config for 5830 looks like this:
{
"pools" : [
    {
        "url" : "mint.bitminter.com:8332",
        "user" : "username_workername",
        "pass" : "worker_password"
    }
],
"intensity" : "9,9,9,9",
"gpu-engine" : "0-950,0-950,0-950,0-870",
"gpu-fan" : "0-85,0-85,0-85,0-85",
"gpu-memclock" : "300,300,300,300",
"gpu-powertune" : "20,20,20,20",
"temp-cutoff" : "95,95,95,95",
"temp-overheat" : "85,85,85,85",
"temp-target" : "80,75,75,80",

"algo" : "4way",
"auto-fan" : true,
"auto-gpu" : true,
"expiry" : "120",
"failover-only" : true,
"gpu-threads" : "2",
"log" : "5",
"queue" : "1",
"retry-pause" : "5",
"scan-time" : "60",
"temp-hysteresis" : "3",
"worksize" : "0",

"donation" : "0.00",
"shares" : "0",
"kernel-path" : "/usr/local/bin"
}

and works for over a year now :)

I need to write my own config file first too I guess. I think my problem lies in reinstalling CGminer though. This log file you posted, it is for 4 5830's right? Could you post the entire file?

What version of Catalyst and CGminer do you have also?

Could I send you my config file I am about to write here in a few mins and see if it is proper?

I have edited my answer and included whole file. Yes, this is for 4 graphic cards, if you want less then simply remove additional values.
Catalyst 11.6 (year ago), AMD SDK 2.5. Installing newer catalyst was causing a lot of problems in my case. Newer drivers works fine with 7970 cards but with 5830 I decided to stick with 11.6. Still getting roughly 310mhash

Well, I guess I cannot PM you. I will post my config in the OP. Look it over if you would.

If you want you can send me your config, I will take a look.

I ckecked your config file and...If you don't want to speed them up or slow them down then still add "gpu-engine" : "0-800,0-800,0-800,0-800", and then "auto-gpu" : true, and "auto-fan" : true, You will make sure that in the situation where the graphic cards are getting really hot cgminer has the rights to lower the GPU speed in order to maintain temperature. Setting auto-fan to true will help you to avoid fans being used to much when not needed.

let us continue this discussion in chat


text:
How can I determine my cryptocurrency exchange rate according to demand and supply by programmatically?
I know exchange rate depends on so many factors theoretically, but how can I determine my cryptocurrency exchange rate according to demand and supply by programmatically?
Is there any standard algorithm to increase and decrease the value of cryptocurrency(ex. in USD) based on demand and supply?
How Bitcoin exchange rate increase and decrease automatically, Please let me know, is there any algorithm which can estimate the value of Bitcoin in USD and increase/decrease it's value(in USD) automatically.

What exactly do you want? Are you asking about price predictions? If yes, then no one can do that.

I want to know is there any standard algorithm by which value of any cryptocurrency increases or decrease.

no, there isn't an algorythm. Exchange rates are based on market factors like supply and demand, and these are not constant factors, I'd define them as being highly irrational and complex (as we humans are). So the difference between predicting the market future and throwing shells can be seen every day in FIAT world. A highly complex topic, with always unclear outcome.

Price of bitcoin is determined by the traders
Suppose there are 2 Traders Person X and Person Y
Then consider the following use case.

1.If person X has N amount of bitcoins and then he can choose to sell them at P amount of price.
2.Person Y wants to purchase the Bitcoin then he can choose to bye N amount of bitcoins for price P1.
3.If P=P1 then N amount of bitcoins are transferred to account of Y.
4.In the same way if the Buyers are decreasing the price and continuously finding the sellers for descried price then the price
  goes on decrising

Vise-versa if the sellers are incising the sell price and continuously finding the buyers for increased price then the price of
  bitcoin goes up.
The third condition which rarely occurs is If sellers trade and buyer trade is not matching then the price of bitcoin is determined to
  the midpoint of lowest sell order and highest buy order.

ie. If highest bye order is for 10L/BTC and lowest sell order is for
  15L/BTC then the price will be set to 12.5L/BTC and users will trade
  according to that.

Thank you for your valuable answer, is there any specific algorithm to increase and decrease the value of cryptocurrency(in USD) based on demand and supply.

I haven't find any such algo yet,But you can place bye and sell orders 20% lower or higher than current price OR you can write your own scripts/algo if the Exchange where you are trading expose the API for such purposes


text:
how to get the whole balance of a privatekey or publickey BTC
As there are some bitcoin address types of one privatekey or publickey. I can get the balance of one address, but how can I get the whole balance of the privatekey or publickey. How can list all the address from one privatekey or publickey. What's more how to process multisig address which generated from not the same privatekey of publickey.

do you want to know how to do this for bitcoins with the bitcoin client, or any other wallet, or are you looking for a program (in which language) to extract this data for you? A general guideline is here: https://bitcoin.stackexchange.com/questions/10090/how-to-get-an-addresss-balance-with-the-bitcoin-client

@pebwindkraft In my question I said, I know how to get the balance of one address. Here I want to get the whole balance from the addresses generated from one public key or privatekey.

@pebwindkraft any language is ok. I just want to know the idea to make it.

You will have to generate all the addresses corresponding to the public or private key you want to check, and then look for them all in the UTXO set. For example you might want to look for P2PK, P2PKH, P2WPKH, 1-of-1 multisig address with just that public key, etc. There is no "one search fits all"

Should other multisig apart from 1-of-1 included, such as 1-of-2, 2-of-3.

@KrisRoofe there are technically a near infinite possible amount of them, no point checking addresses unless you think someone might have sent something to them

next to the answer from MeshCollider, I would like to outline a bit more, what can/cannot be done...

How can I get the whole balance of the privatekey or publickey?

a priv/pubkey pair can generate several addresses. A privkey is the most standard used for P2PKH addresses (beginning with "1" on bitcoin network). They can be derived from a compressed or an uncompressed pubkey. A good playground is here. Then you can create P2SH addresses, of all kind with this key. They would start with a "3". And yes, multisig addresses would just be one of the possibilities. There are many combinations possible (1-of-1, 1-of-2, 1-of-3, 2-of-3, 2-of-4 ...), each resulting in a different "type 3" address. So if you have created the addresses within bitcoin client, you can use the command "getbalance". This command is linked to accounts, and once the addresses are grouped in accounts, one can display total balance in wallet or particular accounts. Addresses used in accounts can be seen with "getaddressesbyaccount", and then the addresses can be evaluated with "listunspent", gripping for the address you need. There is also the command to see the total amount received per address (getreceivedbyaddress).
In summary: you may want to create some coding logic to use the API calls. The API calls list is available in the source code, or in the wiki.

How can list all the address from one privatekey or publickey?

as MeshCollider explained, this needs some manual setup, nothing in bitcoin client that fits the request.

What's more how to process multisig address which generated from not
  the same privatekey of publickey?

When you created the multisig address with bitcoin core client ("addmultisigaddress"), then the client should display the values on this address. When the multisig was created "outsides" of the client, it will not display values for the account, even if you add the address as a "watch only" address (setaccount is now deprecated, and impogrtaddress is obviously the way to go). Anyhow I couldn't make my wallet see a balance on these imported addresses (though I am on regtest, and used txindex=1 in bitcoin.conf).
Even more, if the address is "only" known, and hasn't been used on the blockchain, then the P2SH multisig addresses are covered behind a hash, which is a one-way function. So you never know the details of keys or logic used inside...


text:
How to make transaction without wallet?
I've some utxos with a address. I use CreateRawTransaction to make a transacton. But this method need a txid filed, I've searched a lot to get the txid from the address, but I didn't find any.
So is it possible to make transaction without wallet programmatically？
Note:I use the command line only, non-wallet distribution, I just want to create, sign and send transactions with command-cli or rpc.

You can create raw transaction, sign, ...etc programmatically but if you need to fetch address transactions (inputs) or broadcast the signed transaction to bitcoin network you'll need to connect to Bitcoin network.
Bitcoin-core is amazing for this purpose and if you don't want to download the whole blockchain you can alternatively use Electrum servers.
helpful commands for Bitcoin-core:
listunspent: returns an array of unspent transaction outputs belonging to this wallet.
ListTransactions: returns the most recent transactions that affect the wallet.
Electrum commands:
after connecting to some electrum server you should send JSON-RPC commands
listunspent example:
{ "id": 1, "method":"blockchain.address.listunspent", "params"["1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L"] }

UPDATE
if you are already using Bitcoin-core, so you only need to call listunspentto get your wallet UTXO's or provide an address to get that address UTXO's.
bitcoin-cli listunspent MIN_CONF MAX_CONF "["ADDRESS_NUMBER_ONE","ADDRESS_NUMBER_TWO"]"

If those address doesn't belong to your wallet, you should import them first.

I use a command line only, non-wallet distribution, so I just want to create,  sign and send transactions with command-cli or rpc.

I use a non-wallet distribution.

Sorry I didn't see that part. I'm pretty sure it's hard to do what you're asking with your conditions. The best alternative is electrum, you can do what you looking for through command line.

Do you mind getting those transactions using a third-party? Take a look at blockchain.info API or Blockcypher.


text:
What exactly is a block?
I am trying to understand the Blockchain algorithm used in Bitcoin.
I do not get the part how blocks are created.
Let’s say transactions occur at some time. Then, if some nodes get these transactions, these verify the transactions are valid and then send it to other nodes.
With this verify-send algorithm, almost every node verifies these newly occurred transactions in few seconds.
Now, it is a time for a miner to do his job, which I do not understand.
He needs to find a nonce which makes a lower value than hash values given in transactions.
Question 1 How many transactions should a miner should verify in a single block? For example, if a miner A finds a nonce which gives a lower value than hash values given in 50 transactions, and if a miner B finds a nonce which gives a lower value than hash values given in 70 transacations, would a reward be given only to the miner B? So should a miner appropriately choose how many transacations he will work for?
Question 2
How is a block created? In some webpages, it is written that if a miner finds an appropriate nonce, a block is created and a miner is rewarded. What exactly is a block? Is it correct that a block is exactly a text file of “transaction lists+ appropriate nonce value corresponding to those transactions”?
Question 3
When is a miner rewarded? Is he rewarded at the time he created a block or at the time after his block is chosen to be a part of the greatest cumulative difficulty chain?

Please ask one question at a time. This makes it easier to search for later by other people, and easier to individually answer and/or mark as duplicate with existing questions.

As Pieter said, in future, please limit questions to one at a time :)

which makes a lower value than hash values given in transactions

I think you're a bit confused here. The block hash has to be less than the difficulty target, but that has nothing to do with transaction hashes. The difficulty is just determined by how quickly the previous blocks were being mined.

How many transactions should a miner should verify in a single block?

The miner can choose what transactions to put in the block, usually it is most profitable to fill the block up to its size limit with the highest fee transactions so the miner makes the most profit.

Is it correct that a block is exactly a text file of “transaction lists+ appropriate nonce value corresponding to those transactions”?

It's not a text file, it's just bytes sent around the network. But yes kind of, it's a list of all the transactions in the block plus a block header, which contains a little extra info about the block such as it's timestamp and a nonce.

Is he rewarded at the time he created a block or at the time after his block is chosen to be a part of the greatest cumulative difficulty chain?

The mining reward is just a transaction which pays the miner. So like any other transaction, it is valid as long as it is in the main chain, yes.
See also: What exactly is Mining?

Say A sends B a very small amount of bitcoin. Then this would be not profitable to miners and so miners won’t include this transaction in a block. So actually is very small amount of transaction impossible?

It doesn't matter how much is sent, it only matters how much fee is paid. But actually no there is a limit on how small it can be called dust, you cannot send dust to protect the network from tiny transaction spam (although you will be able to send tiny amounts on lightning)


text:
When the transaction been signed?
I understand that if Bob gets a transaction (BTC) from Alice and want to send it to Charlie he must provide a key which proof that he is the owner of the transaction. But in what stage Bob actually signed the transaction? Can it be that Alice was the one who signed the transaction for Bob without knowing his private key?

Every bitcoin is locked by output script. Only when the result of output script returns true, bitcoin is allowed to spend.
In your case first bitcoins are locked with Alice's private key. Which means output script will return true only if Alice had signed the transaction with her private key. Alice signs the transaction with her private key to Bob's public key, and this will unlock the bitcoin as Alice has provided her private key and new output script will be generated for this bitcoin, which can be unlocked by Bob's private key.
Now, when Bob wants to spend bitcoin which is locked by his private key, he can sign the transaction with his private key to Charlie's public key.

"...and new output script will be generated for this bitcoin, which can be unlocked by Bob's private key." - So basically you don't need a privet key in order to lock (sign) a message?

Yeah. To lock bitcoin you only need public key. To unlock you have to pass your signature which is signed by your private key.


text:
Bitcoin Received But Then Sent
I received Bitcoin to my wallet but it looks like that was the sent out to someone else.  How could that be?
The transaction number for the received coin on explorer shows:
5d4f4ab8b95c7efe6ada33d99fac018727f103a48f0b93dfe7f42a9f6fc08863
Then there is a "Sent" activity with the transaction:
e8cdcacf2f584278e3d1266e4a321241beb4c77372a9901969b12049ffb0c3c6
Did my Bitcoin get automatically sent from my account after receiving it because I never saw where it was in my wallet.  It's only been 30 hours.
Yes I am a total moron, but I was forced into this platform by an enterprise.  Otherwise I would avoid it because I don't understand it.
And my mom just died so I'm dealing with that and losing my job, so if some Samaritan could answer this so I'm less ignorant,I would be most appreciative. The first link is to the transaction on explorer when I received it and the second is for the sent transaction
https://live.blockcypher.com/btc/tx/5d4f4ab8b95c7efe6ada33d99fac018727f103a48f0b93dfe7f42a9f6fc08863/
https://live.blockcypher.com/btc/tx/e8cdcacf2f584278e3d1266e4a321241beb4c77372a9901969b12049ffb0c3c6/

There isn't enough information in your question to be certain but one common reason that money unexpectedly leaves a wallet is theft. It means someone else has the private keys for the receiving address in the first transaction.
This might be because you had an online friend or helper who guided you through the choice of wallet software and the initial process. Perhaps this online friend was not your friend and deliberately deceived you in order to steal money from you.
It might be because you downloaded software that was not the genuine software but a maliciously altered copy. This happened to many Electrum wallet users some years ago. Thieves made malicious use of a feature in the software to trick people into "updating" the software by downloading a malicious version from a website run by the thieves.
It might be because the device you use to hold your wallet software is something you also use for other purposes and you at some time downloaded some compromised software or software that opened a security loophole that has been exploited by thieves.
Some red flags:

I was forced into this platform by an enterprise.

Being forced into some unfamiliar process is a very common thread in incidences of deception and theft.
The word platform suggests something other than a normal non-custodial wallet.
Bitcoin was designed specifically so that one party could pay a second party without ever needing the services of any trusted third party - without any sort of business service acting as a trusted intermediary. When you use a business to hold your money you are giving up one of the main benefits of Bitcoin as intended by its creator.

account

The pattern of transactions suggests a normal non-custodial (aka self-custodial) wallet but the use of the word account suggests some sort of online business service - a custodial arrangement of some sort.
It is common that criminals try to confuse and panic their victims and this often leads to seemingly contradictory and confusing descriptions of the events.

Some other questions here whose answers may be helpful:

How to tell if a cryptocurrency exchange or trading platform is trustworthy?
What kinds of wallets are there?
How do I recover from a cryptocurrency scam?

It won't let me upload the screen caps which are in my coin wallet which I imported the Bitcoin wallet into

Can I send them to you and you decipher them for me? I'm totally lost

Please edit any additional information or images into your question. With this kind of event it is of paramount importance that any help is given in public so that misinformation can be pointed out by other readers. Private messaging is a tool loved by confidence tricksters and especially by those pretending to be recovery agents. Beware.

Well I'm clearly not smart enough to manage that. I can't even imagine how the funds received were instantly sent elsewhere without me entering the information

That's what I get for not using a more established platform's app.
I have switched to another and everything is coming in as it should. I will count the $300 as tuition at the school of hard knocks


text:
Why are Bitcoin signet test coins so difficult to obtain?
Recently there have been a number of tests for the potential staking of Bitcoin.  The test require participants to stake Signet coins which are test coins delivered from faucets.  These faucets never seem to work but in reviewing the mempool.space it is evident someone’s receiving these coins.  Does anyone know why in a very slow demand season or period like now, signet coins remain difficult to acquire? I am not asking how to obtain signet coins! The root of my question is why are those faucets not working for requestors even when the excitement for them is very low. Look at mempool and you’ll see how slow requests are currently. Now try and obtain Signet coins. Share your findings.

This question is similar to: How can I get signet coins?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.

Faucets not working… why?  See changes to question. Thanks for taking the time to review.


text:
Wrong testnet address generation [python]
I'm trying to generate a testnet address without success.Main net address is working fine. Here is my code. The generated testnet address from this code is :CNFNz61dzQ2NQ9RCnjJFrm2de7nLbbT9xSv which is in wrong format.
import os
import ecdsa
import hashlib
import base58

#private_key = os.urandom(32).encode("hex")
private_key =
"7c7cd1c5f24b255ae113459dccdba8df3ff2e76ca0932d02f81be27311c64e32"

print "this is my private key: " + private_key

sk = ecdsa.SigningKey.from_string(private_key.decode("hex"), curve =
ecdsa.SECP256k1)

vk = sk.verifying_key

public_key = ('\04'+ vk.to_string()).encode("hex")

print "this is my public key: " + public_key

ripemd160 = hashlib.new('ripemd160')

ripemd160.update(hashlib.sha256(public_key.decode("hex")).digest())

ripemd160.digest()
#main network id
#middle_man = '\00' + ripemd160.digest()

#testnet id
middle_man = '\6f' + ripemd160.digest()

checksum =
hashlib.sha256(hashlib.sha256(middle_man).digest()).digest()[:4]

binary_addr = middle_man + checksum

addr = base58.b58encode(binary_addr)

# main address = 19kyG9Q5QXMEZSpte6fpTeo1BWKV5Pa6ch
print "testnet address: " + addr

Update:
Finally i found a solution. It seems there was a problem in line
middle_man = '\6f' + ripemd160.digest()

when importing raw bytes into a string
So I import struct and replaced the code above with:
middle_man = struct.pack('=B',111) + ripemd160.digest()

http://gobittest.appspot.com/Address  was really helpfull thanks.

You didn't post the wrong result that you get... As I am not a python specialist, and don't know the library calls, I have an idea: you may want to place your private key here, and add print(s) after every step as debug commands, and compare line by line. I just checked the privkey and the pubkey, the page returns the same result as your main address. If you enter in step 4 the "6f", you get this testnet address: "mpGvZCV4DYnVLZJWMfeCHa1L3VvC1hetT8".
When done, you can edit your question and show how you fixed it, or extend the question with your results.


text:
How to list non-HD addresses in bitcoin core?
Let's say I imported some private keys, how do I distinguish between those and addresses generated from the HD master key?

How is that a duplicate?

Sorry, I misread the question


text:
How to broadcast a non standard transaction?
How can i broadcast a non standard transaction?
I tried using the core client, coinb, blockchain.info, luke-jr's test release as well as pushing it to eligius but it doesn't work.

Possible duplicate of What node implementations and mining pools relay and process 'non-standard' scripts?

The provided information is somehow insufficient, cause we don't see, what happens in your environment or what actions have been taken so far. To raise a good question, which increases the probability for a good answer, see here:
Have a look at https://bitcoin.stackexchange.com/help/how-to-ask.  Questions which come to my mind: What do you mean by non-standard? Could you provide your example? Are you sure it is syntactically correct? Have you checked on testnet ot regtest before?

You generally don't - there are likely to few nodes on the network that will forward it far enough to reach a miner.
What you can do is find a miner yourself, contact them, and see what mechanism they offer to include your transaction (perhaps for a fee). In this case, the transaction will not propagate through the network directly; only as part of the block after mining.

I think F2pool will do it but i need a referral code. Do you have one or know how to get one?

No, I don't. I'm just trying to point out that if you don't use standard transactions, you're generally on your own and will need help from a miner.