Sunday, December 22, 2024

uncooked information – levelDB : How does the important thing/values pairs work for datadir/blocks/index/

I am making an attempt to know the format of key/worth pairs in LevelDB for Bitcoin information storage.

Given the next uncooked key and worth:

Uncooked Key: 6200005BD1B034B80F7C08EA312BBCDBCFDB647E366B85EC6B206F0D0000000000
Uncooked Worth: 8EA010848A2D1D04008FDAEC0A81FAC8420100000093FC79C5606493FC6051E334231BC7B6E765BAE097A5A6A82D960500000000006ED298FA7CCD23916490EDB1D8DADF981FFB6A6CF99B518677A30CBAE04767A1B118A94CA3B2311B110468F0

https://bitcoin.stackexchange.com/a/67569/157164
https://bitcoin.stackexchange.com/a/29418/157164

From my understanding primarily based on these two feedback, I anticipated the worth to include, on this order:

Block header
Block peak
Transaction depend
Validation standing
Information file
Information offset
Undo file
Undo offset

Nevertheless, it seems the block header is on the finish of the worth as a substitute of the start. After stripping the header bytes, I am left with: 8EA010848A2D1D04008FDAEC0A81FAC842

I anticipated to extract block peak, transaction depend, validation standing, and so forth., from this, however I am unable to appear to take action, whatever the endian format used.

May somebody make clear the proper construction of this worth? Are these parts encoded as Varint or CompactSize? Any perception can be enormously appreciated!

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles