<h2>For <a href="https://bitcoin.stackexchange.com/questions/12427/can-someone-explain-how-the-bitcoin-blockchain-works/13347?noredirect=1#comment48998_13347">user32260</a>: Bill sells Sally some apples for £2.50</h2>
<p>Bill is a fruit vendor. Sally wants to buy some apples for £2.50. Sally wishes to use Bitcoin to pay Bill for the apples. Bill presents Sally his payment address, for example as a quickresponse code:</p>
<p><a href="https://i.sstatic.net/5HH5D.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/5HH5D.png" alt="Bill's address" /></a></p>
<p>Sally uses a Bitcoin wallet on her smartphone to scan the code. She is presented a screen where she can enter an amount to send to Bill's address. She types '£2.50' and presses send. A moment later Bill's tablet notifies him that there is an incoming payment pending, which is not confirmed yet. About <a href="https://bitcoin.stackexchange.com/q/855/5406">ten minutes</a> later, the payment is <a href="https://bitcoin.stackexchange.com/q/1170/5406">finalized</a> when it gets <a href="https://bitcoin.stackexchange.com/q/146/5406">confirmed</a>.</p>
<h2>Under the hood</h2>
<p><strong>1) The payment order (Transaction)</strong>:<br />
The software on Sally's smartphone checks whether Sally has a sufficient balance and then creates a payment order, which we'll call a <em>transaction</em>. This transaction is composed of three pieces of information: which &quot;<a href="https://bitcoin.stackexchange.com/q/4301/5406">coins</a>&quot; get spend, the payment to the recipient, and a signature.<br />
Sally's wallet is connected to other participants in the network. The wallet passes the transaction to all of them, who in turn forward it to all of their connections. Within a few seconds, every participant in the network has received notification of Sally's payment order. Each and every participant checks whether the referenced &quot;coins&quot; exist, and whether the signature matches the owner's.</p>
<p><strong>2) Confirmation</strong>:<br />
So far, Sally's payment is only a promise, because the transaction is still <em>unconfirmed</em>.<br />
To change that, some network participants, which we'll call <em>miners</em>, work on confirming these transactions. The miners grab all the unconfirmed transactions and try to pack them into a set. When this set doesn't fulfill the difficulty requirement, they reshuffle it and try again. Miners all over the planet are performing this work until at some point, somebody finds a set with the right properties: a <strong>valid block</strong>. Because finding a valid block is such an unlikely event, the announcement of the new block proves that the network has expended work to find it.<br />
Just as with the transactions before, the miner sends the block to all their connections, who in turn forward it. Every participant checks the work (to confirm that the block follows the rules) and when satisfied, applies the included transactions to their own ledger: the transactions get executed and the &quot;coins&quot; that were used by the senders get marked as spent, whereas the recipients gain new &quot;coins&quot; as instructed by the transactions. Sally's transaction (and all the others) is now confirmed. Bill can now spend the &quot;coins&quot; he received from Sally.</p>
<p><strong>3) The Blockchain</strong><br />
Let's take a step back. Before Sally paid Bill, Sally got her bitcoins from Alice. The order of transactions is crucial as transactions can only spend &quot;coins&quot; that have already been created. Sally can't pay Bill if she didn't get the money from Alice first. The transactions have an explicit position in the block that confirms them and each block has a fixed position in the block chain by referencing its direct predecessor. E.g. <code>Block 90</code> links to <code>Block 89</code> as its predecessor, in turn <code>Block 89</code> builds on <code>Block 88</code>, and so forth, until <code>Block 1</code> points at the 0th block, the <code>Genesis Block</code>.</p>
<pre><code>Genesis Block ← 1 ← … ← 88 ← 89 ← 90
</code></pre>
<p>The eponymous <strong>blockchain</strong> has useful properties:</p>
<ul>
<li><strong>Deterministic results</strong>: Everyone can start from the <code>Genesis Block</code> and apply each block consecutively to arrive at the same result.</li>
<li><strong>Synchronization &amp; Consensus</strong>: When you have applied the latest block, the balances in your ledger have the exact same state as in all the other participants' ledgers.</li>
<li><strong>Unchangeable History</strong>: As each block builds upon its predecessor, each new block buries the history under more work (see graphic below):</li>
</ul>
<p><a href="https://i.sstatic.net/bYbZs.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bYbZs.png" alt="enter image description here" /></a>
<a href="http://spectrum.ieee.org/computing/networks/the-future-of-the-web-looks-a-lot-like-bitcoin" rel="nofollow noreferrer">Illustration: Mark Montgomery/IEEE Spectrum</a></p>

