Skip to content

Python to analyse bitcoin blockchain, chainstate, blockindex, mempool etc

License

Notifications You must be signed in to change notification settings

vizeet/bitcoin_core_python_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

bcd7695 · Jun 18, 2019

History

47 Commits
Aug 22, 2018
Aug 22, 2018
Apr 15, 2018
Apr 15, 2018
Jun 21, 2018
Jun 18, 2019
Jul 1, 2018
Jul 1, 2018
Jun 30, 2018
May 30, 2018
May 18, 2018
Aug 22, 2018
May 15, 2018
Apr 26, 2018
Jul 3, 2018
Aug 22, 2018
Jun 29, 2018
Aug 22, 2018
Jun 17, 2018
Aug 22, 2018
Jul 1, 2018
Jun 12, 2018
May 14, 2018
Jun 14, 2018
Jun 17, 2018
Jun 28, 2018
Jul 1, 2018
Jun 17, 2018
Aug 22, 2018
May 30, 2018
Jun 17, 2018
Apr 26, 2018
May 14, 2018
Apr 26, 2018
Apr 26, 2018

Repository files navigation

bitcoin_core_python_client

Contains many useful Programs to parse bitcoin blockchain

List of programs and their utility

  1. blockfile_parser.py : Bitcoin blockchain is stored by default under "~/.bitcoin/blocks". This program parses those blocks to print in json format content of those files.
  2. leveldb_parser.py: Bitcoin blockchain indexes are stored in leveldb databases. There are three databases i. Path ~/.bitcoin/blocks/index : Block index to determine last block and its predecessors in reverse order ii. Path ~/.bitcoin/chainstate : Metadata related unspent transaction outs iii. Path ~/.bitcoin/indexes/txindex : Provides offset and block number to reach each transaction
  3. traverse_block_indexes.py : This program utilises bitcoin block index database stored under "~/.bitcoin/blocks/index/" to reverse traverse blockchain.
  4. random_number_generator.py: This is random number generator which utilizes sound, webcam frames and system random utility to generate high entropy random number.
  5. script_parser.py : Parses Bitcoin's reverse polish script
  6. pubkey_address.py : Contains utility methods for private key, public key and address
  7. mnemonic_code.py : Mnemonic code is a secret consisting of 12/15/18/24 words. The program generates mnemonic code from random number.
  8. bitcoin_networkapis.py : Uses blockchain.info APIs to get some useful information
  9. bitcoin_localapis.py : Uses bitcoin client RPC calls to implement useful methods

List of Jupyter Notebook documents

  1. BlockFileParser.ipynb : Contains information on structure of blockfile, blocks and transactions
  2. BitcoinRPCUtils.ipynb : Contains many utility methods such as target threshold, current block size, actual block reward etc
  3. BitcoinEllipticCurveCryptography.ipynb : Detailed information on Bitcoin elliptic curve cryptography