Quick answer
The short answer
A genesis block is the first block of a blockchain, also called block 0. It has no previous block, and it is written straight into the software instead of being received from the network. Every later block links back to it, so it fixes the chain's identity. Change anything in it and you have a different chain.
| Question | Answer |
|---|---|
| What is it? | The first block of a chain, numbered 0 |
| Where does it live? | In the code of every node, not on the network |
| What does it link to? | Nothing. It is the only block with no previous block |
| Who makes it? | The creator of the chain, once, before launch |
| Can two coins share one? | Only if they are the same chain |
Bitcoin's genesis block also carries a message. Here is what it says, and why it matters for your own coin.
CHAPTER 01
What a genesis block is, in plain words
Block zero is the starting stone of a chain. It is built into the software, so every node begins from the same place.
A blockchain is a list of blocks, and each block holds the fingerprint (hash) of the one before it. That chain of fingerprints is what makes old data hard to change. But the first block has nothing before it, so it needs a special rule.
The Bitcoin Wiki describes block 0 as a block that does not reference a previous block and that is almost always hardcoded into the software of any application using its blockchain. In simple terms: nobody downloads the genesis block. Every node already has it.
- Role 1
The anchor
Every block points back to the one before it, all the way to block 0. If two nodes disagree on block 0, they are on different chains.
- Role 2
The first rules
It records the starting difficulty, the time and the first reward. On Ethereum-style chains it can also hand out the first balances.
- Role 3
The name tag
Its hash is a unique ID for the whole chain. That is why a new coin cannot reuse another coin's genesis block.
CHAPTER 02
Bitcoin's genesis block, in detail
A date, a newspaper headline and a reward that cannot be spent. Every value below comes from Bitcoin's own code.
Bitcoin's genesis block is dated 3 January 2009. Inside its first transaction sits a line of text, usually called the genesis block message:
Bitcoin Core builds the block with one line of code. The three numbers that matter are the time, the nonce and the difficulty setting:
CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN)| Field | Value | In plain words |
|---|---|---|
| Time | 1231006505 | A Unix timestamp: seconds since 1 January 1970. It means 3 January 2009 |
| Nonce | 2083236893 | The number that made the block hash valid |
| nBits | 0x1d00ffff | The difficulty target, written in a compact form |
| Reward | 50 coins | The first block reward |
| Block hash | 000000000019d668...a8ce26f | The chain's ID. Note the run of zeros at the start |
| Merkle root | 4a5e1e4baab89f3a...afdeda33b | A fingerprint of the block's transactions. Here there is just one |
From Bitcoin Core's chainparams.cpp and the Bitcoin Wiki. Hashes are shortened here; the full values are on both pages.
CHAPTER 03
What is inside a block header
Six fields make up a Bitcoin-style header. Change any one and the block hash changes.
A block has a short header and a list of transactions. The header is what gets hashed. According to the Bitcoin Wiki, a Bitcoin header has six fields, and Bitcoin hashes it twice with the SHA-256 algorithm:
| Field | Size | What it holds | In the genesis block |
|---|---|---|---|
| Version | 4 bytes | The block version number | 1 |
| Previous block hash | 32 bytes | The fingerprint of the block before | Nothing to point to |
| Merkle root | 32 bytes | A fingerprint built from all transactions | The single transaction's hash |
| Time | 4 bytes | When the block was made | 1231006505 |
| nBits | 4 bytes | The target the hash must beat, in compact form | 0x1d00ffff |
| Nonce | 4 bytes | A number miners change to get a new hash | 2083236893 |
Field sizes from the Bitcoin Wiki. Version 1 and the values in the last column are the arguments of CreateGenesisBlock in Bitcoin Core.
The Bitcoin developer guide explains the merkle root: transaction hashes are paired and hashed, again and again, until one hash is left. With a single transaction, that one hash is the root. Change the transaction, for example the headline text, and the merkle root changes, and so does the block hash.
To count as valid, the block hash must not go above the target. The nonce exists so a miner can keep trying new values until it does. That is the "work" in proof of work.
CHAPTER 04
Why every new chain needs its own, and how it is made
A coin that reuses Bitcoin's genesis block is Bitcoin. Making a new one means picking values, then searching for a nonce.
If your coin kept Bitcoin's genesis block, it would start from Bitcoin's history and be indistinguishable from it. A new genesis block gives your coin its own ID. Litecoin did this in October 2011: its genesis block quotes a different headline, "NY Times 05/Oct/2011 Steve Jobs, Apple's Visionary, Dies at 56", and uses a different nonce and difficulty setting.
- Pick the message. Any text works. Many coins quote a headline, because it doubles as proof of the date.
- Set the time and the starting difficulty. Litecoin's genesis uses 0x1e0ffff0, which is easier than Bitcoin's 0x1d00ffff.
- Set the first reward. Bitcoin and Litecoin both use 50 coins.
- Search for a nonce. Try values until the block hash is at or below the target. This is the same search miners do for every block.
- Update the two safety checks. Bitcoin Core asserts the expected genesis hash and merkle root. Replace both with your new values, or your node refuses to start.
Forking from Bitcoin or Litecoin? The full fork guide lists the other files to change next to the genesis block, such as ports and address prefixes.
CHAPTER 05
Ethereum-style chains use a genesis file
No nonce search for a business chain. A short settings file sets the chain ID and who starts with coins.
Ethereum-based software such as geth sets up a private chain from a small file, usually called genesis.json, then loads it with one command. The geth private network guide shows the main parts:
- chainId
The chain's number
A number that identifies your network. EIP-155 added it so a transaction signed for one chain cannot be replayed on another.
- alloc
The starting balances
Lists addresses and how much each begins with. This is how a premine is set on this kind of chain.
- difficulty, gasLimit
The starting limits
Starting difficulty, and the most work one block can hold. The gas limit can be changed after launch.
- config
The consensus settings
Chooses the consensus engine and turns on protocol upgrades from block 0.
You load the file with one command, geth init, and from then on that file is block 0 for the node. Every node on the network needs the same file. Pick a chain ID and network ID that no existing network uses, or your nodes may connect to a chain you did not mean to join.
| Chain page | Bitcoin-style | Ethereum-style |
|---|---|---|
| Where it is defined | In the source code, as a function call | In a genesis file loaded at start |
| Starting balances | None. The first reward cannot be spent | Set in the alloc list |
| Needs a nonce search | Yes | Not on a proof of authority chain, where difficulty is simply set to 1 |
| Identity | The block hash | The file contents and chain ID |
Based on Bitcoin Core's chainparams.cpp and the geth private network guide.
CHAPTER 06
What HeroRPC does for you
Your settings go in, a new genesis block comes out. No nonce search, no assert edits.
In our builder you pick a base, set your coin's rules, and we create a new genesis block from them: a new network ID, ports, address format and genesis block, with your supply and block time. Nothing is copied from the base coin's history.
- You
Choose your settings
Name, supply, block time and, if you want one, a premine.
- Build
We create the genesis block
Your chain gets its own block 0 and its own ID.
- Live
Nodes and services start
Your nodes, explorer and wallets come online, usually in about 30 minutes.
A coin with its own blockchain starts at $149 one-time. You see the full price in the builder before you pay.
CHAPTER 07
Famous launch dates
Four coins and the day each one began.
- 31 Oct 2008
Bitcoin whitepaper
Published on a cryptography mailing list, two months before the first block.
- 3 Jan 2009
Bitcoin genesis block
Block 0, with the Times headline inside.
- 7 Oct 2011
Litecoin
Released as open-source code on GitHub, forked from Bitcoin's code.
- 6 Dec 2013
Dogecoin
Launched as a joke, based on Litecoin's code.
- 1 Aug 2017
Bitcoin Cash
Not a new genesis block: the chain split from Bitcoin at block 478,558 and kept its history.
The last entry shows the difference. A split keeps the old genesis block. A code fork writes a new one. If you want a coin with its own history, you want a new one.
Next, read how mining your own coin works once block 1 is due, or see the complete guide to creating a cryptocurrency.
QUESTIONS
Questions people ask
What is a genesis block?
The first block of a blockchain, numbered 0. It has no previous block and is written into the software, so every node starts from the same place. All later blocks link back to it.
What is the Bitcoin genesis block message?
The text "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks", placed in the first transaction. It is a newspaper headline from 3 January 2009.
Can the Bitcoin genesis block reward be spent?
No. The Bitcoin Wiki says the first 50 coin reward cannot be spent because of a quirk in how the genesis block is written in the code. It is not known whether this was on purpose.
Why does every cryptocurrency need its own genesis block?
Because the genesis block fixes a chain's identity. Two coins with the same genesis block are the same chain. A new genesis block gives a new coin its own history.
How do you create a genesis block?
For a Bitcoin-style coin, choose a message, time, difficulty target and reward, search for a nonce that makes the block hash valid, then update the asserted genesis hash and merkle root in the code. For an Ethereum-style chain, write a genesis file and load it into each node.
What is a premine in the genesis block?
Coins created for the founders at launch. On Ethereum-style chains it is set in the alloc list of the genesis file. On Bitcoin-style chains the genesis reward cannot be spent, so a premine is paid out in a later block.
Does HeroRPC create a genesis block for my coin?
Yes. When you build a coin, we create a new genesis block from your settings, so your chain starts with its own ID and no history from the base coin.
SOURCES
Sources and how we made this guide
- Bitcoin Wiki, Genesis block (date, headline, values, unspendable reward, hardcoded block)
- Bitcoin Wiki, Block hashing algorithm (six header fields and double SHA-256)
- Bitcoin developer guide, block chain (merkle root and block 0)
- Bitcoin Core, src/kernel/chainparams.cpp (CreateGenesisBlock values and asserts)
- Litecoin Core, src/chainparams.cpp (Litecoin genesis headline, nonce and nBits)
- geth, private network guide (genesis file fields and geth init)
- EIP-155, simple replay attack protection (chain ID)
- Nakamoto Institute, Bitcoin whitepaper (published 31 October 2008)
- Wikipedia, Litecoin (released 7 October 2011)
- Wikipedia, Dogecoin (launched 6 December 2013, based on Litecoin)
- bitcoincash.org (split at block 478,558 on 1 August 2017)
Written by
Written and checked by the people who run HeroRPC's builder and node servers. Every figure links to its source.
Published . Last updated .