<p>Block headers include a field called bits, which can be used to calculate the difficulty and hence the amount of proof-of-work in the chain. There's probably a shortcut to being able to eliminate a 100,000 longer chain, but all core does is calculate the proof-of-work present in both chains and take the one with more.</p>

<p>Note that block headers are only 80 bytes each, so the 500k blocks would only be about 40 MB, not an unreasonable amount of data to calculate how much proof-of-work a chain has.</p>

CC BY-SA 3.0
2016-05-29T14:54:19.867Z
Also note, that since recently, Bitcoin Core performs header first synchronization, so it actually will only download the headers until it realizes that it needs the block bodies.
Murch
CC BY-SA 3.0
2016-05-29T13:42:57.153Z
2016-05-29T13:42:57.153Z
Jimmy Song
<p>Let's say an attacker connects to the Bitcoin network. Let's say this attacker possesses an old ASIC HW and she used it to generate a blockchain of half a million blocks, with faked timestamps and really low difficulty, but otherwise valid. So, this chain is longer than the Bitcoin blockchain, but is shorter difficulty-wise.</p>

<p>How does the attacker presents this version of blockchain to the network and how much work will the network nodes spend on finding out that that blockchain is difficulty-wise shorter. Do they need to (and will they) download the whole chain from the attacker? Or is there any information on the top of the blockchain that can be used as hint on how much total work was spent in the entire chain?</p>

<blockchain><attack>
How does a node compare two blockchains?
Wapac
# How does a node compare two blockchains?

(Asked by: username_0 on 2016-05-29)

Let's say an attacker connects to the Bitcoin network. Let's say this attacker possesses an old ASIC HW and she used it to generate a blockchain of half a million blocks, with faked timestamps and really low difficulty, but otherwise valid. So, this chain is longer than the Bitcoin blockchain, but is shorter difficulty-wise.

How does the attacker presents this version of blockchain to the network and how much work will the network nodes spend on finding out that that blockchain is difficulty-wise shorter. Do they need to (and will they) download the whole chain from the attacker? Or is there any information on the top of the blockchain that can be used as hint on how much total work was spent in the entire chain?

**Tags:** blockchain, attack


---

## 1 answers

### Answer by username_1 on 2016-05-29. Score: 6 | Accepted answer

Block headers include a field called bits, which can be used to calculate the difficulty and hence the amount of proof-of-work in the chain. There's probably a shortcut to being able to eliminate a 100,000 longer chain, but all core does is calculate the proof-of-work present in both chains and take the one with more.

Note that block headers are only 80 bytes each, so the 500k blocks would only be about 40 MB, not an unreasonable amount of data to calculate how much proof-of-work a chain has.

> **Comments:**
> **username_2**: Also note, that since recently, Bitcoin Core performs header first synchronization, so it actually will only download the headers until it realizes that it needs the block bodies.  

---

