<blockquote>
<p><strong>if, somehow, there are 2 nodes whose ledgers have conflicting transaction histories, how is it decided on which version all the users must go by?</strong></p>
</blockquote>
<p>Each node decides for itself. Each node makes these sorts of decisions independently. No node trusts any other node to make these decisions for it.</p>
<p>Each node independently examines all the data in all the alternative chains it creates as it receives data, including conflicting data. Each node independently calculates the amount of &quot;work&quot; represented by each chain and selects the chain with the highest amount of work as its active chain. This decision is re-examined every time the node receives data that alters the amount of work represented in any of the chains it knows about.</p>
<p>Because all Bitcoin nodes follow the same rules for this, they all independently select the same chain. They naturally achieve consensus without any explicit collaboration, voting or central direction.</p>
<p>Most chains have a common ancestry and only the last block or so vary. This means that keeping track of multiple chains can be done relatively efficiently without duplicating the common portion.</p>
<p>The measure named &quot;Work&quot; is based on an estimate of the average number of hashing attempts that would be needed to find an arrangement of data that produces a block with a hash less than the target applicable at the relevant block height.</p>
<hr />
<h4>Footnote on terminology</h4>
<p>Although many people describe the Bitcoin blockchain as a ledger, that is misleading. Accounting ledgers have accounts and balances. The Bitcoin blockchain is a simple transaction <em><a href="https://www.investopedia.com/terms/j/journal.asp" rel="nofollow noreferrer">journal</a></em> not a <em><a href="https://www.investopedia.com/terms/g/generalledger.asp" rel="nofollow noreferrer">ledger</a></em>. It contains no accounts and no explicit balances.</p>
<hr />
<h4>Questions with relevant information in answers</h4>
<ul>
<li><a href="https://bitcoin.stackexchange.com/q/115824/13866">Why is number of downloaded block files far fewer than current block height?</a></li>
</ul>

CC BY-SA 4.0
2024-10-30T11:03:09.283Z
2024-10-30T11:40:48.953Z
2024-10-30T11:40:48.953Z
RedGrittyBrick
<p>I'm trying to create a functional replica of the Bitcoin protocol, albeit at a smaller scale, for an academic project. As far as I'm aware, the Bitcoin Public Ledger is a list of all BTC transactions ever made. But how is it stored?</p>
<p><a href="https://bitcoin.stackexchange.com/questions/55178/how-is-the-ledger-stored-on-every-node">How is the ledger stored on every node?</a>
<a href="https://bitcoin.stackexchange.com/questions/101488/is-this-the-ledger">Is this the ledger?</a>
<a href="https://bitcoin.stackexchange.com/questions/85222/where-is-the-data-stored-in-bitcoin">Where is the data stored in Bitcoin?</a></p>
<p>After reading these 3 posts, what I understand is that every node (with a few exceptions) stores the entire transaction history, and the way the protocol works ensures that it is very difficult and impractical to introduce fake transactions into the blockchain.</p>
<p>However, <strong>if</strong>, somehow, there are 2 nodes whose ledgers have conflicting transaction histories, how is it decided on which version all the users must go by? (Because according to <a href="https://bitcoin.stackexchange.com/a/101497">this answer</a>, there is no official/centralised copy of the ledger, and all copies are equally valid.)</p>

<blockchain><block><synchronization><storage><storage-footprint>
How is the Bitcoin Public Ledger stored?
TechPro424
# How is the Bitcoin Public Ledger stored?

(Asked by: username_0 on 2024-10-30)

I'm trying to create a functional replica of the Bitcoin protocol, albeit at a smaller scale, for an academic project. As far as I'm aware, the Bitcoin Public Ledger is a list of all BTC transactions ever made. But how is it stored?

[How is the ledger stored on every node?](https://bitcoin.stackexchange.com/questions/55178/how-is-the-ledger-stored-on-every-node)
[Is this the ledger?](https://bitcoin.stackexchange.com/questions/101488/is-this-the-ledger)
[Where is the data stored in Bitcoin?](https://bitcoin.stackexchange.com/questions/85222/where-is-the-data-stored-in-bitcoin)

After reading these 3 posts, what I understand is that every node (with a few exceptions) stores the entire transaction history, and the way the protocol works ensures that it is very difficult and impractical to introduce fake transactions into the blockchain.

However, **if**, somehow, there are 2 nodes whose ledgers have conflicting transaction histories, how is it decided on which version all the users must go by? (Because according to [this answer](https://bitcoin.stackexchange.com/a/101497), there is no official/centralised copy of the ledger, and all copies are equally valid.)

**Tags:** blockchain, block, synchronization, storage, storage-footprint


---

## 1 answers

### Answer by username_1 on 2024-10-30. Score: 3 | Accepted answer

> **if, somehow, there are 2 nodes whose ledgers have conflicting transaction histories, how is it decided on which version all the users must go by?**

Each node decides for itself. Each node makes these sorts of decisions independently. No node trusts any other node to make these decisions for it.

Each node independently examines all the data in all the alternative chains it creates as it receives data, including conflicting data. Each node independently calculates the amount of "work" represented by each chain and selects the chain with the highest amount of work as its active chain. This decision is re-examined every time the node receives data that alters the amount of work represented in any of the chains it knows about.

Because all Bitcoin nodes follow the same rules for this, they all independently select the same chain. They naturally achieve consensus without any explicit collaboration, voting or central direction.

Most chains have a common ancestry and only the last block or so vary. This means that keeping track of multiple chains can be done relatively efficiently without duplicating the common portion.

The measure named "Work" is based on an estimate of the average number of hashing attempts that would be needed to find an arrangement of data that produces a block with a hash less than the target applicable at the relevant block height.

---

#### Footnote on terminology

Although many people describe the Bitcoin blockchain as a ledger, that is misleading. Accounting ledgers have accounts and balances. The Bitcoin blockchain is a simple transaction *[journal](https://www.investopedia.com/terms/j/journal.asp)* not a *[ledger](https://www.investopedia.com/terms/g/generalledger.asp)*. It contains no accounts and no explicit balances.

---

#### Questions with relevant information in answers

* [Why is number of downloaded block files far fewer than current block height?](https://bitcoin.stackexchange.com/q/115824/13866)


---

