Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spending Policy Required: External error on tx builder finish #605

Closed
BitcoinZavior opened this issue Oct 10, 2024 · 2 comments
Closed

Spending Policy Required: External error on tx builder finish #605

BitcoinZavior opened this issue Oct 10, 2024 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@BitcoinZavior
Copy link
Contributor

BitcoinZavior commented Oct 10, 2024

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() in txBuilder to 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.

@BitcoinZavior BitcoinZavior added the bug Something isn't working label Oct 10, 2024
@BitcoinZavior
Copy link
Contributor Author

@afilini issue raised for LtbLightning/bdk-flutter#144

@reez
Copy link
Collaborator

reez commented Nov 22, 2024

Closing due to #629 being merged now-

@reez reez closed this as completed Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants