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.20-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0141ce647b7f9c6fde043c3cb9551c8d3c4b997a0ccbf981513bd1d2ad18b7c |
|
MD5 | b8d07cddacbbca8728178582890247ad |
|
BLAKE2b-256 | 83f4644d24a547ed500dd3d08c4766eb24e9aa54f9f01abe09084ab9e8b355b6 |
Hashes for bitcoin_explorer-1.2.20-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e328644e3064d049e0d79005454e5929200fcc6e1d284fc2cb97586b6d073e7a |
|
MD5 | f1b4eaffb6d88cb68c956989d310b4a3 |
|
BLAKE2b-256 | 2b713bca7679cf8e04a06b528f612b41d16153ff4996d3ec7d43393ef67caef7 |
Hashes for bitcoin_explorer-1.2.20-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b2a4a28a195ee318079a2b5887934f793b35c17dbabfd520fcec0c08b4cee0d |
|
MD5 | 5ac92157b31dd905f36858fe4b3c6c91 |
|
BLAKE2b-256 | ec4bfca9d434e6f98c536b434693cad0369a7879d60974e00561252027e317cd |
Hashes for bitcoin_explorer-1.2.20-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 101215f755a08a36f8f9f6081f371ca489ddfa3a5c4fcfdbec240d64c3045df3 |
|
MD5 | d27ae2143f627cb1c0965f5333d6647c |
|
BLAKE2b-256 | 333e65c946798f7c2be3bc87eb5d28e7b255ec6c6c5bf3a836fa8af8a52466e8 |
Hashes for bitcoin_explorer-1.2.20-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27be452268fb4f5bddca31c2ea9faf662c36975151bc9ae63de951fb374904b3 |
|
MD5 | 02258961c395ae32ae0807194600d8ab |
|
BLAKE2b-256 | 65c7f558d278f0328b718ec98a908d5f5fe1a939c0b7dde59950e199d2e32e56 |
Hashes for bitcoin_explorer-1.2.20-cp311-cp311-macosx_10_14_x86_64.macosx_11_0_arm64.macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b9726ffb4382f1ed342893a28737bb9abe16499dc814ca605b1269c54ae2b3b |
|
MD5 | d0547484d9f82c63be2119e03e903307 |
|
BLAKE2b-256 | 796158b5265d3fdb5ad83bd5acc8468f88181600e563610f8e1a332c1a4c1862 |
Hashes for bitcoin_explorer-1.2.20-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4875bb573fc7ff8d8e95e709cbf3ac5e53b5dba063b9c747f8242f6da3d836d |
|
MD5 | 2d77357dac15e37d44b6c9169daf43aa |
|
BLAKE2b-256 | e80589396936b591d7fbf8675ca2b212d22ae2ab79e0160a98766874332b2cc3 |
Hashes for bitcoin_explorer-1.2.20-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 593704b6c4d9dfce4adff981dea30a4008084dd57f600b839bed36042b13ef34 |
|
MD5 | 4aef48d521c182cc9617ffaa390a84ae |
|
BLAKE2b-256 | 1a776166f0942abf72fac9e508b4fbdfc8a3a7a50be77d62d3132191be6195d0 |
Hashes for bitcoin_explorer-1.2.20-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e91614b33db7aa4f760515f1b80f69a252429425c2ea6d9adc1bd5deb527dfa2 |
|
MD5 | ac7002e492545f9936cf399dc1e974a1 |
|
BLAKE2b-256 | fb3ebc12b1fe481ba44f961620d04a957c0f9b3a66bcccc4cbb1fdb414e6a12a |
Hashes for bitcoin_explorer-1.2.20-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 814876017727913d9195ccde973a0a4de8d845030419c4b9da529195b2d873ca |
|
MD5 | c9151fa8d5bb2be17f3df9d372c4f6b8 |
|
BLAKE2b-256 | 1b4e2bbb79ec5db9d3ca7bf4040c8933f79dea229f11988453fbc06e3a844cbd |
Hashes for bitcoin_explorer-1.2.20-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb7f83d0e6eff5431f785363fd7c4a8aa42bbeda3f4fc69a4d10af4d7789ffea |
|
MD5 | 0f10e6708b21edcdd5493b3e1976a54f |
|
BLAKE2b-256 | ca0e95321d141901e291f1b0dd7d138d133bc9266e32fe4a1e39db544b51ef11 |
Hashes for bitcoin_explorer-1.2.20-cp310-cp310-macosx_10_14_x86_64.macosx_11_0_arm64.macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 108b1a82320303bb072f4d08a2f7af232f0b3f3e1077dd49dfbf4bf8258756a9 |
|
MD5 | 575476352757513396cc03e2cd133ff3 |
|
BLAKE2b-256 | 46af01f33e8c0e8b00e07dd1f576131e7982158644de89f5c6352d3cd2332de1 |
Hashes for bitcoin_explorer-1.2.20-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 677d70c52863c6a7c574ad1ef197e9568095247606cdaf03e42ad6186a736956 |
|
MD5 | 23193023800f1ce86e92a83c7a832adf |
|
BLAKE2b-256 | 6069156f6b3db5288de3508cab1fa5f28da026d0804ff589e640ebdd4d3c3e1e |
Hashes for bitcoin_explorer-1.2.20-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9b19237207b2dcac7132663534879498036a19a4d6b5894141b03624223bdaa |
|
MD5 | a0aa75fd1ba2863bffdd71136e5a030b |
|
BLAKE2b-256 | f94d7304e841ce97f3e87257828db2b3e95d31efe25c14b94e79a5028fab2146 |
Hashes for bitcoin_explorer-1.2.20-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bfd5bdaeb12828587fd43396fc954038cba93b125337b66171fd466254ce72a |
|
MD5 | 475f82daeb7b9322f88979a1a66071f7 |
|
BLAKE2b-256 | 66379be0d7b47e874788e48bb4d9761cc94161a0e390ce957a4404eded7ae6f4 |
Hashes for bitcoin_explorer-1.2.20-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15004eb1bce678096a1e02912125d14f9bd444db91eeca5ac9b4de621aacf59a |
|
MD5 | 201d183bab14e89548aa6743f957e320 |
|
BLAKE2b-256 | 04803f9faa0edf96249cdaac0c9426ee4bfafc24dee9992b2cf5049f361fc25c |
Hashes for bitcoin_explorer-1.2.20-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ed81ce2cb31b42ec5bca713911f2a9f49ad916351b9d3ee8bc523d074be2c67 |
|
MD5 | 3021a686e3625da18b9da063d122121b |
|
BLAKE2b-256 | d14a7725f0859d0851706ae49cef16753cba6bbaaceda6359d7d028c96a7aaed |
Hashes for bitcoin_explorer-1.2.20-cp39-cp39-macosx_10_14_x86_64.macosx_11_0_arm64.macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 812c5237b69677a97116f8a2a84451b06d7f514d7873a75f4ecc996b5e46e6f3 |
|
MD5 | 6cbafa5c2a436e4423101a9fb333e4e7 |
|
BLAKE2b-256 | a2296fd9120274ff2e75cda91ed63938614a0085e2e8261a9e0b1c0a2a4af9aa |
Hashes for bitcoin_explorer-1.2.20-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11e6235a6ce2d372eb0b669563d6accc2041f36677c2b051ec202161a03b6c2e |
|
MD5 | 661811860e4ca3eb6a3f4a3c712c301f |
|
BLAKE2b-256 | fe3173904ca1b54d69c2fdb7c8d046543b2893e5cb7ee954d00ef356d0ab9009 |
Hashes for bitcoin_explorer-1.2.20-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36786911a7eae76f3021a39b11a0b6842ecda27de2b0dc2b769198042cf4a8d3 |
|
MD5 | a48f59c17f9cbf7241a0f03238fb104a |
|
BLAKE2b-256 | 546ab79607f667163627e5cf9b63b356348514b53bd9d9a392b6cc443ab3ae45 |
Hashes for bitcoin_explorer-1.2.20-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 831d0c9bf0462956749edcd93211db65cf0131d8e89a56a1618b35bab294cc31 |
|
MD5 | 6bda6a82d60ca5ded14d751edfe4fdbc |
|
BLAKE2b-256 | 98b39d220e28d2af28e9ad2a2056529b979f67669fad878c5aa144813d8440d4 |
Hashes for bitcoin_explorer-1.2.20-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f53a0d4844571bdcacf25118e542118f2e83f854f3230631c9f531b449ff8c57 |
|
MD5 | 7494bd6ec1516dab4741548ec68e1ef1 |
|
BLAKE2b-256 | 2ba25864a7d13a8ca62257cc1efcfc782a46d3d4ecbdbf052ffc76085eb5a491 |
Hashes for bitcoin_explorer-1.2.20-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e75b694c38cd3b178d745e725c196aff26fa8bfa48074c15f5a712f42cb9ce62 |
|
MD5 | a609c2994d6834da69f2e7ea7923f7cf |
|
BLAKE2b-256 | 74dab771f4fbbc5d571e984dc25eaebb781ea590d82aa56a007376d228fbc3de |
Hashes for bitcoin_explorer-1.2.20-cp38-cp38-macosx_10_14_x86_64.macosx_11_0_arm64.macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdbc59651ee78110fb7fab1c30769558f588e5adeaccda3d943414d362aaf0bf |
|
MD5 | ace8dca1490005009765b00060bbb590 |
|
BLAKE2b-256 | df0f9ee88c4a3cad4eaf4098acbf4182f90c928461c5d2ee8635715e942caa5c |
Hashes for bitcoin_explorer-1.2.20-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44c7daadef73c9fd4ef546fd2de0f6f9b0be3ca8765730f0f6eaad3b38e3595a |
|
MD5 | 49c4a33e0c64455802f8ccd87a91fd66 |
|
BLAKE2b-256 | ddea63b496a9c83c7fb4d9a05c04fa3ff24bf1f2869fd24b1a062e9ed7bb8d19 |
Hashes for bitcoin_explorer-1.2.20-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c589bb00ebc722de7489827c712394c9d1698a1bf8cc1bc57f76af27fa423e8d |
|
MD5 | 29eb3f5e1a536ba4fa7d2f5da5427e0f |
|
BLAKE2b-256 | 7be2cb9003d944220a5dccbfe5a1204c4059fc5821572caed4da6b4d3da8ad93 |
Hashes for bitcoin_explorer-1.2.20-cp37-cp37m-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c0e7267b256e4b070f69a531433c95524abf2ddf4b2d3555fdbfe804f218ab5 |
|
MD5 | d2273050cdf0e8f73378991b5e2813c3 |
|
BLAKE2b-256 | 4fbf05955cf8cf5992815c93618d2db172bd83574a4450626f0834dcf9ac7828 |
Hashes for bitcoin_explorer-1.2.20-cp37-cp37m-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70a690eb1c7a3929eb35f9c86068ab9cd396c99137d5855c0b872240f4d5f2b4 |
|
MD5 | 18a0d4cd431ddcf56a664ce5e4f02f78 |
|
BLAKE2b-256 | b10ce1d668d2c2d14eeab420f262b3a4cc77ade2164a7a9f5b413d55a4b58839 |
Hashes for bitcoin_explorer-1.2.20-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4a661a288167789a13fe854b4b6867e4592f3bf2d62d73d67aca16b4073668a |
|
MD5 | 23e840decbe4c69c68c6061b013bb65b |
|
BLAKE2b-256 | eabd23c4e43484558a1c699ef7f4ed1c682a1c1aad58bd696f027c59db19024e |
Hashes for bitcoin_explorer-1.2.20-cp37-cp37m-macosx_10_14_x86_64.macosx_11_0_arm64.macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66a40f6a3ac4c5abbb9a8d3cf001760f6f3af777eb1a172a19518be1f0023c8f |
|
MD5 | f5da84d60648c4d82b246701fa63a388 |
|
BLAKE2b-256 | aeaa87747df59fad47c7d8cc687addfe7753576fbe3836b447883f8d7139038e |