Struct revault_tx::scripts::DerivedCpfpDescriptor[][src]

pub struct DerivedCpfpDescriptor(_);
Expand description

A concrete (with raw public keys) CPFP miniscript descriptor.

Implementations

Get all the keys and key source used in this derived descriptor

Get the miniscript descriptor for the Unvault transaction CPFP output.

It’s a basic 1-of-N between the fund managers.

Examples
use revault_tx::{scripts, miniscript::{bitcoin::{self, secp256k1, util::bip32}, DescriptorTrait}};
use std::str::FromStr;

let first_manager = scripts::DerivedPublicKey::from_str("[0f0f0f0f/21]02a17786aca5ea2118e9209702454ab432d5b2c656f8ae19447d4ff3e7317d3b41").unwrap();
let second_manager = scripts::DerivedPublicKey::from_str("[0f0f0f0f/21]036edaec85bb1eee1a19ca9f9fd5620134ec98bc21cc14c4e8e3d0f8f121e1b6d1").unwrap();

let cpfp_descriptor =
    scripts::DerivedCpfpDescriptor::new(vec![first_manager, second_manager]).expect("Compiling descriptor");
println!("Concrete CPFP descriptor: {}", cpfp_descriptor);

let desc_str = cpfp_descriptor.to_string();
assert_eq!(cpfp_descriptor, scripts::DerivedCpfpDescriptor::from_str(&desc_str).unwrap());
Errors
  • If you attempt to create a DerivedCpfpDescriptor with more than 20 managers.
  • If the policy compilation to miniscript failed, which should not happen (tm) and would be a bug.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.