Quickly retrieve and explore Bitcoin blocks
Project description
What is Chain Explore?
Chain explorer is an easy to use Python package that allows the exploration of the Bitcoin Blockchain. It retrieves data through the https://www.blockchain.com/explorer API. The focus of the functions is to decode data that was embedded in the blockchain. Examples of such data are the famous message from Satoshi Nakamoto in the Bitcoin Genesis block. The Bitcoin white paper. The Satoshi upload and download tool as code on the blockchain. Or image data stored on the blockchain via the Apertus tool.
How to install?
Install with pip:
pip install chainexplorer
Alternatively the package can be installed by cloning the repository as follows.
Clone the Git repository:
git clone https://github.com/akcarsten/chain_explorer
Then go to the folder to which you cloned the repository and run:
python setup.py install
Some Examples
Below some examples are listed that show how the Chain Explorer package can be used to explore the secrets of the Bitcoin blockchain.
Example 1: The secret message in the Genesis block
from chainexplorer import explorer as exp
# Download the Genesis block
raw_block = exp.get_by_block(0)
# Have a look at the Genesis information
exp.show_block_info(raw_block)
# The hidden information is in the input message
in_msg, out_msg = exp.collect_messages(raw_block)
# The input message needs to be decoded from hexadecimal to ASCII to be readable
decoded_msg = exp.decode_hex_message(in_msg)
print(decoded_msg)
b'\x04\xff\xff\x00\x1d\x01\x04EThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks'
Example 2: Download the Bitcoin white paper
from chainexplorer import explorer as exp
# Get the Bitcoin white paper from the blockchain
exp.download_data('54e48e5f5c656b26c3bca14a8c95aa583d07ebe84dde3b7dd4a78f4e4186e713', 'bitcoin.pdf')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file chainexplorer-0.0.2.tar.gz
.
File metadata
- Download URL: chainexplorer-0.0.2.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.8.3 requests/2.28.1 setuptools/63.1.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb4dc6efc954ee2d1352c1261b589f3a1aa7395ca1cac6aee60331a5e16ffee0 |
|
MD5 | 50678a54b6622ff8793742172903a7ec |
|
BLAKE2b-256 | ff6cbd6eda9cd011d43d8376ede98674153779f73ff03d5406ddc1b666c72516 |