Skip to content
HeroRPC

GUIDELaunch, 7 chapters

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.

Updated
Read
10 min

Where do you want to start?

In this guideThe short answer

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.

The genesis block at a glance
QuestionAnswer
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.

Quick check: Where does a node get the 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)
Bitcoin's genesis block values
FieldValueIn plain words
Time1231006505A Unix timestamp: seconds since 1 January 1970. It means 3 January 2009
Nonce2083236893The number that made the block hash valid
nBits0x1d00ffffThe difficulty target, written in a compact form
Reward50 coinsThe first block reward
Block hash000000000019d668...a8ce26fThe chain's ID. Note the run of zeros at the start
Merkle root4a5e1e4baab89f3a...afdeda33bA 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.

Quick check: What does the Times headline inside the genesis block prove?

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:

The six fields of a Bitcoin block header
FieldSizeWhat it holdsIn the genesis block
Version4 bytesThe block version number1
Previous block hash32 bytesThe fingerprint of the block beforeNothing to point to
Merkle root32 bytesA fingerprint built from all transactionsThe single transaction's hash
Time4 bytesWhen the block was made1231006505
nBits4 bytesThe target the hash must beat, in compact form0x1d00ffff
Nonce4 bytesA number miners change to get a new hash2083236893

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.

  1. Pick the message. Any text works. Many coins quote a headline, because it doubles as proof of the date.
  2. Set the time and the starting difficulty. Litecoin's genesis uses 0x1e0ffff0, which is easier than Bitcoin's 0x1d00ffff.
  3. Set the first reward. Bitcoin and Litecoin both use 50 coins.
  4. 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.
  5. 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.
Quick check: You change only the headline text in Bitcoin's genesis block. Does the old nonce still work?

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.

Bitcoin-style and Ethereum-style genesis compared
Chain pageBitcoin-styleEthereum-style
Where it is definedIn the source code, as a function callIn a genesis file loaded at start
Starting balancesNone. The first reward cannot be spentSet in the alloc list
Needs a nonce searchYesNot on a proof of authority chain, where difficulty is simply set to 1
IdentityThe block hashThe 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.

From your settings to block 0timeline
  1. You

    Choose your settings

    Name, supply, block time and, if you want one, a premine.

  2. Build

    We create the genesis block

    Your chain gets its own block 0 and its own ID.

  3. 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.

Some well-known startstimeline
  1. 31 Oct 2008

    Bitcoin whitepaper

    Published on a cryptography mailing list, two months before the first block.

  2. 3 Jan 2009

    Bitcoin genesis block

    Block 0, with the Times headline inside.

  3. 7 Oct 2011

    Litecoin

    Released as open-source code on GitHub, forked from Bitcoin's code.

  4. 6 Dec 2013

    Dogecoin

    Launched as a joke, based on Litecoin's code.

  5. 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

  1. Bitcoin Wiki, Genesis block (date, headline, values, unspendable reward, hardcoded block)
  2. Bitcoin Wiki, Block hashing algorithm (six header fields and double SHA-256)
  3. Bitcoin developer guide, block chain (merkle root and block 0)
  4. Bitcoin Core, src/kernel/chainparams.cpp (CreateGenesisBlock values and asserts)
  5. Litecoin Core, src/chainparams.cpp (Litecoin genesis headline, nonce and nBits)
  6. geth, private network guide (genesis file fields and geth init)
  7. EIP-155, simple replay attack protection (chain ID)
  8. Nakamoto Institute, Bitcoin whitepaper (published 31 October 2008)
  9. Wikipedia, Litecoin (released 7 October 2011)
  10. Wikipedia, Dogecoin (launched 6 December 2013, based on Litecoin)
  11. bitcoincash.org (split at block 478,558 on 1 August 2017)

Written by

HeroRPC team

Written and checked by the people who run HeroRPC's builder and node servers. Every figure links to its source.

Published . Last updated .