Crate bitcoinconsensus

Source
Expand description

This project builds the libbitcoinconsensus library from Bitcoin’s C++ sources using Cargo and provides Rust bindings to its API.

Quoting from bitcoin/doc/shared-libraries.md:

The purpose of this library is to make the verification functionality that is critical to Bitcoin’s consensus available to other applications, e.g. to language bindings.

And that is exactly what this library is, the Rust bindings to bitcoinconsensus.

Modules§

ffi

Structs§

Utxo
Mimics the Bitcoin Core UTXO typedef (bitcoinconsenus.h)

Enums§

Error
Errors returned by libbitcoinconsensus.

Constants§

VERIFY_ALL_PRE_TAPROOT
VERIFY_CHECKLOCKTIMEVERIFY
Enable CHECKLOCKTIMEVERIFY (BIP65).
VERIFY_CHECKSEQUENCEVERIFY
Enable CHECKSEQUENCEVERIFY (BIP112).
VERIFY_DERSIG
Enforce strict DER (BIP66) compliance.
VERIFY_NONE
Do not enable any verification.
VERIFY_NULLDUMMY
Enforce NULLDUMMY (BIP147).
VERIFY_P2SH
Evaluate P2SH (BIP16) subscripts.
VERIFY_TAPROOT
Enable TAPROOT (BIPs 341 & 342)
VERIFY_WITNESS
Enable WITNESS (BIP141).

Functions§

height_to_flags
Computes flags for soft fork activation heights on the Bitcoin network.
verify
Verifies a single spend (input) of a Bitcoin transaction.
verify_with_flags
Same as verify but with flags that turn past soft fork features on or off.
version
Returns libbitcoinconsensus version.