Skip to content

feat: add spend_utxo to Psbt#798

Merged
reez merged 1 commit intobitcoindevkit:masterfrom
ItoroD:expose-psbt-spending-utxos
Jul 9, 2025
Merged

feat: add spend_utxo to Psbt#798
reez merged 1 commit intobitcoindevkit:masterfrom
ItoroD:expose-psbt-spending-utxos

Conversation

@ItoroD
Copy link
Copy Markdown
Collaborator

@ItoroD ItoroD commented Jul 4, 2025

Description

Exposing spend_utxo will be helpful when trying to validate signatures or sign transaction inputs. This will allows signers of a psbt to verify and confirm the amount being spent and ensure it is what they expect before they approve/sign the transaction.

Notes to the reviewers

spend_utxo returns a SignError as part of result in case of any errors. We do not have this error type so I skipped this. After testing we still get a fairly descriptive error message when an error occurs. At least for passing an out of bounds index.

Changelog notice

  • Check Psbt utxo at given index

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@ItoroD ItoroD force-pushed the expose-psbt-spending-utxos branch 2 times, most recently from 53c2777 to 98ef3b3 Compare July 4, 2025 13:40
@ItoroD ItoroD changed the title feat: add spending_utxos to Psbt feat: add spend_utxo to Psbt Jul 4, 2025
@ItoroD ItoroD requested a review from reez July 4, 2025 20:23
@ItoroD ItoroD force-pushed the expose-psbt-spending-utxos branch from 98ef3b3 to 8f2d882 Compare July 9, 2025 17:06
Comment thread bdk-ffi/src/bitcoin.rs Outdated
@ItoroD ItoroD force-pushed the expose-psbt-spending-utxos branch from 8f2d882 to f1f25d1 Compare July 9, 2025 17:30
@ItoroD ItoroD requested a review from thunderbiscuit as a code owner July 9, 2025 17:30
Copy link
Copy Markdown
Collaborator

@reez reez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f1f25d1

@ItoroD ItoroD force-pushed the expose-psbt-spending-utxos branch from f1f25d1 to 56dae5f Compare July 9, 2025 17:45
@reez
Copy link
Copy Markdown
Collaborator

reez commented Jul 9, 2025

just waiting for ci to finish (python tests have been stuck queued for a little while so far) before I merge

@reez reez merged commit 5168f34 into bitcoindevkit:master Jul 9, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants