Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Tony642 on February 06, 2019, 01:04:12 AM



Title: Sincerely/Urgently need your help: How to use Bitcoin Parser?
Post by: Tony642 on February 06, 2019, 01:04:12 AM
I'm a freshman of bitcoin system and I'm trying to find out how to use bitcoin parser. I downloaded several from internet but they were not work out. Currently I am using Bitcoin Knots wallet and downloaded all blockchains (approx.223GB). I know those data are preserved in the file names blockchain and they are in the form like blk0xxxx.dat. But how to parse those files? I really want to know the answer! ???


Title: Re: Sincerely/Urgently need your help: How to use Bitcoin Parser?
Post by: nc50lc on February 06, 2019, 06:17:14 AM
What is your goal on checking the contents of the blocks?

There are couple of sites with already parsed data:
If it was the ASCII texts embedded in the blockchain, all of them were already parsed here: https://bitcoinstrings.com/ (https://bitcoinstrings.com/)
If it was the block headers and/or transaction data (in hex or readable format), you can check them out here: https://webbtc.com/ (https://webbtc.com/) <- however, the site isn't updated to the latest height (till 443888 only) but can be converted to HEX: ex. https://webbtc.com/block/0000000000000000000cdc0d2a9b33c2d4b34b4d4fa8920f074338d0dc1164dc.hex (https://webbtc.com/block/0000000000000000000cdc0d2a9b33c2d4b34b4d4fa8920f074338d0dc1164dc.hex)

I downloaded several from internet but they were not work out.
Most of those parser won't work with blocks from 477,120 (inaccurate, somewhere around blk00950.dat) to the latest.
Those are the blocks containing SegWit data.


Title: Re: Sincerely/Urgently need your help: How to use Bitcoin Parser?
Post by: ABCbits on February 06, 2019, 06:49:23 PM
Which tools you used? If those tools are updated before August 2018, most likely it doesn't work because they don't support parse block/transaction contain/use SegWit.

Have you tried https://github.com/alecalve/python-bitcoin-blockchain-parser (https://github.com/alecalve/python-bitcoin-blockchain-parser), https://github.com/chainside/btcpy (https://github.com/chainside/btcpy) or https://github.com/bitcoinjs/fast-dat-parser (https://github.com/bitcoinjs/fast-dat-parser)? all of them are updated after August 2018 and 2 of them claim to support SegWit

? I never use it, but it already support block/transaction contain/use SegWit.

But how to parse those files? I really want to know the answer! ???

Aside from using tools/library, your only choice is learn about LevelDB (where as Bitcoin Core have it's own fork/version of LevelDB) and find out how Bitcoin Core use LevelDB then write your own tool/library