• About
  • FAQ
  • Earn Bitcoin while Surfing the net
  • Buy & Sell Crypto on Paxful
Newsletter
Approx Foundation
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
Approx Foundation
No Result
View All Result
Home Bitcoin

bitcoind – Unable to parse blocks from blk*.dat for testnet (3 and 4)

Moussa by Moussa
November 7, 2024
in Bitcoin
0
peer discovery – how to obtain the IP addresses of nodes for mining pools?
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


For the Bitcoin mainnet, I can easily fetch one block by following steps:

  1. Open the LevelDB database at /data/blocks/index

  2. Get by key: 629986b32020caeb48a421956936dd88dc8d7825441bbc96fec10e98b800000000(hex)

    Just as an example. This is block #12345 with block hash 00000000b8980ec1fe96bc1b4425788ddc88dd36699521a448ebca2020b38699. Transform it into the internal representation in bitcoin-core and prepend ASCII ‘b’ to it.

  3. Follow this answer and parse the value.

I’m able to get:

8eed3c -- client_version (259900)
df39 -- block_height (12345)
1d -- block_status (29)
01 -- tx_number (1)
00 -- blk_file (0)
80afc145 -- blk_start (2892101)
9fd565 -- rev_start (not care about this)

01000000 -- block_version
df9c748f06fcb1e7a4152e76b974e8a5c51c235afb6044388260877600000000 -- prev_blockhash
5731362967a95ffbce2027abf78111e87e804aa8ad6b5b483bb96e827ac91dfd -- merkle_root
5cdff449 -- time
ffff001d -- bits
1f35c72e -- nonce

Open /blocks/blocks/blk00000.dat and go to offset 2892101, there’s 01000000 df9c748f06fcb1..., which is the correct block header and is the same as one decoded above.

File dump:

002C2140   D9 D8 00 00  00 01 00 00  00 DF 9C 74  8F 06 FC B1  ...........t....
002C2150   E7 A4 15 2E  76 B9 74 E8  A5 C5 1C 23  5A FB 60 44  ....v.t....#Z.`D
....

But it’s just broken for testnet3 and testnet4. For example, use the exactly same approach above, also with block #12345, I got:

8eed3c -- client_version
df39 -- block_height (12345)
801d -- block_status
01 -- tx_number
00 -- blk_file (0)
9cf0ff70 -- blk_start (62668912)
83f19804 -- rev_start

00600720 -- version
39905ba030a61e45209006737dc9dc4cfbe2f077919b01cbc7a20a0000000000 -- prev_blockhash
8cf89e0e3a833718dc0b05da4ad7b5faeff63507ed5d02b66a0b2ce7bb82f12d -- merkle_root
734c3e66 -- time
f0ff0f1b -- bits
924847df -- nonce

Consult file blocks/testnet4/blocks/blk00000.dat at position 9cf0ff70, it says

03BC4070   73 73 15 A8  83 AE 8E 19  A5 F9 1D E0  A6 0D FC 9E  ss..............
03BC4080   BE 3C 81 74  E4 F3 57 14  B7 31 3A D0  C4 4C EF E2  .<.t..W..1:..L..
03BC4090   9D 14 53 14  0A A1 8E 19  65 4C 3D 5A  43 8D 38 AE  ..S.....eL=ZC.8.
03BC40A0   50 A5 8A B8  83 B4 E8 17  02 B6 C3 32  E9 AB 20 C8  P..........2.. .
03BC40B0   8F 0C 90 9F  F8 19 FC 50  5C 4D 38 E8  CE 90 E8 E9  .......P\M8.....
03BC40C0   9A 43 26 4D  DA 73 83 18  64 4C 3D 85  82 AF 8F 19  .C&M.s..dL=.....
03BC40D0   65 4C 3D 85  82 AE 8E 19  65 4C 3D 85  82 AE 8E 19  eL=.....eL=.....
03BC40E0   65 4C 3D 85  82 AE 8E 19  65 4C 3D 85  82 AE 8E E6  eL=.....eL=.....

Obviously it’s not a block data.

I tried searching the testnet4 genesis block signature 03/May/2024 0000000... in the testnet4/blocks folder, with no result either.

❯ rg --binary -uuu '03/May/2024 0000'

Is there some obfuscation or something applied for the testnet blk* file data? Or I missed something? Thanks!

My Bitcoin Core version: v28.99.0-0ca1d1bf69ca



Source link

Related articles

Congressman Keith Self Moves To Block US CBDC Via Defense Bill Amendment

US Could Lose Industry to EU MiCA if CLARITY Act Bill Delays Continue

March 28, 2026
Bitcoin 53% Down From Cycle Peak – Key Levels To Clear For Full Recovery

Bitcoin 53% Down From Cycle Peak – Key Levels To Clear For Full Recovery

March 28, 2026
Share76Tweet47

Related Posts

Congressman Keith Self Moves To Block US CBDC Via Defense Bill Amendment

US Could Lose Industry to EU MiCA if CLARITY Act Bill Delays Continue

by Moussa
March 28, 2026
0

The warning from the crypto industry is becoming blunt: the United States is losing the regulatory race, and Europe is...

Bitcoin 53% Down From Cycle Peak – Key Levels To Clear For Full Recovery

Bitcoin 53% Down From Cycle Peak – Key Levels To Clear For Full Recovery

by Moussa
March 28, 2026
0

Trusted Editorial content, reviewed by leading industry experts and seasoned editors. Ad Disclosure The Bitcoin market remains in a bear...

Bitcoin Weekly Close On Sight As It Falls To $65K

Bitcoin Weekly Close On Sight As It Falls To $65K

by Moussa
March 28, 2026
0

The latest Bitcoin (BTC) price drop has raised concerns about the cryptocurrency’s upcoming performance, with some analysts warning that BTC’s...

Morgan Stanley Set To Undercut Bitcoin ETF Rivals With 0.14% Fee Ahead Of Launch

Morgan Stanley Set To Undercut Bitcoin ETF Rivals With 0.14% Fee Ahead Of Launch

by Moussa
March 28, 2026
0

Morgan Stanley is poised to shake up the spot bitcoin ETF market with a sharply lower fee structure, as new...

US Lawmaker Probes Federal Reserve Approval of Kraken, Warns of ‘Critical’ Risk – Featured Bitcoin News

US Lawmaker Probes Federal Reserve Approval of Kraken, Warns of ‘Critical’ Risk – Featured Bitcoin News

by Moussa
March 28, 2026
0

Lawmaker Presses Fed Over Crypto Account Approval Heightened scrutiny over access to U.S. payment infrastructure is intensifying as policymakers examine...

Load More

youssufi.com

sephina.com

[vc_row full_width="stretch_row" parallax="content-moving" vc_row_background="" background_repeat="no-repeat" background_position="center center" footer_scheme="dark" css=".vc_custom_1517813231908{padding-top: 60px !important;padding-bottom: 30px !important;background-color: #191818 !important;background-position: center;background-repeat: no-repeat !important;background-size: cover !important;}" footer_widget_title_color="#fcbf46" footer_button_bg="#fcb11e"][vc_column width="1/4"]

We bring you the latest in Crypto News

[/vc_column][vc_column width="1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GZGl2JTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJ0bnAtZmllbGQlMjB0bnAtcHJpdmFjeS1maWVsZCUyMiUzRSUzQ2xhYmVsJTNFJTNDaW5wdXQlMjB0eXBlJTNEJTIyY2hlY2tib3glMjIlMjBuYW1lJTNEJTIybnklMjIlMjByZXF1aXJlZCUyMGNsYXNzJTNEJTIydG5wLXByaXZhY3klMjIlM0UlQzIlQTBCeSUyMGNvbnRpbnVpbmclMkMlMjB5b3UlMjBhY2NlcHQlMjB0aGUlMjBwcml2YWN5JTIwcG9saWN5JTNDJTJGbGFiZWwlM0UlM0MlMkZkaXYlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1idXR0b24lMjIlM0UlM0NpbnB1dCUyMGNsYXNzJTNEJTIydG5wLXN1Ym1pdCUyMiUyMHR5cGUlM0QlMjJzdWJtaXQlMjIlMjB2YWx1ZSUzRCUyMlN1YnNjcmliZSUyMiUyMCUzRSUwQSUzQyUyRmRpdiUzRSUwQSUzQyUyRmZvcm0lM0UlMEElM0MlMkZkaXYlM0UlM0NiciUyRiUzRSUzQyUyRnAlM0U=[/vc_raw_html][/vc_column][/vc_row]
No Result
View All Result
  • Contact Us
  • Homepages
  • Business
  • Guide

© 2024 APPROX FOUNDATION - The Crypto Currency News