[BTC-dev] (CORRECTED) (EXPERIMENTAL) Raw Block Extractor

Stanislav Datskovskiy stas at loper-os.org
Mon Jun 29 01:09:27 UTC 2015


Name: readme_s.txt
URL: <http://therealbitcoin.org/ml/btc-dev/attachments/20150628/readme_s_f7d3920d6f1f6b5415382b4ceabb25c02c99279a.txt>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

This is a CORRECTED version of
http://therealbitcoin.org/ml/btc-dev/attachments/20150628/asciilifeform_and_now_we_have_block_dumper_c75bcfbe8878a3f3387d7ed9bb4c2eca16c838ad.patch

(We don't need to rebuild the merkle tree.)


This patch adds an rpc function, 'dumpblock.'

It was written against my most recent set [1]
but ought to apply cleanly to just about anybody's 0.5.3.x tree. If I'm proven
wrong about this, please talk to me. I will help you merge.

Does precisely what is printed on the tin.

It may be possible to improve on the algo, but what is given ought to suffice
for just about any conceivable use.

Example:

$ ./bitcoind dumpblock 0 genesis.bin

$ hexdump -C genesis.bin 
00000000  01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 3b a3 ed fd  7a 7b 12 b2 7a c7 2c 3e  |....;...z{..z.,>|
00000030  67 76 8f 61 7f c8 1b c3  88 8a 51 32 3a 9f b8 aa  |gv.a......Q2:...|
00000040  4b 1e 5e 4a 29 ab 5f 49  ff ff 00 1d 1d ac 2b 7c  |K.^J)._I......+||
00000050  01 01 00 00 00 01 00 00  00 00 00 00 00 00 00 00  |................|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000070  00 00 00 00 00 00 ff ff  ff ff 4d 04 ff ff 00 1d  |..........M.....|
00000080  01 04 45 54 68 65 20 54  69 6d 65 73 20 30 33 2f  |..EThe Times 03/|
00000090  4a 61 6e 2f 32 30 30 39  20 43 68 61 6e 63 65 6c  |Jan/2009 Chancel|
000000a0  6c 6f 72 20 6f 6e 20 62  72 69 6e 6b 20 6f 66 20  |lor on brink of |
000000b0  73 65 63 6f 6e 64 20 62  61 69 6c 6f 75 74 20 66  |second bailout f|
000000c0  6f 72 20 62 61 6e 6b 73  ff ff ff ff 01 00 f2 05  |or banks........|
000000d0  2a 01 00 00 00 43 41 04  67 8a fd b0 fe 55 48 27  |*....CA.g....UH'|
000000e0  19 67 f1 a6 71 30 b7 10  5c d6 a8 28 e0 39 09 a6  |.g..q0..\..(.9..|
000000f0  79 62 e0 ea 1f 61 de b6  49 f6 bc 3f 4c ef 38 c4  |yb...a..I..?L.8.|
00000100  f3 55 04 e5 1e c1 12 de  5c 38 4d f7 ba 0b 8d 57  |.U......\8M....W|
00000110  8a 4c 70 2b 6b f1 1d 5f  ac 00 00 00 00           |.Lp+k.._.....|
0000011d

You can checksum these [1], sign with GPG, cat them to your drum printer and make
ascii pr0n, whatever.

The next obvious step is to implement an 'eatblock <index> block.bin' - for the
truly adventurous.

But I'll leave that for another day.

- ---
[1] http://therealbitcoin.org/ml/btc-dev/2015-June/000102.html
[2] Note that such a checksum will differ from Bitcoin's header-only checksum!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iQEcBAEBCgAGBQJVkJpTAAoJELmCKKABq//H970H/32GabgQJxlQ2xbwGMTDFqH4
fuqMCQwxQ4+4rg1plgkc2rqVAjdMY9TXLrIVsOYFM7b7gyQoSM/eqfwb7xhvy17L
As8uRfMsHrBtSr295Og+jchvD6i8JcMwDTlS+Au4CwGWPROmhv1bUyyoC8Xp3mk7
cx5hsdLhptywUJmOmPQlFjF2LWHngk1R6k2Y+N5/Lb9at9k+QQjC3w5jNuv+pgmP
WoZrbeYDUTPBk21o6g2X5wbqpqvAEBJQEi0571neztdvQkjxGC4wUWWtCLplnxoN
6eeyPCTZ6+rq8z3Nq+dm4+53YLcpSUrYyOn/VLZpsf3MalsozkWPyqrvQNlN8WE=
=k9VL
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asciilifeform_and_now_we_have_block_dumper_corrected.patch
Type: text/x-patch
Size: 2504 bytes
Desc: not available
URL: <http://therealbitcoin.org/ml/btc-dev/attachments/20150628/asciilifeform_and_now_we_have_block_dumper_corrected_2084dc0427590fef92f9de097b9045b1ac7cdac8.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asciilifeform_and_now_we_have_block_dumper_corrected.patch.sig
Type: application/octet-stream
Size: 490 bytes
Desc: not available
URL: <http://therealbitcoin.org/ml/btc-dev/attachments/20150628/asciilifeform_and_now_we_have_block_dumper_corrected_08a6972f0af8a2ecb8ca457f9f856dfa78a3e7e0.patch.sig>


More information about the BTC-dev mailing list