Crate bc

Source

Re-exports§

pub extern crate secp256k1;
pub use opcodes::OpCode;

Modules§

opcodes
stlstl

Structs§

Annex
The Annex struct enforces first byte to be 0x50.
Bip340Sig
BlockHash
BlockHeader
BlockMerkleRoot
ByteStr
CompressedPk
ControlBlock
FutureLeafVer
Inner type representing future (non-tapscript) leaf versions. See LeafVer::Future.
InternalKeypair
Internal taproot public key, which can be present only in key fragment inside taproot descriptors.
InternalPk
Internal taproot public key, which can be present only in key fragment inside taproot descriptors.
InvalidLeafVer
invalid taproot leaf version {0}.
InvalidParityValue
invalid parity value {0} - must be 0 or 1
InvalidTimelock
Error constructing timelock from the provided value.
LeafScript
LegacyPk
LegacySig
LockHeight
Value for a transaction nTimeLock field which is guaranteed to represent a block height number which is always less than 500000000.
LockTime
LockTimestamp
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.
NonStandardValue
the provided value {value} for {matter} is non-standard; while it is accepted by the bitcoin consensus rules, the software prohibits from using it.
Outpoint
OutputPk
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.
PrevoutMismatch
PubkeyHash
RedeemScript
Sats
ScriptBytes
ScriptCode
Type used for generating sighash in SegWit signing
ScriptHash
ScriptPubkey
SeqNo
SigScript
Sighash
SighashCache
Efficiently calculates signature hash message for legacy, segwit and taproot inputs.
SighashType
TapBranchHash
TapLeafHash
TapMerklePath
TapNodeHash
TapScript
TapSighash
Tx
TxIn
TxOut
TxVer
Txid
UncompressedPk
VBytes
VarInt
A variable-length unsigned integer.
Vout
WPubkeyHash
WScriptHash
WeightUnits
Witness
WitnessProgram
Witness program as defined in BIP141.
WitnessScript
Wtxid
XOnlyPk
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 when InternalPk and OutputPk do not apply: as an output of BIP32 key derivation functions, inside tapscripts/ leafscripts etc.

Enums§

AnnexError
BlockDataParseError
ConsensusDataError
ConsensusDecodeError
InvalidPubkey
LeafVer
The leaf version for tapleafs.
OutpointParseError
Parity
Represents the parity passed between FFI function calls.
PubkeyParseError
SegwitError
SigError
An ECDSA signature-related error.
SighashError
SighashFlag
TapCode
TimelockParseError
WitnessVer
Version of the witness program.

Constants§

LIB_NAME_BITCOIN
LOCKTIME_THRESHOLD
The Threshold for deciding whether a lock time value is a height or a time (see Bitcoin Core).
MIDSTATE_TAPSIGHASH
The SHA-256 midstate value for the TapSig hash.
SEQ_NO_CSV_DISABLE_MASK
SEQ_NO_CSV_TYPE_MASK
TAPROOT_ANNEX_PREFIX
Taproot annex prefix.
TAPROOT_LEAF_MASK
Tapleaf mask for getting the leaf version from first byte of control block.
TAPROOT_LEAF_TAPSCRIPT
Tapscript leaf version.

Traits§

ConsensusDecode
ConsensusEncode
IntoTapHash
LenVarInt
Weight

Type Aliases§

VarIntArray
Bitcoin consensus allows arrays which length is encoded as VarInt to grow up to 64-bit values. However, at the same time no consensus rule allows any block data structure to exceed 2^32 bytes (4GB), and any change to that rule will be a hardfork. So for practical reasons we are safe to restrict the maximum size here with just 32 bits.
VarIntBytes