Author

Topic: Raw hex data of the prenet genesis transaction (Read 129 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
August 20, 2021, 02:04:36 PM
#2
This is an interesting question and I took far too long to figure it out.

The transaction hex is
Code:
010000000000000000000000000000000000000000000000000000000000000000ffffffff0504695dbf0e011027000000000000ffffffff44a94104d451b0d7e567c615719a630b9f44632a0f34f5e7101f9942fe0b39996151cef10a809c443df2fab7cd7e58a3538cd8afd08ccfaa49b637de4b1b383f088ad131aa00000000

There are 3 key differences in the prerelease version:
1. The transaction and block versions are not included in the serialization for hashing
2. The nSequence is found in the CTxOut rather than CTxIn
3. OP_CODESEPARATOR is 0xa9 and OP_CHECKSIG is 0xaa

The last point was harder to find as the source for script.h is not available. However it can be easily bruteforced.
jr. member
Activity: 34
Merit: 88
I recently read topic https://bitcointalksearch.org/topic/bitcoin-source-from-november-2008-382374 and I wonder how exactly that prenet genesis transaction looked like. After some digging I came up with this:
Code:
decoderawtransaction 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0504695dbf0effffffff01102700000000000044ab4104d451b0d7e567c615719a630b9f44632a0f34f5e7101f9942fe0b39996151cef10a809c443df2fab7cd7e58a3538cd8afd08ccfaa49b637de4b1b383f088ad131ac00000000
{
  "txid": "25c61a7089aa96318088bcccfbc12064a18166105c20c237836704611254d2da",
  "hash": "25c61a7089aa96318088bcccfbc12064a18166105c20c237836704611254d2da",
  "version": 1,
  "size": 133,
  "vsize": 133,
  "weight": 532,
  "locktime": 0,
  "vin": [
    {
      "coinbase": "04695dbf0e",
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.00010000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_CODESEPARATOR 04d451b0d7e567c615719a630b9f44632a0f34f5e7101f9942fe0b39996151cef10a809c443df2fab7cd7e58a3538cd8afd08ccfaa49b637de4b1b383f088ad131 OP_CHECKSIG",
        "hex": "ab4104d451b0d7e567c615719a630b9f44632a0f34f5e7101f9942fe0b39996151cef10a809c443df2fab7cd7e58a3538cd8afd08ccfaa49b637de4b1b383f088ad131ac",
        "type": "nonstandard"
      }
    }
  ]
}
Of course I know that transaction version was not present here (in the same way as in the block hash there was no version) and I can calculate sha256 of any data, but still, that transaction should hash into 769a5e93fac273fd825da42d39ead975b5d712b2d50953f35a4fdebdec8083e3. I tried using different values for OP_CODESEPARATOR and OP_CHECKSIG than 0xab and 0xac, but still no match. I tried different endianness in 32-bit and 256-bit values, but still no luck.

The only success so far was hashing the prenet genesis block:
Code:
prenetGenesis=0000000000000000000000000000000000000000000000000000000000000000e38380ecbdde4f5af35309d5b212d7b575d9ea392da45d82fd73c2fa935e9a76a00bc84814000000bb290200
prenetGenesisHash=7ae24cfad8adbe66ab2224a4f7269694fa2fa9aa157b1e44c608bd386fb6160b
prenetGenesisDoubleHash=46a6fa0cbc6e41aaebb6916c55013a0ad66b11e91d1d977ed627135db1060000
prenetGenesisFinalHash=000006b15d1327d67e971d1de9116bd60a3a01556c91b6ebaa416ebc0cfaa646
Is that lost in the past or is it possible to reconstruct that transaction as it was in prenet?
Jump to: