Blockchain: How it works
Blockchain allows for the secure management of a shared ledger, where transactions are veriﬁed and stored on a network without a governing central authority. Blockchains can come in diﬀerent conﬁgurations, ranging from public, open-source networks to private blockchains that require explicit permissions to read or write.
Two parties exchange data; this could r epresent money, contracts, deeds, medical records, customer details, or any other asset that can be described in digital form.
Depending on the network’s parameters, the transaction is either veriﬁed instantly or transcribed into a secured record and placed in a queue of pending transactions. In this case, nodes—the computers or servers in the network—determine if the transactions are valid based on a set of rules the network has agreed to.
Each block is identiﬁed by a hash, a 256-bit number, created using an algorithm agreed upon by the network. A block contains a header, a reference to the previous block’s hash, and a group of transactions. The sequence of linked hashes creates a secure, interdependent chain.
Blocks must ﬁrst be validated to be added to the blockchain. The most accepted form of validation for open-source blockchains is proof of work—the solution to a mathematical puzzle derived from the block’s header.
5. Blockchain mining
Miners try to “solve” the block by making incremental changes to one variable until the solution satisﬁes a network-wide target. This is called “proof of work” because correct answers cannot be falsiﬁed; potential solutions must prove the appropriate level of computing power was drained in solving.
6. Built-in defense
If a malicious miner tries to submit an altered block to the chain, the hash function of that block, and all following blocks, would change. The other nodes would detect these changes and reject the block from the majority chain, preventing corruption.
7. The chain
When a block is validated, the miners that solved the puzzle are rewarded and the block is distributed through the network. Each node adds the block to the majority chain, the network’s immutable and auditable blockchain.