[][src]Module bdk::descriptor::policy

Descriptor policy

This module implements the logic to extract and represent the spending policies of a descriptor in a more human-readable format.

Example

let desc = "wsh(and_v(v:pk(cV3oCth6zxZ1UVsHLnGothsWNsaoxRhC6aeNi5VbSdFpwUkgkEci),or_d(pk(cVMTy7uebJgvFaSBwcgvwk8qn8xSLc97dKow4MBetjrrahZoimm2),older(12960))))";

let (extended_desc, key_map) = ExtendedDescriptor::parse_secret(desc)?;
println!("{:?}", extended_desc);

let signers = Arc::new(key_map.into());
let policy = extended_desc.extract_policy(signers)?;
println!("policy: {}", serde_json::to_string(&policy)?);

Structs

Condition

An extra condition that must be satisfied but that is out of control of the user

PKOrF

Raw public key or extended key fingerprint

Policy

Descriptor spending policy

Enums

PolicyError

Errors that can happen while extracting and manipulating policies

Satisfaction

Represent if and how much a policy item is satisfied by the wallet's descriptor

SatisfiableItem

An item that need to be satisfied

Type Definitions

ConditionMap
FoldedConditionMap