<blockquote>
  <p>Are the transactions added to the genesis block spendable, just like any other transactions from other blocks, or is that an unspendable coinbase transaction.</p>
</blockquote>

<p>Transactions aren't spendable; transaction <em>outputs</em> are.</p>

<blockquote>
  <p>Is the transaction within the Genesis block spendable, provided the corresponding private key of the bitcoin recipient is found?</p>
</blockquote>

<p>The single transaction output in Bitcoin's genesis block is not spendable. It is not known whether this was an intentional choice by the system's creator, or an accident. Regardless, the reasons why currently don't matter, as no Bitcoin full node software would accept such a spend.</p>

<blockquote>
  <p>If I fork the Bitcoin code, and generate my own genesis block. Can I use the private key/public key I used as bitcoin recipient of the transactions hard-coded with the genesis block?</p>
</blockquote>

<p>In your own software you can enforce whatever rules you like.</p>

CC BY-SA 4.0
2018-07-03T01:43:54.643Z
2018-07-03T01:43:54.643Z
Pieter Wuille
<blockquote>
  <p>Are the transactions added to the genesis block spendable, just like
  any other transactions from other blocks, or is that an unspendable
  coinbase transaction.</p>
</blockquote>

<p>The coinbase transaction of the genesis block is not spendable. </p>

<blockquote>
  <p>If I fork the Bitcoin code, and generate my own genesis block. Can I
  use the private key/public key I used as bitcoin recipient of the
  transactions hard-coded with the genesis block?</p>
</blockquote>

<p>Yes, but you have to make some modifications to the source code, because it's "unspendability" has been hard coded to avoid a hard fork.</p>

<h2>How to make it spendable</h2>

<h3><code>chainparams.cpp</code></h3>

<ol>
<li>Mine your own genesis block by providing all the necessary information in <code>chainparams.cpp</code>, mainly <a href="https://github.com/bitcoin/bitcoin/blob/0.16/src/chainparams.cpp#L50" rel="nofollow noreferrer">CreateGenesisBlock</a> and <a href="https://github.com/bitcoin/bitcoin/blob/0.16/src/chainparams.cpp#L123" rel="nofollow noreferrer">Line #123</a> (for mainnet, similar for testnet and regtest in same file).</li>
</ol>

<h3><code>validation.cpp</code></h3>

<p>You need to make it so the transaction is added to the index, and bypass some checks that make it unspendable. In <code>v0.16</code>:</p>

<ol>
<li>You can find where it is not added to the index in <a href="https://github.com/bitcoin/bitcoin/blob/0.16/src/validation.cpp#L1812" rel="nofollow noreferrer"><code>validation.cpp</code> Line #1812</a>. Comment out Line 1817 <code>return true</code> to avoid skipping this.</li>
</ol>

<p><strong><em>You might also need to skip validation tests (for example if your genesis block difficulty is lower, if you have a premine) in places such as:</em></strong></p>

<ol start="2">
<li><p>Skip <code>nLockTimeFlags |= LOCKTIME_VERIFY_SEQUENCE;</code> on <a href="https://github.com/bitcoin/bitcoin/blob/0.16/src/validation.cpp#L1891" rel="nofollow noreferrer">Line #1891</a> by adding a check around it:</p>

<p><code>if (block.GetHash() != chainparams.GetConsensus().hashGenesisBlock)
{
    if (VersionBitsState(pindex-&gt;pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_CSV, versionbitscache) == THRESHOLD_ACTIVE) {
        nLockTimeFlags |= LOCKTIME_VERIFY_SEQUENCE;
    }
}
</code></p></li>
<li><p>Also similar exceptions (check that != genesis block) for <code>if (!WriteUndoDataForBlock(blockundo, state, pindex, chainparams))
return false;</code> on <a href="https://github.com/bitcoin/bitcoin/blob/0.16/src/validation.cpp#L1988" rel="nofollow noreferrer">Line #1988</a></p></li>
<li><p>Similar exception for <a href="https://github.com/bitcoin/bitcoin/blob/0.16/src/validation.cpp#L1805" rel="nofollow noreferrer">Line #1805</a>, <a href="https://github.com/bitcoin/bitcoin/blob/0.16/src/validation.cpp#L1873" rel="nofollow noreferrer">Lines #1873-1876</a></p></li>
</ol>

<p>Basically, you need to run it and try and see where it fails in the logs, because you're breaking a bunch of rules.</p>

CC BY-SA 4.0
2018-07-10T14:23:03.260Z
2018-07-10T14:23:03.260Z
JBaczuk
<p>Are the transactions added to the genesis block spendable, just like any other transactions from other blocks, or is that an unspendable coinbase transaction.</p>

