I read this question 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 ?

The bitcoin source code has a special case in it to exclude connecting the transactions to the view. It can be found here. 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

  • I removed the piece of code(github.com/bitcoin/bitcoin/blob/v0.10.2/src/…) 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 Jun 3 '15 at 19:48

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.

  • 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 May 26 '15 at 12:28

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.