7

Is the blocks and chainstate folder store the same blocks data ?

How can we read those data using code and display that on the web frontend like the blockchain explorer websites

Vojtěch Strnad
  • 5,623
  • 1
  • 8
  • 31
Pankaj Kumar
  • 375
  • 2
  • 11

2 Answers2

6

Is the blocks and chainstate folder store the same blocks data ?

No, the blocks directory contains the actual blocks. The chainstate directory contains the state as of the latest block (in simplified terms, it stores every spendable coin, who owns it, and how much it's worth).

How can we read those data using code and display that on the web frontend like the blockchain explorer websites

No, you need transaction and address indexes for that. Bitcoin Core is not designed to provide those.

Pieter Wuille
  • 98,249
  • 9
  • 183
  • 287
  • ===>No, you need transaction and address indexes for that. Bitcoin Core is not designed to provide those. *** how can we get transaction and address indexes from those 2 folders ? *** Is there is any python library that allow us to show that blocks data in meaning full ways e.g blockchain explorer ? – Pankaj Kumar Nov 01 '18 at 06:22
  • 1
    No, you need different software than Bitcoin Core. – Pieter Wuille Nov 01 '18 at 06:43
  • 1
    ok , then how the blockchain-explorer websites display blocks data ? – Pankaj Kumar Nov 01 '18 at 06:53
  • By using software they wrote themselves generally, to index the Bitcoin blockchain. – Pieter Wuille Nov 01 '18 at 06:54
  • https://github.com/bitpay/insight-api , this code from the bitpay explore all the blockchain transactions , I am searching for any other library in python that allow the same functionality – Pankaj Kumar Nov 01 '18 at 06:58
  • blk00000.dat , is this file represent single block with transactions ? – Pankaj Kumar Nov 01 '18 at 08:02
  • @Pieter Wuille - " (in simplified terms, it stores every spendable coin, who owns it, and how much it's worth)" Not sure about the "and how much it's worth" part. Are you sure about that? To my knowledge the bitcoin block-chain does not include any prices related to any existing currencies. Rather is will store the amount of bitcoin each public key is currently holding, but not the value in dollar or yen or any other currency. Would you care elaborating on your assumption please. – Fred Cailloux Sep 21 '20 at 16:38
  • 2
    By "how much it's worth" I of course meant the amount expressed in BTC (or really satoshi's), not what that value in any local fiat currency corresponds to. – Pieter Wuille Sep 21 '20 at 16:50
1

How can we read those data using code and display that on the web frontend like the blockchain explorer websites

I am searching for any other library in python that allow the same functionality

See if the STATUS, mentioned in the Analysis of the Bitcoin UTXO set 2018, would help?

"We have created STATUS (STatistical Analysis Tool for Utxo Set), an open source code tool that provides an easy way to access, decode, and analyze data from the Bitcoin’s UTXO set. STATUS is coded in Python 2"

ArtemGr
  • 111
  • 2