CC BY-SA 4.0
2016-01-22T18:35:25.127Z
2023-10-25T19:43:07.360Z
2023-10-25T19:43:07.360Z
Murch
<p><em>If you are completely new to Bitcoin, you may find my <a href="https://bitcoin.stackexchange.com/a/42515/5406">second answer</a> more accessible, which is a <strong>less technical description</em></strong>.</p>

<hr>

<p>As you said, <strong>the blockchain is a log of all transactions that were ever verified on the Bitcoin network.</strong></p>

<p>The transactions are collected in <strong><em>blocks</em></strong>, which are found approximately every ten minutes in a random process called mining. As transactions transfer ownership of Bitcoin balances, each of these blocks represents an update of the user's balances on the network.<br>
By following the blockchain from the Genesis Block and applying all transactions that were validated in each block in the correct order, you arrive at the current status quo.</p>

<h2>Each block header contains:</h2>

<p><a href="https://i.sstatic.net/HrKX0.png" rel="noreferrer"><img src="https://i.sstatic.net/HrKX0.png" alt="Bitcoin Block Data"></a> <a href="https://i.sstatic.net/HrKX0.png" rel="noreferrer">[Illustration by Matthäus Wander (Wikimedia)]</a></p>

<ul>
<li><strong>Timestamp:</strong><br>
<em>The time when the block was found.</em></li>
<li><strong>Reference to Parent (<code>Prev_Hash</code>):</strong><br>
<em>This is a hash of the previous block header which ties each block to its parent, and therefore by induction to all previous blocks. This chain of references is the eponymic concept for the blockchain.</em></li>
<li><strong>Merkle Root (<code>Tx_Root</code>):</strong><br>
<em>The Merkle Root is a <a href="https://bitcoin.stackexchange.com/a/37225/5406">reduced representation</a> of the set of transactions that is confirmed with this block. The transactions themselves are provided independently forming the <strong>body of the block</strong>. There must be at least one transaction: The <a href="https://bitcoin.stackexchange.com/a/4572/5406">Coinbase</a>. The Coinbase is a special transaction that may create new bitcoins and collects the transactions fees. Other transactions are optional.</em></li>
<li><strong>Target:</strong><br>
<em>The target corresponds to the difficulty of finding a new block. It is updated every 2016 blocks when the <a href="https://bitcoin.stackexchange.com/q/5838/5406">difficulty reset</a> occurs.</em></li>
<li><strong>Nonce:</strong><br>
<em>An arbitrarily picked number to conveniently add entropy to a block header without rebuilding the Merkle tree.</em></li>
<li><strong>The block's own hash:</strong><br>
<em>All of the above header items (i.e. all except the transaction data) get hashed into the block hash, which for one is proof that the other parts of the header have not been changed, and then is used as a reference by the succeeding block.</em></li>
</ul>

<p>As many miners compete to find the next block, often there will be more than one valid next block discovered. This is resolved as soon as one of the two forks progresses to a greater length, at which any client that receives the newest block knows to discard the shorter fork. These discarded blocks are referred to as <em><a href="https://bitcoin.stackexchange.com/q/5859/5406">extinct blocks</a></em> (sometimes also referred to as <em>orphaned blocks</em>, although their complete ancestry is known).</p>

<p>When a transaction is submitted to the network, it is passed on peer to peer by all clients. Upon discovery miners will put it on their list of transactions that they want to verify and update the Merkle Root.</p>

<p>On Blockchain.info you can track a transaction either by requesting the page directly with the transaction hash</p>

<pre><code>http://blockchain.info/tx/&lt;transaction-hash&gt;
e.g. http://blockchain.info/tx/37df28642f97db7003a7bc6663467eb1e9cb4493b6c94bf089ee77f87acdae3d
</code></pre>

<p>or by calling one of the involved addresses through</p>

<pre><code>http://blockchain.info/address/&lt;address&gt;
e.g. http://blockchain.info/address/1DrZtRNsSu9BqGcY4D9etFno4H95DqNmKb
</code></pre>

<p>Either way for each transaction you will see a line with a big arrow that shows you which addresses' were used to fund the transaction and what addresses received which portions of the transaction.</p>

