Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
zahid888
on 04/09/2023, 17:18:46 UTC
1 - Convert the private key from hex to bytes
00000000000000000000000000000000000000000000000354d62e5f7a0d2eb2
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03T\xd6._z\r.\xb2'

2 - Create a signing key from the private key bytes using the SECP256k1 elliptic curve
<ecdsa.keys.SigningKey object at 0x000002D447E14400>

3 - Get the corresponding public key
02b21a6b1590b145841a0dabbe71ea01e29ed60f0e468cff36445a9c92eb3a6375
VerifyingKey.from_string(b'\x02\xb2\x1ak\x15\x90\xb1E\x84\x1a\r\xab\xbeq\xea\x01\xe2\x9e\xd6\x0f\x0eF\x8c\xff6DZ\x9c\x92\xeb:cu', SECP256k1, sha1)

4 - Serialize the public key in compressed format (33 bytes)
b'\x02\xb2\x1ak\x15\x90\xb1E\x84\x1a\r\xab\xbeq\xea\x01\xe2\x9e\xd6\x0f\x0eF\x8c\xff6DZ\x9c\x92\xeb:cu'
02b21a6b1590b145841a0dabbe71ea01e29ed60f0e468cff36445a9c92eb3a6375

5 - Calculate the SHA-256 hash of the public key
b'\t\xb4\x87?D\'I\xef>\x86\xc7\x1d\x92\x86\xb1"\xa9\xdd\xf9v%\xa0\x03X\x88\xfb\x96%F\x0e\'\x16'
09b4873f442749ef3e86c71d9286b122a9ddf97625a0035888fb9625460e2716

6 - Calculate the RIPEMD-160 hash of the SHA-256 hash
<ripemd160 HASH object @ 0x000002D4477BF690>
b' \xd4Zjv%3BR\xc81\x8a\x87\xed053\xc1\xc7\xbb'
20d45a6a7625334252c8318a87ed303533c1c7bb

7 - Add the version byte (0x00 for mainnet) to the RIPEMD-160 hash
b'\x00'

8 - Extended RIPEMD-160 Hash
b'\x00 \xd4Zjv%3BR\xc81\x8a\x87\xed053\xc1\xc7\xbb'
0020d45a6a7625334252c8318a87ed303533c1c7bb

9 - Calculate the double SHA-256 checksum
b'\x01\x02l\xf90\xf6N\x8f\xeb\xca\xc8\xc2\x15\xd9Q\xb8i))\xb0\xce:\xb1\xba\x9e\xa4\xa1\x07_\x05\xe2\xa2'
b'\x01\x02l\xf9'

10 - Checksum: 01026cf9

11 - Append the checksum to the extended RIPEMD-160 hash
b'\x00 \xd4Zjv%3BR\xc81\x8a\x87\xed053\xc1\xc7\xbb\x01\x02l\xf9'
0020d45a6a7625334252c8318a87ed303533c1c7bb01026cf9

12 - Address (with checksum)
0020d45a6a7625334252c8318a87ed303533c1c7bb01026cf9

13 - Convert the bytes to a base58-encoded Bitcoin address
13zb1hQbWVnN3ag9GNS2vCraT8PQJDjVdr

provide an alternative, more straightforward method, if available instead of this ?