Bitcoin Forum

Bitcoin => Project Development => Topic started by: threeip on July 25, 2013, 10:59:19 PM



Title: [wanted] blk001.dat -> 247898.csv (blockchain parsing)
Post by: threeip on July 25, 2013, 10:59:19 PM
I'm trying to shift data from blockchain .dat files into .csv files for each block 'number'.
Each output .csv needs to have txid, from, from_amount, to, to_amount, with matching addresses; ie a row for each 'relationship' in the transaction.

Code:
input1         output1
input2   ->     output2
input3         output3

becomes

Code:
input1,output1
input1,output2
input1,output3
input2,output1
...
etc


I messed around with subvertix and libbitcoin for a while but couldn't make it work. Has anyone made anything like this or could offer tips for tips?  :)


Title: Re: [wanted] blk001.dat -> 247898.csv (blockchain parsing)
Post by: bitspill on July 26, 2013, 09:58:04 AM
As a sample transaction you would want http://blockchain.info/tx/168755e1b3183434c46355a44b2e0acf39b21ccdd05c65f4cafc479158d6365c to end up in the .csv as follows?

Code:
txid,from,from_amount,to,to_amount

168755e1b3183434c46355a44b2e0acf39b21ccdd05c65f4cafc479158d6365c,1HaGsG2Fn6qWjpgSHCsbBVAL9jeBMbszGo,0.02,1Mk473HjqCLEbZnNLegS3z361jkzwttf7z,0.01

168755e1b3183434c46355a44b2e0acf39b21ccdd05c65f4cafc479158d6365c,1HaGsG2Fn6qWjpgSHCsbBVAL9jeBMbszGo,0.02,1KAsTH4s6iRqFVcVZ5WGtoiX1oLwmGaUhm,0.01

168755e1b3183434c46355a44b2e0acf39b21ccdd05c65f4cafc479158d6365c,1HaGsG2Fn6qWjpgSHCsbBVAL9jeBMbszGo,0.0001,1Mk473HjqCLEbZnNLegS3z361jkzwttf7z,0.01

168755e1b3183434c46355a44b2e0acf39b21ccdd05c65f4cafc479158d6365c,1HaGsG2Fn6qWjpgSHCsbBVAL9jeBMbszGo,0.0001,1KAsTH4s6iRqFVcVZ5WGtoiX1oLwmGaUhm,0.01


Title: Re: [wanted] blk001.dat -> 247898.csv (blockchain parsing)
Post by: threeip on July 26, 2013, 08:59:32 PM
Essentially that's it, yes!


Title: Re: [wanted] blk001.dat -> 247898.csv (blockchain parsing)
Post by: bitspill on July 27, 2013, 08:16:48 AM
Ok, I'll work at it for a bit and see if I get something together.


Title: Re: [wanted] blk001.dat -> 247898.csv (blockchain parsing)
Post by: bitspill on July 28, 2013, 06:08:43 AM
Well, I think I got something going... Will post archive files in chunks of 20k blocks.
The parsed files ended at block 147,056 though because the parser crashed  8)

Code:
000000.7z (2.0 MB)
https://mega.co.nz/#!bdJVSRRA!c_T5rGzZABdXusFaObiF9ix-MWhz92ycSHjfFCzDBGo

020000.7z (2.0 MB)
https://mega.co.nz/#!yFAj1bTB!KEbFcHzqODU34y6dnhjSti8HUzERSQGFc_GwVPbFsl0

040000.7z (2.5 MB)
https://mega.co.nz/#!WBRjQaxL!BbxM1nVq0Q37qC47p9IGGA5iImErxJVPptQpua3C8lg

060000.7z (4.1 MB)
https://mega.co.nz/#!LUZ2VT5a!RYEaxD5SIlLkLilYoFazx3b1GyI05Pnv6HG5RIVtPWQ

Slowly uploading the others...


Title: Re: [wanted] blk001.dat -> 247898.csv (blockchain parsing)
Post by: bitspill on July 28, 2013, 06:22:08 AM
Code:
100000.7z (17.8 MB)
https://mega.co.nz/#!OFYGkJ5S!KjdDSG0wjbWfT4iaiOaP6VjO2kR1Zrou36dUJ9Cn-EU

A note I just remembered... The amount values are in satoshis not BTC in these files


Title: Re: [wanted] blk001.dat -> 247898.csv (blockchain parsing)
Post by: bitspill on July 28, 2013, 12:37:46 PM
Code:
120000.7z (83.8 MB)
https://mega.co.nz/#!KVo1BCqB!JLqylTu8PT3-0KZoSuIWPnPxiXcqVjSF_SEFZFQFFH4

140000.7z (39.0 MB)
https://mega.co.nz/#!OZYzGLqZ!LdcYKAHR6050owHW1pmZ_EvIH6ASk4KcfUQ6bK_DRHY

That's all of them.
If there is something that seems funny about any of those files I can try adjusting the program and re-running.


Title: Re: [wanted] blk001.dat -> 247898.csv (blockchain parsing)
Post by: threeip on July 28, 2013, 07:57:50 PM
Nice work! PM me a link to some code if you like, and post an address here for a tip ;)


Title: Re: [wanted] blk001.dat -> 247898.csv (blockchain parsing)
Post by: bitspill on July 28, 2013, 08:05:09 PM
Nice work! PM me a link to some code if you like, and post an address here for a tip ;)
I'll upload a copy of the code after work tonight, it is C#


Title: Re: [wanted] blk001.dat -> 247898.csv (blockchain parsing)
Post by: bitspill on July 29, 2013, 04:38:46 AM
Code:
Bitcoin-Tool-master.7z (533 KB)
https://mega.co.nz/#!zYpnjJoY!cY0TszfdmmARRoY24VDb6EtSz6J7Ej9hZ6XUqavjofg


I was working with the C# Bitcoin Tool by mb300sd: https://bitcointalk.org/index.php?topic=148163.0
The program was added as a new "App" DatToCSV.cs

Address: 16DK3irVBR1Y1dejuWjbSwQmUptHWNieUr