CC BY-SA 3.0
2013-09-16T22:17:37.267Z
2017-10-31T09:33:53.353Z
2017-10-31T09:33:53.353Z
Murch
<p>I'm trying to figure out how the blockchain works and how to read it via blockchain.info website. Is there a laymen way of explaining how the block chain works and how to read the blockchain to trace transactions?</p>

<p>What I know so far is:
the blockchain is just a public ledger of transactions on the bitcoin network.</p>

CC BY-SA 3.0
2014-02-23T02:36:18.833Z
related [What is the Blockchain?](http://bitcoin.stackexchange.com/q/168/5406)
Murch
<blockchain>
Can someone explain how the Bitcoin Blockchain works?
Patoshi パトシ
# Can someone explain how the Bitcoin Blockchain works?

(Asked by: username_0 on 2013-07-31)

I'm trying to figure out how the blockchain works and how to read it via blockchain.info website. Is there a laymen way of explaining how the block chain works and how to read the blockchain to trace transactions?

What I know so far is:
the blockchain is just a public ledger of transactions on the bitcoin network.

**Tags:** blockchain

> **Comments:**
> **username_1**: related [What is the Blockchain?](http://bitcoin.stackexchange.com/q/168/5406)  

---

## 2 answers

### Answer by username_1 on 2013-09-16. Score: 71 | Accepted answer

*If you are completely new to Bitcoin, you may find my [second answer](https://bitcoin.stackexchange.com/a/42515/5406) more accessible, which is a **less technical description***.

---

As you said, **the blockchain is a log of all transactions that were ever verified on the Bitcoin network.**

The transactions are collected in ***blocks***, which are found approximately every ten minutes in a random process called mining. As transactions transfer ownership of Bitcoin balances, each of these blocks represents an update of the user's balances on the network.  
By following the blockchain from the Genesis Block and applying all transactions that were validated in each block in the correct order, you arrive at the current status quo.

## Each block header contains:

[![Bitcoin Block Data](https://i.sstatic.net/HrKX0.png)](https://i.sstatic.net/HrKX0.png) [[Illustration by Matthäus Wander (Wikimedia)]](https://i.sstatic.net/HrKX0.png)

* **Timestamp:**  
  *The time when the block was found.*
* **Reference to Parent (`Prev_Hash`):**  
  *This is a hash of the previous block header which ties each block to its parent, and therefore by induction to all previous blocks. This chain of references is the eponymic concept for the blockchain.*
* **Merkle Root (`Tx_Root`):**  
  *The Merkle Root is a [reduced representation](https://bitcoin.stackexchange.com/a/37225/5406) of the set of transactions that is confirmed with this block. The transactions themselves are provided independently forming the **body of the block**. There must be at least one transaction: The [Coinbase](https://bitcoin.stackexchange.com/a/4572/5406). The Coinbase is a special transaction that may create new bitcoins and collects the transactions fees. Other transactions are optional.*
* **Target:**  
  *The target corresponds to the difficulty of finding a new block. It is updated every 2016 blocks when the [difficulty reset](https://bitcoin.stackexchange.com/q/5838/5406) occurs.*
* **Nonce:**  
  *An arbitrarily picked number to conveniently add entropy to a block header without rebuilding the Merkle tree.*
* **The block's own hash:**  
  *All of the above header items (i.e. all except the transaction data) get hashed into the block hash, which for one is proof that the other parts of the header have not been changed, and then is used as a reference by the succeeding block.*

As many miners compete to find the next block, often there will be more than one valid next block discovered. This is resolved as soon as one of the two forks progresses to a greater length, at which any client that receives the newest block knows to discard the shorter fork. These discarded blocks are referred to as *[extinct blocks](https://bitcoin.stackexchange.com/q/5859/5406)* (sometimes also referred to as *orphaned blocks*, although their complete ancestry is known).

When a transaction is submitted to the network, it is passed on peer to peer by all clients. Upon discovery miners will put it on their list of transactions that they want to verify and update the Merkle Root.

On Blockchain.info you can track a transaction either by requesting the page directly with the transaction hash

```
http://blockchain.info/tx/<transaction-hash>
e.g. http://blockchain.info/tx/37df28642f97db7003a7bc6663467eb1e9cb4493b6c94bf089ee77f87acdae3d

```

or by calling one of the involved addresses through

```
http://blockchain.info/address/<address>
e.g. http://blockchain.info/address/1DrZtRNsSu9BqGcY4D9etFno4H95DqNmKb

```

Either way for each transaction you will see a line with a big arrow that shows you which addresses' were used to fund the transaction and what addresses received which portions of the transaction.


---

### Answer by username_1 on 2016-01-22. Score: 61

## For [user32260](https://bitcoin.stackexchange.com/questions/12427/can-someone-explain-how-the-bitcoin-blockchain-works/13347?noredirect=1#comment48998_13347): Bill sells Sally some apples for £2.50

Bill is a fruit vendor. Sally wants to buy some apples for £2.50. Sally wishes to use Bitcoin to pay Bill for the apples. Bill presents Sally his payment address, for example as a quickresponse code:

[![Bill's address](https://i.sstatic.net/5HH5D.png)](https://i.sstatic.net/5HH5D.png)

Sally uses a Bitcoin wallet on her smartphone to scan the code. She is presented a screen where she can enter an amount to send to Bill's address. She types '£2.50' and presses send. A moment later Bill's tablet notifies him that there is an incoming payment pending, which is not confirmed yet. About [ten minutes](https://bitcoin.stackexchange.com/q/855/5406) later, the payment is [finalized](https://bitcoin.stackexchange.com/q/1170/5406) when it gets [confirmed](https://bitcoin.stackexchange.com/q/146/5406).

## Under the hood

**1) The payment order (Transaction)**:  
The software on Sally's smartphone checks whether Sally has a sufficient balance and then creates a payment order, which we'll call a *transaction*. This transaction is composed of three pieces of information: which "[coins](https://bitcoin.stackexchange.com/q/4301/5406)" get spend, the payment to the recipient, and a signature.  
Sally's wallet is connected to other participants in the network. The wallet passes the transaction to all of them, who in turn forward it to all of their connections. Within a few seconds, every participant in the network has received notification of Sally's payment order. Each and every participant checks whether the referenced "coins" exist, and whether the signature matches the owner's.

**2) Confirmation**:  
So far, Sally's payment is only a promise, because the transaction is still *unconfirmed*.  
To change that, some network participants, which we'll call *miners*, work on confirming these transactions. The miners grab all the unconfirmed transactions and try to pack them into a set. When this set doesn't fulfill the difficulty requirement, they reshuffle it and try again. Miners all over the planet are performing this work until at some point, somebody finds a set with the right properties: a **valid block**. Because finding a valid block is such an unlikely event, the announcement of the new block proves that the network has expended work to find it.  
Just as with the transactions before, the miner sends the block to all their connections, who in turn forward it. Every participant checks the work (to confirm that the block follows the rules) and when satisfied, applies the included transactions to their own ledger: the transactions get executed and the "coins" that were used by the senders get marked as spent, whereas the recipients gain new "coins" as instructed by the transactions. Sally's transaction (and all the others) is now confirmed. Bill can now spend the "coins" he received from Sally.

**3) The Blockchain**  
Let's take a step back. Before Sally paid Bill, Sally got her bitcoins from Alice. The order of transactions is crucial as transactions can only spend "coins" that have already been created. Sally can't pay Bill if she didn't get the money from Alice first. The transactions have an explicit position in the block that confirms them and each block has a fixed position in the block chain by referencing its direct predecessor. E.g. `Block 90` links to `Block 89` as its predecessor, in turn `Block 89` builds on `Block 88`, and so forth, until `Block 1` points at the 0th block, the `Genesis Block`.

```
Genesis Block ← 1 ← … ← 88 ← 89 ← 90

```

The eponymous **blockchain** has useful properties:

* **Deterministic results**: Everyone can start from the `Genesis Block` and apply each block consecutively to arrive at the same result.
* **Synchronization & Consensus**: When you have applied the latest block, the balances in your ledger have the exact same state as in all the other participants' ledgers.
* **Unchangeable History**: As each block builds upon its predecessor, each new block buries the history under more work (see graphic below):

[![enter image description here](https://i.sstatic.net/bYbZs.png)](https://i.sstatic.net/bYbZs.png)
[Illustration: Mark Montgomery/IEEE Spectrum](http://spectrum.ieee.org/computing/networks/the-future-of-the-web-looks-a-lot-like-bitcoin)


---