<p>In other words..</p>

<p>Is the transaction within the Genesis block spendable, provided the corresponding private key of the bitcoin recipient is found?</p>

<p>and If I fork the Bitcoin code, and generate my own genesis block. Can I use the private key/public key I used as bitcoin recipient of the transactions  hard-coded with the genesis block?</p>

CC BY-SA 4.0
2018-08-09T17:31:48.250Z
See https://bitcoin.stackexchange.com/questions/76831/is-the-transaction-within-genesis-block-spendable/77049#77049
JBaczuk
<genesis-block><receiving>
Is the transaction within Genesis block spendable?
picolo
# Is the transaction within Genesis block spendable?

(Asked by: username_0 on 2018-07-03)

Are the transactions added to the genesis block spendable, just like any other transactions from other blocks, or is that an unspendable coinbase transaction.

In other words..

Is the transaction within the Genesis block spendable, provided the corresponding private key of the bitcoin recipient is found?

and If I fork the Bitcoin code, and generate my own genesis block. Can I use the private key/public key I used as bitcoin recipient of the transactions hard-coded with the genesis block?

**Tags:** genesis-block, receiving

> **Comments:**
> **username_1**: See https://bitcoin.stackexchange.com/questions/76831/is-the-transaction-within-genesis-block-spendable/77049#77049  

---

## 2 answers

### Answer by username_2 on 2018-07-03. Score: 3

> Are the transactions added to the genesis block spendable, just like any other transactions from other blocks, or is that an unspendable coinbase transaction.

Transactions aren't spendable; transaction *outputs* are.

> Is the transaction within the Genesis block spendable, provided the corresponding private key of the bitcoin recipient is found?

The single transaction output in Bitcoin's genesis block is not spendable. It is not known whether this was an intentional choice by the system's creator, or an accident. Regardless, the reasons why currently don't matter, as no Bitcoin full node software would accept such a spend.

> If I fork the Bitcoin code, and generate my own genesis block. Can I use the private key/public key I used as bitcoin recipient of the transactions hard-coded with the genesis block?

In your own software you can enforce whatever rules you like.


---

### Answer by username_1 on 2018-07-10. Score: 2

> Are the transactions added to the genesis block spendable, just like
> any other transactions from other blocks, or is that an unspendable
> coinbase transaction.

The coinbase transaction of the genesis block is not spendable.

> If I fork the Bitcoin code, and generate my own genesis block. Can I
> use the private key/public key I used as bitcoin recipient of the
> transactions hard-coded with the genesis block?

Yes, but you have to make some modifications to the source code, because it's "unspendability" has been hard coded to avoid a hard fork.

## How to make it spendable

### `chainparams.cpp`

1. Mine your own genesis block by providing all the necessary information in `chainparams.cpp`, mainly [CreateGenesisBlock](https://github.com/bitcoin/bitcoin/blob/0.16/src/chainparams.cpp#L50) and [Line #123](https://github.com/bitcoin/bitcoin/blob/0.16/src/chainparams.cpp#L123) (for mainnet, similar for testnet and regtest in same file).

### `validation.cpp`

You need to make it so the transaction is added to the index, and bypass some checks that make it unspendable. In `v0.16`:

1. You can find where it is not added to the index in [`validation.cpp` Line #1812](https://github.com/bitcoin/bitcoin/blob/0.16/src/validation.cpp#L1812). Comment out Line 1817 `return true` to avoid skipping this.

***You might also need to skip validation tests (for example if your genesis block difficulty is lower, if you have a premine) in places such as:***

2. Skip `nLockTimeFlags |= LOCKTIME_VERIFY_SEQUENCE;` on [Line #1891](https://github.com/bitcoin/bitcoin/blob/0.16/src/validation.cpp#L1891) by adding a check around it:

   `if (block.GetHash() != chainparams.GetConsensus().hashGenesisBlock)
   {
   if (VersionBitsState(pindex->pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_CSV, versionbitscache) == THRESHOLD_ACTIVE) {
   nLockTimeFlags |= LOCKTIME_VERIFY_SEQUENCE;
   }
   }`
3. Also similar exceptions (check that != genesis block) for `if (!WriteUndoDataForBlock(blockundo, state, pindex, chainparams))
   return false;` on [Line #1988](https://github.com/bitcoin/bitcoin/blob/0.16/src/validation.cpp#L1988)
4. Similar exception for [Line #1805](https://github.com/bitcoin/bitcoin/blob/0.16/src/validation.cpp#L1805), [Lines #1873-1876](https://github.com/bitcoin/bitcoin/blob/0.16/src/validation.cpp#L1873)

Basically, you need to run it and try and see where it fails in the logs, because you're breaking a bunch of rules.


---

