<blockquote>
  <p>I hope that "longestt chain" actually means "most proof of work" rather than "most blocks"!</p>
</blockquote>

<p>It is exactly that: the "longest chain" is the one with the most work, not the largest block height. </p>

<p>If it wasn't like that, then an attack like the one you described could work. </p>

CC BY-SA 3.0
2018-01-25T12:01:19.930Z
Can you link to an authoritative source?
Gregory Magarshak
CC BY-SA 3.0
2018-01-25T21:30:55.313Z
@GregoryMagarshak I believe [this is the code](https://github.com/bitcoin/bitcoin/blob/1d9d314573ee48f6f51107265f1cf1fa9e36c998/src/main.cpp#L91) you're looking for, notice that it uses 'nchainwork', rather than 'blockheight' to decide what the longest valid chain is.
chytrik
CC BY-SA 3.0
2018-01-25T07:05:14.737Z
2018-01-25T07:05:14.737Z
chytrik
<p>According to this question's answers, the difficulty is entirely a result of previous info on a blockchain:</p>

<p><a href="https://bitcoin.stackexchange.com/questions/5838/how-is-difficulty-calculated">How is difficulty calculated?</a></p>

<p>So why can't someone simply fork an earlier state of Bitcoin's blockhain, back when the difficulty was far less, and simply pretend it always took a long time to solve an easy (by now) hash problem, ie simulate a bitcoin world where no ASIC were released etc.</p>

<p>According to that chain, the hash rate would be low and thus a perfectly valid chain could be made with fake transactions, mined in secret many years into the future.</p>

<p>If Bitcoin modes really simply consider the longest chain the valid one, wouldn't this totally bork the whole Bitcoin ecosystem? I hope that "longestt chain" actually means "most proof of work" rather than "most blocks"!</p>

<blockchain-fork><difficulty><best-chain>
Why can't a Bitcoin fork take over?
Gregory Magarshak
# Why can't a Bitcoin fork take over?

(Asked by: username_0 on 2018-01-25)

According to this question's answers, the difficulty is entirely a result of previous info on a blockchain:

[How is difficulty calculated?](https://bitcoin.stackexchange.com/questions/5838/how-is-difficulty-calculated)

So why can't someone simply fork an earlier state of Bitcoin's blockhain, back when the difficulty was far less, and simply pretend it always took a long time to solve an easy (by now) hash problem, ie simulate a bitcoin world where no ASIC were released etc.

According to that chain, the hash rate would be low and thus a perfectly valid chain could be made with fake transactions, mined in secret many years into the future.

If Bitcoin modes really simply consider the longest chain the valid one, wouldn't this totally bork the whole Bitcoin ecosystem? I hope that "longestt chain" actually means "most proof of work" rather than "most blocks"!

**Tags:** blockchain-fork, difficulty, best-chain


---

## 1 answers

### Answer by username_1 on 2018-01-25. Score: 2 | Accepted answer

> I hope that "longestt chain" actually means "most proof of work" rather than "most blocks"!

It is exactly that: the "longest chain" is the one with the most work, not the largest block height.

If it wasn't like that, then an attack like the one you described could work.

> **Comments:**
> **username_0**: Can you link to an authoritative source?  
> **username_1**: @username_0 I believe [this is the code](https://github.com/bitcoin/bitcoin/blob/1d9d314573ee48f6f51107265f1cf1fa9e36c998/src/main.cpp#L91) you're looking for, notice that it uses 'nchainwork', rather than 'blockheight' to decide what the longest valid chain is.  

---

