Crate bitcoin_explorer

source ·
Expand description

Introduction

This library is designed for efficient and massive deserialization of the binary Bitcoin Core block files.

It decodes all transactions, addresses, script types, connects outpoints of inputs to outputs, to figure out input addresses.

This library allows efficient and versatile reading of all bitcoin transaction records. This is good for analysis and research on bitcoin trading behaviour.

Example

use bitcoin_explorer::BitcoinDB;
use std::path::Path;

let path = Path::new("/Users/me/bitcoin");

// launch without reading txindex
let db = BitcoinDB::new(path, false).unwrap();

// launch attempting to read txindex
let db = BitcoinDB::new(path, true).unwrap();

Features

Feature ‘on-disk-utxo’ is enabled by default, which uses an on-disk cache to keep track of unspent transaction for iterator db.iter_connected_block.

To use in-memory UTXO cache for better performance, use default-features = false to Cargo.toml, which requires 32GB+ RAM.

Re-exports

Modules

  • This module defines the infrastructure for efficient iteration over blocks
  • This module defines how to parse binary data on disk to Block structs defined in proto.

Structs

  • A Bitcoin address.
  • This is the main struct of this crate!! Click and read the doc.
  • A Bitcoin block, which is a collection of transactions with an attached proof of work.
  • A bitcoin block hash.
  • A block header, which contains all the block’s information except the actual transactions
  • A Bitcoin script.
  • A Bitcoin transaction, which describes an authenticated movement of coins.
  • A bitcoin transaction hash/transaction ID.

Enums

  • The cryptocurrency to act on

Traits

  • Trait for objects that can be deserialized from hex strings
  • Trait for objects that can be serialized as hex strings

Functions