2

What I want to do:

  1. Download the copy of bitcoin blockchain
  2. Select from it all those addresses that have bitcoins (> 0.05 BTC) and they have not been active for > 7 days
  3. Display statistics on the site in the form of a graph and with the ability to view all addresses, repeating the search every 7 days and updating the statistics

What? I do not understand:

  1. I can download the copy of blockchain via bitcoind, but how do I interact with it? How to carry out analysis? Are there any ready-made utilities for this?
  2. How much time and resources will it take?

1 Answer 1

5

I can download the copy of blockchain via bitcoind, but how do I interact with it? How to carry out analysis? Are there any ready-made utilities for this?

You can either use an existing blockchain parser or write your own software to read the blkXXXXX.dat files (in %APPDATA%\Bitcoin\blocks if using Windows)

I used the protocol documentation to write my own parser in Go.

C> blockchain -file %APPDATA%\Bitcoin\blocks\blk02360.dat -longstats -block 115 -tx 2467

Transaction Details in Hex (Decimal/Symbolic):
  Version:................01000000 (1)
  Inputs:.................01 (1)
  Input:1
    Previous Transaction:.35A0AF1A2A97890EEE5FC3D614036ACF10C304D8C2E9B852626E8EA0E7063EA3
    Previous Output Index:0001 (1)
    Script Length:........6A (106)
    Script:...............47304402206EED6418DDDCEB242F5A9E33F74CBC71EC92916B55E95409D7DD2F
                          F05857CA6F02204DB6B0B24EAF200C32B18B19F31ADDF07CFF7FFF5BDE356871
                          D845C110F31EDA0121023A8F1E4FD676A7BD7366E5D232358E92838609875FAC
                          802E604BCEBE1C077CED
    Sequence:.............FFFFFFFF
  Outputs:................02 (2)
  Output 1
    Value:................9714000000000000 (5271)
    Script Length:........19 (25)
    Script:...............76A91412FB816154B441CD9C31B9D2BEA8DB8E6B77D02288AC
  Output 2
    Value:................228A000000000000 (35362)
    Script Length:........17 (23)
    Script:...............A914715CD328A4FFBC4A9099D406BE49181A61FEF37E87
  LockTime:...............00000000 (0)


Statistics for blk02360.dat (2020-12-12 to 2020-12-14)

   115 blocks
215639 transactions (1875.1 per block)
100901 Segwit tx    (46.8%)
644756 inputs       (mean 3.0, max 1100 per transaction)
604246 outputs      (mean 2.8, max 3451 per transaction)

Processed file in 313.6292ms

How much time and resources will it take?

Downloading the blockchain data will take hours or weeks depending mostly on the speed of your storage device - in my experience. I suspect using an SSD instead of a HDD will make a huge difference.

Time to process one blockfile depends on the software used but my simple example shows a typical 128MB blkXXXXX.dat file can be parsed in a third of a second on very modest hardware.

You will have to process several thousand of these.

Time to write a parser will probably be days or weeks depending on your experience and on the complexity of the analysis you want to carry out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.