8

How strict are the time validation rules? Very. If the next block is mined more than 2 hours after the current block, would this not stall the blockchain? No. It doesn't break the rule "Full nodes will not accept blocks with headers more than two hours in the future according to their clock." Nor does it break the rule "Must be strictly ...


7

I think you have a misconception about what this clause means: Full nodes will not accept blocks with headers more than two hours in the future according to their clock. You appear to be interpreting this as, if a new block is more than two hours later than the previous block, then do not accept it. That is incorrect. This clause is not about gaps in time ...


4

Once the mining pool has the list of all of the transactions they are including in that block, they calculate the merkle root for this list of transactions, then they distribute the block header, that includes the merkle root, to miners to work on. So, no, it's not constantly being updated, unless for some reason a new transaction was being added or removed ...


3

The getheaders message allows you to list multiple block hashes. So instead of just putting the current chain tip, you can insert multiple block hashes. Responding nodes will see if any of those hashes are in its main chain and start sending headers from there. Since reorgs tend to be small, you could put the most recent 10 block hashes and it should be ...


2

In Mastering Bitcoin there is this diagram which shows the data included: Previous Block Header Hash Timestamp Difficulty Nonce Merkle Root Other sources indicate that the version number from the block header is also included in the data hashed. The difficulty, which is loosely an inverse of the target, is in a compact representation known as "bits&...


2

Concatenation means the joining of the second sequence at the end of the first sequence. For example, with strings, the concatenation of "hello, " and "world" produces the string "hello, world". For TXIDs, they are taken as a 32-byte array. The concatenation of the two TXIDs produces an array of 64 bytes, which then becomes the ...


2

The SHA256 hash algorithm produces what looks exactly like a random number in the range 0 to 2256-1 (1.1579208923731619542357098500869e+77). Each of those values should be equally likely. So if you produce a large number of these by altering the data to be hashed, you cannot steer the results and most of the results will be a large number. Some of the ...


1

Bitcoin difficulty is not determined by the "number of zeros", but none the less the Bitcoin genesis block would satisfy a difficulty target substantially higher than might be expected. This doesn't really mean anything in the scheme of how the system operates, it's just a curiosity.


1

They don't, actually. The protocol for finding the best headers chain is fairly simple: a single peer is asked for the 2000 headers following the last known block header the node knows it and the peer have in common. When these headers arrive, it is asked for more. This process repeats until either a timeout is hit, or a point in time close to the present is ...


1

Firstly, you have a name conflict; hash is both the std::string argument passed to calcHash(), and also the name of your CryptoPP::SHA256 object. This code won't even compile, so are you sure this is the code you're using? The code itself is somewhat difficult to read, too, because you pass around anonymous objects to nested constructors in an attempt to be ...


1

You can take advantage of Blockchain.com's API (formerly Blockchain.info). You can access BTC blocks based on their block height via a URL of the form https://blockchain.info/rawblock/<height+1>. We use <height+1> because 1 is used as the index of the genesis block, which is instead usually referred to as block 0, as it is defined to have a ...


1

Tx: 802dc4c4a08fcf4f50e4320bdb5eb596afc01c95dd0ff6afb83304aeb989be15 Inputs: 38V6gLL6kVCWhfXPo4t5x1gMfg5BKe3Rv H18z1ifzs184pzwTABag5gv47AAxZSi1qg Outputs: H38V6gLL6kVCWhfXPo4t5x1gMfg5BKe3Rv H4UWQS836njW4QJ6WfkGAPjaYtK2twLnZE GnHogGZpDCwmskKFJoVhuvgUg6gKhWQjy6 Tx: 81efc96bea93fcb5992831d8311dec63a0b1d17072ec2e6f1263901b1bd26000 Inputs: ...


1

Update: There is some discussion about timestamps here- https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-October/018251.html When a Bitcoin block is produced there are essentially two times involved: The timestamp in the block header, put there by the miner The actual time the block was produced. Bitcoin has two mechanisms to protect against ...


Only top voted, non community-wiki answers of a minimum length are eligible