Module bdk::descriptor::policy [−][src]
Descriptor policy
This module implements the logic to extract and represent the spending policies of a descriptor in a more human-readable format.
This is an EXPERIMENTAL feature, API and other major changes are expected.
Example
let secp = Secp256k1::new(); let desc = "wsh(and_v(v:pk(cV3oCth6zxZ1UVsHLnGothsWNsaoxRhC6aeNi5VbSdFpwUkgkEci),or_d(pk(cVMTy7uebJgvFaSBwcgvwk8qn8xSLc97dKow4MBetjrrahZoimm2),older(12960))))"; let (extended_desc, key_map) = ExtendedDescriptor::parse_descriptor(&secp, desc)?; println!("{:?}", extended_desc); let signers = Arc::new(key_map.into()); let policy = extended_desc.extract_policy(&signers, &secp)?; 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 needs to be satisfied |
Type Definitions
ConditionMap | Type for a map of sets of |
FoldedConditionMap | Type for a map of folded sets of |