Expand description
Primitives module defines core strict interfaces from informational LNPBP standards specifying secure and robust practices for function calls used in main bitcoin protocols:
- consensus-level primitives;
- deterministic bitcoin commitments;
- single-use-seals.
The goal of this module is to maximally reduce the probability of errors and mistakes within particular implementations of this paradigms by standardizing typical workflow processes in a form of interfaces that will be nearly impossible to use in the wrong form.
Re-exports
Modules
- Rust bindings for Pieter Wuille’s secp256k1 library, which is used for fast and accurate manipulation of ECDSA signatures on the secp256k1 curve. Such signatures are used extensively by the Bitcoin network and its derivatives.
- Strict types library generator methods.
Structs
- Inner type representing future (non-tapscript) leaf versions. See
LeafVer::Future
. - Internal taproot public key, which can be present only in key fragment inside taproot descriptors.
- invalid taproot leaf version {0}.
- invalid parity value {0} - must be 0 or 1
- Error constructing timelock from the provided value.
- Value for a transaction
nTimeLock
field which is guaranteed to represent a block height number which is always less than 500000000. - Value for a transaction
nTimeLock
field which is guaranteed to represent a UNIX timestamp which is always either 0 or a greater than or equal to 500000000. - the provided value {value} for {matter} is non-standard; while it is accepted by the bitcoin consensus rules, the software prohibits from using it.
- Output taproot key - an
InternalPk
tweaked with merkle root of the script tree - or its own hash. Used only inside addresses and raw taproot descriptors. - A variable-length unsigned integer.
- Witness program as defined in BIP141.
- Generic taproot x-only (BIP-340) public key - a wrapper around
XOnlyPublicKey
providing APIs compatible with the rest of the library. Should be used everywhere whenInternalPk
andOutputPk
do not apply: as an output of BIP32 key derivation functions, inside tapscripts/ leafscripts etc.
Enums
- The leaf version for tapleafs.
- Represents the parity passed between FFI function calls.
- An ECDSA signature-related error.
- Version of the witness program.
Constants
- The Threshold for deciding whether a lock time value is a height or a time (see Bitcoin Core).
- The SHA-256 midstate value for the TapSig hash.
- Taproot annex prefix.
- Tapleaf mask for getting the leaf version from first byte of control block.
- Tapscript leaf version.