Bitcoin Forum
May 02, 2024, 03:04:49 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Raw hex data of the prenet genesis transaction  (Read 99 times)
miner2251 (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 85


View Profile
August 20, 2021, 02:48:48 PM
Merited by HCP (5), vjudeu (5), o_e_l_e_o (4), ABCbits (3), vapourminer (2), Pmalek (2), Heisenberg_Hunter (1)
 #1

I recently read topic https://bitcointalk.org/index.php?topic=382374.0 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?
1714662289
Hero Member
*
Offline Offline

Posts: 1714662289

View Profile Personal Message (Offline)

Ignore
1714662289
Reply with quote  #2

1714662289
Report to moderator
1714662289
Hero Member
*
Offline Offline

Posts: 1714662289

View Profile Personal Message (Offline)

Ignore
1714662289
Reply with quote  #2

1714662289
Report to moderator
If you want to be a moderator, report many posts with accuracy. You will be noticed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714662289
Hero Member
*
Offline Offline

Posts: 1714662289

View Profile Personal Message (Offline)

Ignore
1714662289
Reply with quote  #2

1714662289
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6577


Just writing some code


View Profile WWW
August 20, 2021, 07:04:36 PM
Merited by ABCbits (10), HCP (10), miner2251 (9), o_e_l_e_o (4), vapourminer (1), Heisenberg_Hunter (1)
 #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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!