Crate psbt

source · []
Expand description

PSBT bitcoin library, providing all PSBT functionality from bitcoin library, plus

  • constructor, supporting miniscript-based descriptors, input descriptors, all sighash types, spendings from P2C, S2C-tweaked inputs (construct);
  • advanced signer, supporting pre-segwit, bare and nested segwit v0, taproot key and path spendings, different forms of tweaks & commitments, all sighash types (sign);
  • commitment-related features: managing tapret-, P2C and S2C-related proprietary keys;
  • utility methods for fee computing, lexicographic reordering etc;
  • command-line utility for editing PSBT data (WIP).

Re-exports

pub use commit::P2cOutput;
pub use commit::PSBT_IN_P2C_TWEAK;
pub use commit::PSBT_OUT_TAPRET_HOST;
pub use commit::PSBT_OUT_TAPRET_PROOF;
pub use commit::PSBT_P2C_PREFIX;
pub use commit::PSBT_TAPRET_PREFIX;
pub use construct::Construct;

Modules

Managing commitment-related proprietary keys inside PSBT. Supports tapret, p2c and s2c commitments.

Functions, errors and traits specific for PSBT constructor role.

Lexicographic sorting functions.

Raw PSBT key-value pairs.

PSBT serialization.

Interfaces for signing PSBTs with key sign providers

Structs

A Signature hash type for the corresponding input. As of taproot upgrade, the signature hash type can be either EcdsaSighashType or SchnorrSighashType but it is not possible to know directly which signature hash type the user is dealing with. Therefore, the user is responsible for converting to/from PsbtSighashType from/to the desired signature hash type they need.

Enums

Errors that happens during deduction process

Ways that a Partially Signed Transaction might fail.

Errors happening during fee computation

Errors happening when PSBT or other resolver information does not match the structure of bitcoin transaction

Error happening during PSBT decoding from Base64 string

Version of the PSBT (V0 stands for BIP174-defined version; V2 - for BIP370).

Errors during Psbt construction from an unsigned transaction data (see Psbt::with).

Errors during Input construction from an unsigned transaction input (see Input::new).