6

There have been only two large re-orgs in Bitcoin's history. The first is the value overflow incident in August 2010 that caused a re-org of 53 blocks and the March 12, 2013 fork that caused a re-org of 24 blocks. Value Overflow Bug On August 15 2010, it was discovered that block 74,638 contained a transaction that created 184.4 billion bitcoins for three ...


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 ...


3

Blockchain forks occur when two blocks are found at the same height. Only one of the two chaintips can become part of the best chain. Each full node will consider the first block it saw to be the best block for that height, until proven otherwise by another chaintip accumulating a greater total difficulty (i.e. adding another block). When another chaintip ...


2

valid-fork means that the blocks were fully downloaded and validated. It is likely that they were part of the active chain but were reorganized after a better chain was received. valid-headers means that the blocks were fully downloaded but not fully validated. Only the headers were validated to have a valid Proof of Work before the block was written to ...


2

NOTES: Heigh and Version fields Fields height and version are needed to identify Outputs if they are last spent in the Transaction outputs. In older revxx.dat files, only if Output was last unspent in a Transaction it's height will be there together with it’s Transaction’s Version. If it's a regular Output then the height field will be 0 (00 HEX in Varint ...


1

An attack that attempts to outpace the mining power of the whole network by itself is called a majority-attack or "51%-attack". Concretely, your example is a doublespend attack by means of a majority attack. When the attacker publishes their chain-tip, each node performs a chain-reorganization to switch to the best chain. Concretely, the blocks B4 ...


1

There's no need to consider the timestamps in order to know the difficulty. The difficulty is stored in the blocks. This is a bit speculative but in the past such threats have been discussed, more along the lines of the hash function being hacked, and I think in such cases there will be a large consensus to hard fork. If the hypothetical threat you're ...


1

Is this expected behaviour? During a chain-reorganization, can I only expect ZMQ to publish the tip of the new chain Yes, a ZMQ notification is emitted any time the active tip of the chain changes. If you have a chain B1-B2-B3, and there is a 1-deep reorg that rewrites B3, you end up with B1-B2-B3'-B4. The tip changes here from B3 to B4; it does not go ...


1

Block tree is stored on-disk. During startup, is read into memory. When read, BlockManager::m_block_index field is filled with data - CBlockIndexes. Every CBlockIndex contains memory-only field arith_uint256 nChainWork, which is a total amount of work in the chain up to (and including) current block. Best chain is selected as maximum among all nChainWork of ...


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