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.

  • 1
    The methods of accessing data will differ between using Blockchain.info (web-based API) and Bitcoin-Qt/bitcoind (local API). If you are looking to pull all the blockchain data, you'll exceed access threasholds with Blockchain.info. – Stephen Gornick Jul 31 '13 at 23:56
  • 3
    There are dozens of writeups about how Bitcoin works and the role of the blockchain. It would be much better if you would read one or two of them, and then ask specific questions about anything you don't understand. – Nate Eldredge Sep 16 '13 at 20:30
  • related What is the Blockchain? – Murch Feb 23 '14 at 2:36
up vote 57 down vote accepted

If you are completely new to Bitcoin, you may find my second answer 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 [Illustration by Matthäus Wander (Wikimedia)]

  • 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 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. 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 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 (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

e.g. http://blockchain.info/tx/37df28642f97db7003a7bc6663467eb1e9cb4493b6c94bf089ee77f87acdae3d

or by calling one of the involved addresses through

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.

  • 1
    As a member of the general public, this answer is next to useless. I do not understand IT but this answer is written as though I already knew this stuff - you need to start from a very simple example: Bill sells Sally some apples for £2.50 .... – user32260 Jan 22 '16 at 16:24
  • 2
    @user32260: I hope that you find my second answer more accessible. – Murch Jan 22 '16 at 18:41
  • The picture you've used also contains something called the "nonce", but your description leaves this out. Is it worth adding this, or is it of little concern to the overall explanation? – Richard Horrocks Apr 20 '16 at 20:57
  • @RichardHorrocks: the nonce is just a random number that adds entropy for finding a valid block. Miners go through millions of them to find a block. – Murch Apr 20 '16 at 23:32
  • @Murch: So anyone will know your Bitcoin balance, right? – anhldbk Dec 28 '16 at 1:30

For user32260: 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

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 later, the payment is finalized** when it gets confirmed***.

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 Transaction. This transaction is composed of three pieces of information: Which "coins" to spend, 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 pass it on 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 listed "coins" exist, and whether the signatory is the owner.

2) Confirmation:
So far, Sally's payment is only a promise, because it 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. At some point, somebody finds a set with the right properties: A valid block.
Just as with the transactions before, they send this block to all their connections, who in turn forward it to theirs. Everyone 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 invalidated, whereas the recipients gain new "coins" as ordered 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 the bitcoins from Alice. Obviously, the order here is crucial. She can't pay Bill if she didn't get the money from Alice first.
Generally, transactions can only spend "coins" that have already been created. This is why each block has a fixed position: Each block references his direct predecessor. E.g. Block 90 says that Block 89 preceded him, in turn Block 89 names Block 88 as his predecessor, and so forth, until Block 2 points at the first block, the Genesis Block.

Genesis Block ← 2 ← … ← 88 ← 89 ← 90

The eponymic 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 Illustration: Mark Montgomery/IEEE Spectrum

*What keeps the average block time at 10 minutes?

**Why is 6 the number of confirms that is considered secure?

***What are bitcoin "confirmations"?

"Coins" is a simplification for Unspent transaction Outputs

  • 1
    What do you mean by requirements in the phrase "When their set doesn't fit the requirements, they reshuffle it and try again. " ? – anhldbk Dec 28 '16 at 1:34
  • 1
    I especially like how you summarized step 2. Very concise hashing-out of the process. – Darren Jul 14 '17 at 15:25
  • 1
    @anhldbk: I've updated my answer to explicitly state the requirement.— Thanks Darren. :) – Murch Jul 14 '17 at 17:55
  • 2
    @tomak: Everyone knows about all coins that exist, but other users don't know whom they belong to. When you spend, you prove that you have the right to spend, but still don't reveal your identity. You also do not reveal control of any "coins" that were not involved in this particular transaction (unless you're reusing addresses, or someone was able to identify a connection with the help of chain analysis). – Murch Oct 23 '17 at 23:45
  • 1
    @RaviKumar: 1. If the checks fails, either the money didn't exist or the sender didn't authenticate themselves properly as the owner. The transaction is invalid. Nodes don't forward invalid transactions to their peers, and miners don't include invalid transactions in blocks. 2. If a miner hasn't verified the last block yet, they would run the risk of including a transaction that was already confirmed or is no longer valid if they found a new block right away, that's why miners may mine "empty blocks" very briefly after a block was discovered. Otherwise they earn more fees by including more tx. – Murch Nov 27 '17 at 16:34

protected by Community May 31 '16 at 14:12

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.