<p>Bitcoin clients always accept the longest valid chain. On one hand, clients check the received blocks for validity, on the other hand length is defined by another metric than many assume. The length of the blockchain is the sum of the difficulty of all its blocks, not the number of blocks. So, in order to create a fake chain, the attacker would have to actually create a valid chain at the same difficulty. This is either possible for very short chains (double spend attack) or requires a major share of the network's power (51% attack).</p>

CC BY-SA 3.0
2013-12-03T09:43:03.570Z
2013-12-03T09:43:03.570Z
Murch
<p>Full blockchain nodes actually check not only the block headers, but also every transaction in the block body before accepting that block. If any transaction in the block doesn't "add up" (i.e. its inputs do not match the current accepted balance of those addresses, signatures, etc) then the block will not be accepted as valid.</p>

<p>This is where "light" bitcoin clients (the ones that do not download the full blockchain) have to trust a full-mode node to tell them the "truth" about previous transactions. If the full-mode node is malicious it can certainly trick these light client peers that are connected to it.</p>

CC BY-SA 3.0
2013-12-03T09:19:59.053Z
2013-12-03T09:19:59.053Z
ktorn
<p>What is preventing the bitcoin client from switching to a fake block chain that would be longer that current official chain? The faked chain would contain fictional transactions, but within the faked chain the transaction would be valid (e.g. like no double spends etc.).</p>

CC BY-SA 3.0
2013-12-03T09:44:48.953Z
related: http://bitcoin.stackexchange.com/questions/936/how-does-a-client-decide-which-is-the-longest-block-chain-if-there-is-a-fork
Murch
<blockchain><blockchain-fork><fraud><best-chain>
Longer fake block chain with "valid" transactions
Kozuch
# Longer fake block chain with "valid" transactions

(Asked by: username_0 on 2013-12-03)

What is preventing the bitcoin client from switching to a fake block chain that would be longer that current official chain? The faked chain would contain fictional transactions, but within the faked chain the transaction would be valid (e.g. like no double spends etc.).

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

> **Comments:**
> **username_1**: related: http://bitcoin.stackexchange.com/questions/936/how-does-a-client-decide-which-is-the-longest-block-chain-if-there-is-a-fork  

---

## 2 answers

### Answer by username_1 on 2013-12-03. Score: 5

Bitcoin clients always accept the longest valid chain. On one hand, clients check the received blocks for validity, on the other hand length is defined by another metric than many assume. The length of the blockchain is the sum of the difficulty of all its blocks, not the number of blocks. So, in order to create a fake chain, the attacker would have to actually create a valid chain at the same difficulty. This is either possible for very short chains (double spend attack) or requires a major share of the network's power (51% attack).


---

### Answer by username_2 on 2013-12-03. Score: 2

Full blockchain nodes actually check not only the block headers, but also every transaction in the block body before accepting that block. If any transaction in the block doesn't "add up" (i.e. its inputs do not match the current accepted balance of those addresses, signatures, etc) then the block will not be accepted as valid.

This is where "light" bitcoin clients (the ones that do not download the full blockchain) have to trust a full-mode node to tell them the "truth" about previous transactions. If the full-mode node is malicious it can certainly trick these light client peers that are connected to it.


---

