Crate mhinprotocol

Crate mhinprotocol 

Source
Expand description

§mhinprotocol

A Rust implementation of the MY HASH IS NICE (MHIN) protocol — a system that rewards Bitcoin transactions with aesthetically pleasing transaction IDs (those starting with leading zeros).

§Overview

This library provides a database-agnostic and block parser-agnostic implementation of the MHIN protocol. It focuses purely on the protocol logic, allowing you to integrate it with any Bitcoin block source and any storage backend.

§Quick Start

use mhinprotocol::{MhinProtocol, MhinConfig, MhinStore};

let protocol = MhinProtocol::new(MhinConfig::default());

// Pre-process blocks (parallelizable)
let mhin_block = protocol.pre_process_block(&bitcoin_block);

// Process blocks sequentially
protocol.process_block(&mhin_block, &mut store);

Re-exports§

pub use config::MhinConfig;
pub use config::MhinNetwork;
pub use protocol::MhinProtocol;
pub use store::MhinStore;
pub use types::Amount;
pub use types::MhinInput;
pub use types::MhinOutput;
pub use types::MhinTransaction;
pub use types::PreProcessedMhinBlock;
pub use types::UtxoKey;

Modules§

config
Protocol configuration.
protocol
Core protocol implementation.
store
Storage trait abstraction.
types
Core types used by the protocol.