1

This post

How to retrieve the from and to wallet addresses of a transaction?

contains code by Nick ODell which refers to a file called 'genesis.bin' which contains "the raw bytes for the genesis transaction". I wonder if anyone knows how to retrieve that data?

2 Answers2

1

For regular transactions, if you have txindex=1 enabled on your node, you can call getrawtransaction to get the tx hex.

Interestingly, the genesis of the blockchain has a bug, and the genesis tx is not included in the UTXO set. Thus, you must get the genesis block, and take the transaction from that. You can do this using the getblock command, which outputs

0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000

In this, the genesis tx is:

01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000
Andrew Chow
  • 67,209
  • 5
  • 76
  • 149
Raghav Sood
  • 16,869
  • 3
  • 21
  • 42
1

Using blockchain.info:

1) Go to genesis block: https://blockchain.info/block-height/0

2) Click on block hash: https://blockchain.info/block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

3) Copy hash of the first transaction, use rawtx api: https://blockchain.info/rawtx/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b?format=hex

Also see https://github.com/joric/pyblockchain

Joric
  • 31
  • 5