Draft: this page has unconfirmed details and is hidden from search.
What's missing (1)
[EIP-155]
Guide · Launch
What is a genesis block? Bitcoin's block 0 and how your coin gets its own
The genesis block is the very first block of a blockchain, the one every other block builds on. Bitcoin's was created on 3 January 2009 and hides a newspaper headline inside it. Here is what is in it, why every new coin needs its own, and how one is made.
By Abraham, Blockchain researcher
Updated · 10 min read
Before we start
Which one sounds like you?
What's inside
7 chapters. Read it start to finish, or jump to the part you need.
Chapter 1What a genesis block is, in plain wordsBlock zero is the starting stone of a chain. It is built into the software, so every node begins from the same place.
Chapter 2Bitcoin's genesis block, in detailA date, a newspaper headline and a reward that cannot be spent. Every value below comes from Bitcoin's own code.
Chapter 3What is inside a block headerSix fields make up a Bitcoin-style header. Change any one and the block hash changes.
Chapter 4Why every new chain needs its own, and how it is madeA coin that reuses Bitcoin's genesis block is Bitcoin. Making a new one means picking values, then searching for a nonce.
Chapter 5Ethereum-style chains use a genesis fileNo nonce search for a business chain. A short settings file sets the chain ID and who starts with coins.
Chapter 6What RocketRPC does for youYour settings go in, a new genesis block comes out. No nonce search, no assert edits.
Chapter 7Famous launch datesFour coins and the day each one began.
The short 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.
1Chapter 1
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 1The anchorEvery 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 2The first rulesIt records the starting difficulty, the time and the first reward. On Ethereum-style chains it can also hand out the first balances.
- Role 3The name tagIts hash is a unique ID for the whole chain. That is why a new coin cannot reuse another coin's genesis block.
2Chapter 2
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 |
3Chapter 3
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 |
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.
4Chapter 4
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.
5Chapter 5
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:
- chainIdThe chain's numberA number that identifies your network. EIP-155 added it so a transaction signed for one chain cannot be replayed on another.
- allocThe starting balancesLists addresses and how much each begins with. This is how a premine is set on this kind of chain.
- difficulty, gasLimitThe starting limitsStarting difficulty, and the most work one block can hold. The gas limit can be changed after launch.
- configThe consensus settingsChooses 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.
| 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 |
6Chapter 6
What RocketRPC 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.
- YouChoose your settingsName, supply, block time and, if you want one, a premine.
- BuildWe create the genesis blockYour chain gets its own block 0 and its own ID.
- LiveNodes and services startYour nodes, explorer and wallets come online, usually in about 30 minutes.
A coin with its own blockchain starts at $149 one-time. Hosting is $5 per server per month after launch, shown in the price box before you pay.
7Chapter 7
Famous launch dates
Four coins and the day each one began.
- 31 Oct 2008Bitcoin whitepaperPublished on a cryptography mailing list, two months before the first block.
- 3 Jan 2009Bitcoin genesis blockBlock 0, with the Times headline inside.
- 7 Oct 2011LitecoinReleased as open-source code on GitHub, forked from Bitcoin's code.
- 6 Dec 2013DogecoinLaunched as a joke, based on Litecoin's code.
- 1 Aug 2017Bitcoin CashNot 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 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 RocketRPC 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.
Read next
How to create a cryptocurrencyThe complete guide, from coin or token to launch day.
How to fork BitcoinEvery file to change next to the genesis block.
Mine your own cryptocurrencyWhat happens at block 1 and how miners join.
Create a blockchain with RocketRPCYour own chain, with a new genesis block made for you.
Sources
- 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