To understand how blockchain works, let’s use an example of a simple blockchain network that tracks money transfers between users.
Suppose Bungle wants to send Zippy 10 Rainbow Dollars on the network. Here are the steps that would happen:
- Bungle creates a transaction that specifies the amount and the recipient of the money. He signs the transaction with his private key, which proves his identity and ownership of the funds.
- Bungle broadcasts the transaction to the network, where it is validated by other nodes (computers) that run the same blockchain software. The nodes check that Bungle has enough Rainbow Dollars and that the transaction follows the rules of the network.
- The validated transaction is added to a pool of pending transactions, waiting to be included in a block.
- A node that wants to create a new block, called a miner, selects some transactions from the pool and tries to solve a mathematical puzzle that involves hashing (a process of generating a unique code from some input). The puzzle is difficult to solve but easy to verify, and it ensures that only one block can be added at a time.
- The miner who solves the puzzle first, broadcasts the new block to the network, which contains the selected transactions and a hash (a unique fingerprint) linking to the previous block. The other nodes verify that the block is valid and append it to their copy of the chain and it becomes part of the shared ledger.
- The block is now part of the blockchain, and Bungle’s transaction is confirmed. Zippy receives the money and can use it for his own transactions.
- The more blocks that are added after the transaction’s block, the more secure and irreversible the transaction becomes.