-
Notifications
You must be signed in to change notification settings - Fork 66
Description
Describe the bug
Encountering a Spending policy required: External error when attempting to build a transaction using a multi-sig descriptor. Currently, bdk-ffi does not provide a policy_path() in txBuilder, which is necessary for specifying the correct policy path during transaction creation.
Proposed Solution:
- Expose
policies()from the wallet to retrieve available spending policies. - Add support for
policy_path()intxBuilderto allow specifying the correct policy path when building the transaction.
These changes will ensure that the correct branch of a script is selected when creating transactions, preventing ambiguity issues.
Use Case:
An example where the policy_path is needed is with the following descriptor:
wsh(thresh(2,pk(A),sj:and_v(v:pk(B),n:older(6)),snj:and_v(v:pk(C),after(630000)))),
which is derived from the miniscript policy:
thresh(2,pk(A),and(pk(B),older(6)),and(pk(C),after(630000))).
In this case, the script can be satisfied in multiple ways. Without specifying the policy_path, it becomes ambiguous which spending path should be used for the transaction, leading to the error.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status