19
votes
Accepted
Is it chain of headers rather than a chain of blocks?
Blocks contain a header, and headers are chained, so blocks are chained also. Note the merkle root from your question: this attaches the transactions in the block to the header, making them a logical ...
11
votes
Why don't the timestamps in the block chain always increase?
There is no requirement that blocks have a timestamp after the previous block. The only requirement is that the timestamp is greater than the median timestamp of the last 11 blocks. So this means that ...
11
votes
What is a nonce?
Nonce is a 32 bit arbitrary random number that is typically used once. In Bitcoin's mining process, the goal is to find a hash below a target number which is calculated based on the difficulty.
Proof ...
11
votes
Accepted
Unusual Version Number in Blocks
but I am going to take a slight guess that this has something to do with miner voting to show what the consensus is for a future change?
No. There are currently no active consensus change proposals.
...
11
votes
Accepted
Why are block header bits necessary? (Valid difficulty is already implied by chain history)
They aren't really necessary. The reason that they are included can only be known by Satoshi, and AFAIK, he did not state why he chose to include nBits in the block header (or many other things that ...
9
votes
Accepted
How does the bitcoin network recover in case of a hash collision in the block hash?
It would not break the algorithm.
As the inventory vector of the described new block would be a duplicate of an already known block, no other node would request this block. It would just be ignored, ...
9
votes
Accepted
Why didn't Satoshi make the nonce space larger?
There were many good answers to this question. After reading through them, I'm going to take a stab at the answer as well.
The coinbase field of the coinbase transaction (as it is called) is really ...
9
votes
Accepted
How does Segwit prevent ASICBOOST?
There's 2 versions of ASICBOOST:
Overt where miners use bits in the version number as extra nonce space
Covert where miners "mine" merkle trees with 4 bytes collisions
The overt version is very ...
9
votes
Calculate hash of block header
The version is wrong:
I have 02000000
But the one that appears on the block is
Version 0x20000000
Doing the formatting:
00000020
Calculating the hash of the block:
from hashlib import ...
7
votes
Accepted
How hard is it to alter a block after it was found?
Once a miner has found a block, how easy it is for him to add or remove a tx included in that very block?
It is impossible. The solved block depends on every byte of transaction data, nothing can be ...
7
votes
Bitcoin mining: block structure
As an example of how to build a block header, here's a short Python program that calculates this block header's hash:
#!/usr/bin/env python3
import urllib.request
import json
import binascii
import ...
7
votes
Accepted
Which block header fields are miners able to change in an effort to avoid having to recalculate the Merkle Root?
nBits cannot be changed at all. Its value must equal the (compact encoding of) the target value for that block, which is determined entirely by the predecessors of the block. In other words, if the ...
7
votes
Accepted
How strict are the Unix Epoch time validation rules?
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 ...
7
votes
Accepted
What are the components of the raw block shown in this image?
The diagram is wrong
The data in the gap between the two brackets is the count of transactions and most of the first coinbase transaction.
The brackets are positioned incorrectly.
Various components ...
6
votes
Accepted
How is it that concurrent miners do not subvert each other's work?
The number of hashes a miner has tried in the past does not affect the probability that a miner will get the correct hash in the next immediate calculation. Thus, it does not matter for the miner from ...
6
votes
Why didn't Satoshi make the nonce space larger?
From the protocol rules, there is no such thing as an extra nonce.
There is only a 32-bit nonce in the block header (which can be iterated over very quickly), and up to 100 arbitrary bytes in the ...
6
votes
Accepted
At which point do blocks get validated in the mining process?
A block is checked in two places: First, it's checked before a miner starts working on it, and second, it's checked by every other node before accepting the block as valid.
6
votes
Which block header fields are miners able to change in an effort to avoid having to recalculate the Merkle Root?
nTime: blocks must have a higher timestamp than the median of the 11 previous blocks, and a lower timestamp than two hours in the future of the validating node's own clock. Assuming a regular block ...
6
votes
How strict are the Unix Epoch time validation rules?
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 ...
5
votes
How does "headers first" affect BLKxxxx.dat structure?
To the best of my understanding, it's just that the blocks are stored in a different order. Headers first synchronization makes use of parallel downloads and the blocks are downloaded (and then stored)...
5
votes
Accepted
how to convert blockchain to new version?
The issue here is with:
(block.nVersion < 3 && nHeight >= consensusParams.BIP66Height)
Your block has version 2, but I assume the block you are trying to download is higher than ...
5
votes
Accepted
Mining Block header bit reversing
Let's take a look at this block, because it only has one transaction (the coinbase): 000000000000000000eb2d0ed97a7b2cff7f1408417dca83908004beb6fd9b95
Let's grab the raw hex data:
...
5
votes
Accepted
How is mining difficulty defined (formula)?
The nBits field is basically scientific notation in base-256 (256 is 2^8). As an example, we take the one found on the Bitcoin.org Developer Reference: 0x181bc330 (Big-Endian order). This is split ...
5
votes
Accepted
Are there any blockchain explorers that provide raw Tx data and block headers?
You can get this info from blockchain.info, by simply adding ?format=hexto the end of the relevant URL.
For example, here is a recent block (height 509,244):
https://blockchain.info/block/...
5
votes
Why are block header bits necessary? (Valid difficulty is already implied by chain history)
Directly committing to the nbits allows you to determine how much work was used to produce the header statelessly before looking for (or fetching) information about prior headers.
This can help fend ...
5
votes
Accepted
If a lot of miners start at nonce 0, how are there no ties?
The block templates of two different miners will never overlap.
Miners get paid by assigning the block reward in their mined blocks to themselves. Since each miner is trying to credit a different ...
4
votes
Why don't the timestamps in the block chain always increase?
There is a fair amount of leeway in the block timestamp. The timestamp for block N must be greater than the median network time, which is calculated as the median of the past 11 blocks, and also less ...
4
votes
How hard is it to alter a block after it was found?
From the original Bitcoin paper:
... we implement the proof-of-work by incrementing a nonce in the block until a value is found that gives the block's hash the required zero bits. Once the CPU ...
4
votes
Why didn't Satoshi make the nonce space larger?
My guess: It seems clear that Satoshi didn't expect pooled mining.
In a world without pooled mining, you'd simply have each piece of mining hardware capable of up to 4 gigahashes per second (GH/s) ...
4
votes
How is it that concurrent miners do not subvert each other's work?
An analogy for mining would be the following:
You are at a lottery booth. The lottery booth has 1,000 lottery tickets in a bowl (which are always mixed perfectly). There is only one ticket with a ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
block-header × 122blockchain × 27
mining-theory × 22
block × 19
hash × 17
nonce × 15
difficulty × 13
merkle-tree × 13
mining-pools × 8
mining-technical-details × 8
bitcoin-core × 7
transactions × 7
protocol × 7
python × 6
timestamp × 6
coinbase-transaction × 5
sha256 × 4
raw-data × 4
transaction-selection × 4
bitcoind × 3
proof-of-work × 3
spv × 3
c++ × 3
empty-blocks × 3
block-hash × 3