<p>It would be trivially easy to make the change.  Just a couple lines of code to add the include the genesis block tx in the utxo.  </p>

<p>Understand however the hard part is that would create a hard fork.  Unless the change became part of a majority of nodes it would violate the consensus rules. If that output was ever spent any node running older code would be split from any node running newer code as some nodes would see the new txn as valid and some as invalid.  This is true for any hard fork scenario.  For this reason it is unlikely that hard forks for minor or trivially reasons will ever happen.</p>

CC BY-SA 3.0
2015-05-26T12:28:47.307Z
Yes it would create a hard fork. I am trying to find where in the source code I have to do the changes. Which function do I have to modify or which function to call ?
somesh
CC BY-SA 3.0
2015-05-26T12:05:29.797Z
2015-05-26T14:37:54.743Z
2015-05-26T14:37:54.743Z
DeathAndTaxes
<p>The bitcoin source code has a special case in it to exclude connecting the transactions to the view. It can be found <a href="https://github.com/bitcoin/bitcoin/blob/v0.10.2/src/main.cpp#L1664-L1667" rel="nofollow">here</a>. Presumably you would just remove this restriction to be able to spend genesis coins. It would also require wiping your datadir, and restarting your node to re-download the blockchain.</p>

<p>If you are working with the real bitcoin network (which I suspect you are not), you won't want to do this. Even though it seems unlikely that Satoshi would ever return and try to spend these coins, such action would lead to your node diverging from the rest of the network</p>

CC BY-SA 3.0
2015-06-03T19:48:14.767Z
I removed the piece of code(https://github.com/bitcoin/bitcoin/blob/v0.10.2/src/main.cpp#L1664-L1667) and wiped datadir. Then tried testing it in regtest mode `bitcoind -regtest -daemon`, but the daemon is not starting. It prints _Bitcoin Server is Starting_ but when I use `bitcoin-cli -regtest -getbalance` it prints _error:couldn't connect to server_ .
somesh
CC BY-SA 3.0
2015-05-26T13:31:12.940Z
2015-05-26T13:31:12.940Z
morsecoder
<p>I read this question <a href="https://bitcoin.stackexchange.com/questions/10009/why-can-t-the-genesis-block-coinbase-be-spent">Why can’t the genesis block coinbase be spent?</a> . It says because of some quirk (<em>the genesis block coinbase transaction is not added to the global transaction database</em>) genesis block coinbase transaction cannot be spent.</p>

<p>How to add this transaction to the global transaction database ? What changes are needed to make this transaction spendable ? </p>

<bitcoind><bitcoin-core-development><genesis-block><coinbase-transaction>
How to make genesis block transaction spendable?
somesh
# How to make genesis block transaction spendable?

(Asked by: username_0 on 2015-05-25)

I read this question [Why can’t the genesis block coinbase be spent?](https://bitcoin.stackexchange.com/questions/10009/why-can-t-the-genesis-block-coinbase-be-spent) . It says because of some quirk (*the genesis block coinbase transaction is not added to the global transaction database*) genesis block coinbase transaction cannot be spent.

How to add this transaction to the global transaction database ? What changes are needed to make this transaction spendable ?

**Tags:** bitcoind, bitcoin-core-development, genesis-block, coinbase-transaction


---

## 2 answers

### Answer by username_1 on 2015-05-26. Score: 2

It would be trivially easy to make the change. Just a couple lines of code to add the include the genesis block tx in the utxo.

Understand however the hard part is that would create a hard fork. Unless the change became part of a majority of nodes it would violate the consensus rules. If that output was ever spent any node running older code would be split from any node running newer code as some nodes would see the new txn as valid and some as invalid. This is true for any hard fork scenario. For this reason it is unlikely that hard forks for minor or trivially reasons will ever happen.

> **Comments:**
> **username_0**: Yes it would create a hard fork. I am trying to find where in the source code I have to do the changes. Which function do I have to modify or which function to call ?  

---

### Answer by username_2 on 2015-05-26. Score: 1

The bitcoin source code has a special case in it to exclude connecting the transactions to the view. It can be found [here](https://github.com/bitcoin/bitcoin/blob/v0.10.2/src/main.cpp#L1664-L1667). Presumably you would just remove this restriction to be able to spend genesis coins. It would also require wiping your datadir, and restarting your node to re-download the blockchain.

If you are working with the real bitcoin network (which I suspect you are not), you won't want to do this. Even though it seems unlikely that Satoshi would ever return and try to spend these coins, such action would lead to your node diverging from the rest of the network

> **Comments:**
> **username_0**: I removed the piece of code(https://github.com/bitcoin/bitcoin/blob/v0.10.2/src/main.cpp#L1664-L1667) and wiped datadir. Then tried testing it in regtest mode `bitcoind -regtest -daemon`, but the daemon is not starting. It prints _Bitcoin Server is Starting_ but when I use `bitcoin-cli -regtest -getbalance` it prints _error:couldn't connect to server_ .  

---

