What Is Blockchain Consensus?
Understand the mathematical and game-theoretic protocols that enable thousands of untrusted computers to agree on a single global state.
Explore the core data structures that power blockchains: how cryptographic hash functions, Merkle trees, and block headers keep digital ledgers secure.
Behind every blockchain is a set of elegant mathematical and data structure primitives. While blockchain is often discussed at a high level, its actual reliability depends on three fundamental concepts working in harmony:
In this technical primer, we explore each of these components in depth.
A hash function is a mathematical algorithm that takes an arbitrary amount of data as input (whether a single letter, an entire book, or a gigabyte file) and outputs a unique fixed-length alphanumeric string known as a hash or digest.
In blockchain systems such as Bitcoin, the standard algorithm is SHA-256 (Secure Hash Algorithm 256-bit).
Input: "BlockchainCeylon"
Output: 0e86b24578a1bc40c03426e2e5ec466dc7e366ffef55b25215c0e7b8c735d49e
To be suitable for blockchain use, a hash function must satisfy five critical properties:
A block is not just an arbitrary list of transactions; it is a strictly formatted data structure composed of two primary sections: the Block Header and the Block Body.
The header contains metadata that identifies the block and connects it to the rest of the chain. A standard block header typically includes:
The body contains the complete list of all verified transactions included in this block. In Bitcoin, a block typically holds between 1,500 and 3,000 transactions; in Ethereum, the count depends on the gas limits consumed by the smart contracts executed within that block.
How can a lightweight node or mobile wallet quickly verify that a specific transaction was included in a block without downloading megabytes of data? The answer is the Merkle Tree (or binary hash tree).
In a Merkle tree:
[ Merkle Root (H_ABCD) ]
/ \
[ H_AB ] [ H_CD ]
/ \ / \
[ H_A ] [ H_B ] [ H_C ] [ H_D ]
│ │ │ │
[ Tx A ] [ Tx B ] [ Tx C ] [ Tx D ]
Thanks to the Merkle tree, verifying whether Tx A exists in a block requires only a logarithmic number of hashes (the Merkle Proof), enabling efficient light-client verification on low-power devices.
A blockchain transaction is a cryptographically authenticated state transition. In account-based models like Ethereum, a transaction looks similar to a bank transfer debiting an account balance. In UTXO-based models like Bitcoin, transactions consume Unspent Transaction Outputs and produce new outputs.
At minimum, a transaction contains:
BlockchainCeylon is an independent publication dedicated to making blockchain concepts accessible to learners, students, and engineers.
Understand the mathematical and game-theoretic protocols that enable thousands of untrusted computers to agree on a single global state.
A foundational introduction to blockchain technology, explaining distributed ledgers, decentralization, and cryptographic security in simple terms.
A clear technical guide to asymmetric cryptography: how elliptic curve math connects your private key, public key, and public address.