A blockchain is a list of blocks. Each block stores the hash of the block before it, which links the blocks together. The first block has no block before it. That first block is the genesis block.
Its previous-hash field is set to 32 zero bytes, because there is no block to point to.
Every node has the genesis block in its code. Nodes with a different genesis block are on a different chain.
It has a header, a transaction and a proof-of-work hash, the same as every block after it.
Satoshi Nakamoto mined Bitcoin's first block on 3 January 2009. This section builds that block again from its parts, in four steps, and checks the result against the real block.
Each step uses the output of the step before it. Edit the message in step 1 and watch every later step change.
A coinbase transaction creates new coins. In the genesis block it is the only transaction, and it creates 50 BTC. Satoshi wrote a newspaper headline into it. The headline proves the block was not made before that date.
The Merkle root is one hash that represents every transaction in the block. With a single transaction, it is the double SHA-256 hash of that transaction. Change the transaction and the Merkle root changes.
The header is the part of the block that gets hashed. It has six fields. Numbers are stored lowest byte first (little-endian), so the bytes can look reversed. The transactions are not hashed directly; the Merkle root stands in for them.
The block hash is the double SHA-256 hash of the header, shown byte-reversed as Bitcoin does. It must be lower than the target set by the bits field. A low number written in hex starts with zeros. Those zeros are the proof-of-work.
This block uses the same format as Bitcoin. You choose the coinbase message and the difficulty.
Mining means changing the nonce and hashing the header again until the hash is below the target. There is no shortcut; the only way is to try nonces one by one. Each extra bit of difficulty doubles the average number of tries.
The message goes into the coinbase transaction, like Satoshi's headline. Bitcoin allows at most 100 bytes in that field, which leaves room for a 91-byte message.
The hash must start with this many zero bits. Average tries needed: 1,048,576.
Each try changes the nonce by one and hashes the header twice with SHA-256.
Block #1 stores the hash of the genesis block. If someone edits the genesis block, its hash changes and no longer matches the hash stored in Block #1. The link breaks, and every node can see it.
Edit the message or the nonce below to try it.
Changing a single character is enough. The timestamp and difficulty stay the same.
Every node recomputes the hash and compares it with the one stored in Block #1.