High Performance Blockchain Deserializer
Project description
bitcoin-explorer
bitcoin_explorer
is an efficient library for reading
bitcoin-core binary blockchain file as a database (utilising multi-threading).
This package is ported using pyO3 from rust library bitcoin-explorer
Installation
MacOS, Windows, and Linux wheels are provided.
Use pip install bitcoin-explorer
to install.
Documentation
This library has a Rust version, go to Rust Documentation
For python documentation, go to Documentation.
Compatibility Note
This package deals with the binary file of another software Bitcoin Core
.
It might not be compatible with older Bitcoin Core versions.
Currently, it is compatible with Bitcoin Core version
Bitcoin Core version v0.21.1.0-g194b9b8792d9b0798fdb570b79fa51f1d1f5ebaf Copyright (C) 2009-2020 The Bitcoin Core developers
.
Examples
It contains one class BitcoinDB
.
import bitcoin_explorer as bex
# parse the same path as `--datadir` argument for `bitcoind`.
db = bex.BitcoinDB("~/Bitcoin")
# get the length of the longest chain currently on disk.
db.get_block_count()
# get block of a certain height
db.get_block(1000)
# to retrieve the connected outputs of each inputs as well.
# note that this is inefficient.
# Use `get_block_iter_range(end, connected=True)` for better performance.
db.get_block(1000, connected=True)
# get block hash of a certain height.
db.get_hash_from_height(1000)
# a fast method for getting just the header.
# in memory query, no disk access
db.get_block_header(1000)
# get block of height 1000.
db.get_height_from_hash("some hash")
# get transaction from txid.
# This queries the `levelDB` each time, thus it is relatively slow.
db.get_transaction("some txid")
# get the height of the block which this transaction belongs.
db.get_height_from_txid("some txid")
# get the script type and addresses from a script public key
db.parse_script("some hex script pubic key")
# use iterator
for block in db.get_block_iter_range(start=1000, end=2000):
do_something_with(block)
# use iterator, iterate over heights
for block in db.get_block_iter_array(heights=[1, 3, 5, 7, 9]):
do_something_with(block)
# use iterator, connect outpoints
# This requires 5 GB memory.
for block in db.get_block_iter_range(end=700000, connected=True):
do_something_with(block)
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 Distributions
Built Distributions
Hashes for bitcoin_explorer-1.2.21-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 985d9a93d6fa9b6886872d55c30f1b5c981f46c6f336a8f625313fcd067811ee |
|
MD5 | 8558ddcb00eb23e0eccd0e4a33aba653 |
|
BLAKE2b-256 | dc2357039ae24ceb1c7c65bee019c5509ec68297ab1cff75e42b4123c5fc1fd7 |
Hashes for bitcoin_explorer-1.2.21-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dc39974c8dcee63850937b8485e4009455862ffc0d7e97c0720b20cde2ed3df |
|
MD5 | ae45e987ee11fb3505962388c02290cc |
|
BLAKE2b-256 | 559ea0c7328f5272265229088f662eb13c2ae9254316512f1f36d063a1a0c4c6 |
Hashes for bitcoin_explorer-1.2.21-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82f7ab0e0e3b9653b00512409f1ed33954e2a0ca9a2c9eb11d4fa3d681226864 |
|
MD5 | ee5a0e9d5d167bb4073a86a4ca5022c0 |
|
BLAKE2b-256 | 9e3bfc7787b3c0bb9e2dc810e538adfa01606240fd21b89b46df8e835a04cb14 |
Hashes for bitcoin_explorer-1.2.21-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6b5c7daa08ababb49b6803fc0ede90e652b80922811744347d38155fd016b96 |
|
MD5 | e6ca7762c684839d87d0f66f8792e048 |
|
BLAKE2b-256 | 242c0dd77a3842d915469e438a583a7c1d2974839c421c03b0942909b4142923 |
Hashes for bitcoin_explorer-1.2.21-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e71e3031e1eca4cc55f22987591ad8a9ba383def4e72fb5a4a97840e2b0c2329 |
|
MD5 | 91d767e92e5df0d10afa1a4db867a140 |
|
BLAKE2b-256 | 212ba08b9472f08713bfd3fa39a4d7982a04b425883da40aa11995d194e87d79 |
Hashes for bitcoin_explorer-1.2.21-cp311-cp311-macosx_10_14_x86_64.macosx_11_0_arm64.macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6192e866c30034199b367457dfa6b4285e30eeca6bedf64ecbc42cbf78ce7cf6 |
|
MD5 | 4c1b49811af115a9e0e4111c7a7611cc |
|
BLAKE2b-256 | b7b5ff4d52f637e1e092688acdc987032f334475963b9ce0b668aa0a7276bc67 |
Hashes for bitcoin_explorer-1.2.21-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b1bbe3854a04061a5e41e74d5327aa2532fe935df109b8adc4419c59f476590 |
|
MD5 | 95c55c17e877204619b8cc0dce8c6c0f |
|
BLAKE2b-256 | f767fb5f03f25cce3955d4b23f6328855e67df8155581131c37d187430832d61 |
Hashes for bitcoin_explorer-1.2.21-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbf0d6577353f7ae00f29e157c0e49ff815634f1208d39a9d336a8148bbb7398 |
|
MD5 | 78f19ee46644a2f5d03cf0566bc27807 |
|
BLAKE2b-256 | 94482878a51286c35e89b961014ced4094d76e2b79db84cb99b8ce5e67f11e81 |
Hashes for bitcoin_explorer-1.2.21-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e9f3342b54805b027bb115930ecff2169b76c3ea2852d692b7f98bfb8de247b |
|
MD5 | 39dd10add6ed6d52ae8bb2db784cdcd4 |
|
BLAKE2b-256 | 7cd40eadae36dbd154d721ed6d19fe7868694280cdfff919e734c6307694fd74 |
Hashes for bitcoin_explorer-1.2.21-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a95be9128eb5d84f65ea82d09755be0e77179160edc7b0b425a336709606ff8b |
|
MD5 | f3f4f33740fcaba309b0e6a269f4b930 |
|
BLAKE2b-256 | 78853c2ee67862dc6261b1fcca5327c7064d2fd5630313a39f3c8b70a32af66f |
Hashes for bitcoin_explorer-1.2.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 505d97dab3759291ac66a5aaa1a48f1b813a387440d48a6addbf98db10b3e933 |
|
MD5 | 1a28af23761d6458e1844070cfe6e746 |
|
BLAKE2b-256 | 9ce7b39b37a2db42693553bc742cfda767d3e66d10e3b900b110c59c3b0da738 |
Hashes for bitcoin_explorer-1.2.21-cp310-cp310-macosx_10_14_x86_64.macosx_11_0_arm64.macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13764eeefda09e016d82d5ea6a2fab374dfda509294e131f4e15666a0eeccf79 |
|
MD5 | 364f6701747bc05a470b8369d8f488b4 |
|
BLAKE2b-256 | 6fe5de81af418a9beba536e975ec79e78a92b59f015e6339fa60b28c6ca7ee64 |
Hashes for bitcoin_explorer-1.2.21-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dbafba0d9809e2642f126c3fe9633dcc7cdc35f556ccce3c96db8a26145a4e3 |
|
MD5 | 487949aa9346b34bb65faae39c906687 |
|
BLAKE2b-256 | ea31a4f26784d14df236689c03d630f9f59aff8820f28c32cd4e0f6020619ff7 |
Hashes for bitcoin_explorer-1.2.21-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f41d11866a111cafe92d379bf9d484a52fc938bb4d482f7e96b449ee55016b40 |
|
MD5 | 96d3bf1d69f23b9e3a907146373c1e0d |
|
BLAKE2b-256 | 36a0d4e2de1fe4cf4df16296891b3f1acaccce314f988fa66e0a86536c529ebd |
Hashes for bitcoin_explorer-1.2.21-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f40e3ecdd3cbc5965775f378c0569ce296a28b737ac45c18586755f909004a77 |
|
MD5 | f0b31b6f30abac4785ddd107e93e52f4 |
|
BLAKE2b-256 | a1078b2e842dfbd64a45771a28e3dfda8ffd823d0c87b9523030b3ede2e7c2f2 |
Hashes for bitcoin_explorer-1.2.21-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34f4c22e982f949aad6f0becf1bce2764770a2565488d286c9513302fad477ed |
|
MD5 | b1720a31e08e868940a2a8e2cd34e5c1 |
|
BLAKE2b-256 | 14f8a18d059d0ba44b2e20e70ea254accecdb03992b93c2e00663b607dc0df49 |
Hashes for bitcoin_explorer-1.2.21-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 510dbae736c515ba3ef8c11bdeb6b480bfd31812d1b36d02e8e9a6792e74f44b |
|
MD5 | 0a4c62a1d8bba28caed391977bd0dea1 |
|
BLAKE2b-256 | 0ba3a39f22c4f52df41f4a0d25b1c31fa3885d3af9940c061e20caeb28aa7997 |
Hashes for bitcoin_explorer-1.2.21-cp39-cp39-macosx_10_14_x86_64.macosx_11_0_arm64.macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85bf27112376398e1b875d98a06c8e0a966522c6cc8eb63e90066ee1a4f57256 |
|
MD5 | 3da284355ddea1139be6f85cda9dc451 |
|
BLAKE2b-256 | 96ca3ecd1ed07a7c873c6b06918cfad3a17d455f82c684958a722520ff586259 |
Hashes for bitcoin_explorer-1.2.21-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d37ea80656c735f2644db42a847c04b603a65678204000cce446d7ebe6cb853c |
|
MD5 | 502098bc9a4a9aca3d149e53f29a63e5 |
|
BLAKE2b-256 | 07bc0c751812b818713adc8e0166e5cbce76b3576713f019c036cc3d9bc0bf74 |
Hashes for bitcoin_explorer-1.2.21-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cc52d367eeed9f55391827e4f39772850ff9fee3f090cd69a87bd0ea4b6cfdb |
|
MD5 | 116de4bc920a720d2aa63f4503e32b99 |
|
BLAKE2b-256 | a91dc3d1f97a4eecc549fa15a7ba5451bfebbd72e1460226f06a9e071b460845 |
Hashes for bitcoin_explorer-1.2.21-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff08ac3255d71efeb35e606c8f85cfe7394509f17ac1f283714a43fdadce1d69 |
|
MD5 | ef766a9fd7f3d5f06c989e6c953d1fe5 |
|
BLAKE2b-256 | b6ac9d7d354148753f6b17f25063680e2cb318216ad444f4aba2f4ab74890fe6 |
Hashes for bitcoin_explorer-1.2.21-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1bd8dc46e3192cf8eb5d7fc468886e8ba497fcae8de81e0c9e6ba0d869d6716 |
|
MD5 | 955e41147a5df36313322f2045317cc4 |
|
BLAKE2b-256 | 93efa53e7e5bf8e47eb6ed279dc437a79eb05880519ff99a949a5158ea4c670d |
Hashes for bitcoin_explorer-1.2.21-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 269a379477eca85bf53b2b845d5e99051371de56d4a9e3a864754467de1d2c5d |
|
MD5 | 1159f2e7f77d76731af37e43f7aa351e |
|
BLAKE2b-256 | 8d77b23ff01115b5b3632144ffe693f468517c5b42e175afa95f35a9b5d13136 |
Hashes for bitcoin_explorer-1.2.21-cp38-cp38-macosx_10_14_x86_64.macosx_11_0_arm64.macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22f6e20fde9a10248a2ab3ae61151b8164d4d9927d4a203637d4ba8991e225d7 |
|
MD5 | 321fd0a2030e52105085f0e5370dd6e8 |
|
BLAKE2b-256 | e4fd2e4ee277f77745c714f803cb646df622d0e847c0fc1a14d43d95bdbee1ea |
Hashes for bitcoin_explorer-1.2.21-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f715aee1b7d0232d9aec72a6ac23ec16f0218000b36f91505d5b0197f8a5a4b7 |
|
MD5 | 074c1b5bad90ffe6066ef1149cd7f86c |
|
BLAKE2b-256 | 80de9e7f9696379a3a40515d4ba33d7b8fcbb4859d3ef94a7918589378a2a326 |
Hashes for bitcoin_explorer-1.2.21-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd88c3439d38e3a2275ab1a289526dd2f014114f9028b59e79cd483af17a970f |
|
MD5 | 940947bb26aa36d9c07fcf16c71f0782 |
|
BLAKE2b-256 | 469f2019d9de66dbe900d95707afd867b314911c01927bca7479a9587bb906c8 |
Hashes for bitcoin_explorer-1.2.21-cp37-cp37m-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d781e29ac9b8f9ad1e0d03faa5c3daa96da53cf64acc7765add718a43ae17add |
|
MD5 | 40f7e0b535bdbdfdfe1ff069569dc5f4 |
|
BLAKE2b-256 | 4f6f962f9c1bb0927cf04edbfe40ece29b5bc2815cc6b4b5875b9dfecd496aaa |
Hashes for bitcoin_explorer-1.2.21-cp37-cp37m-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74622a520b88dab4e8d55dbb6bd2883cecdcf04bd70deb2f55783af0973be16c |
|
MD5 | 36887950558711f044f008c43a4f3da5 |
|
BLAKE2b-256 | f18774d3823d7f6b150ca070f23e509d68a9213a53b370008709bb088de8dd65 |
Hashes for bitcoin_explorer-1.2.21-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac4192103ad0e0146d02ab91bc9a37566532bbb7e474594b25aeb85a9b288e74 |
|
MD5 | 8a995196e3381e2da7b67f57da8b3ed7 |
|
BLAKE2b-256 | 66e89fb29d78964f52e57309a1bcd9f313a5cf4e7133a166bed54031efc0c86e |
Hashes for bitcoin_explorer-1.2.21-cp37-cp37m-macosx_10_14_x86_64.macosx_11_0_arm64.macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 763dfc2821b4eec3b78a7df044355713148676ce7e6f9b2f01aa4ca2df357e2b |
|
MD5 | a399ac23a0adbb87c39a298e233f4ce3 |
|
BLAKE2b-256 | 2870e51fc3865ac78c248196e9a26b0249ad77d68020318dcc434a4b180e4579 |