Skip to content

feat: Add sign method for psbt - #1051

Open
ItoroD wants to merge 1 commit into
bitcoindevkit:masterfrom
ItoroD:keymap-psbt-sign-vec
Open

ItoroD wants to merge 1 commit into
bitcoindevkit:masterfrom
ItoroD:keymap-psbt-sign-vec

Conversation

@ItoroD

@ItoroD ItoroD commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Description

Addresses #866

Notes to the reviewers

See comment - #866 (comment)

Documentation

Changelog

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing
  • I've added exactly one changelog:* label
  • I've linked the relevant upstream docs or specs above

New Features:

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

@Test
fun createExtendedWPKHDescriptors() {
Descriptor("wpkh($TEST_EXTENDED_PRIVKEY/$BIP84_TEST_RECEIVE_PATH/*)", NetworkKind.TEST)
val dec = Descriptor("wpkh($TEST_EXTENDED_PRIVKEY/$BIP84_TEST_RECEIVE_PATH/*)", NetworkKind.TEST)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This file should be removed.

@ItoroD
ItoroD force-pushed the keymap-psbt-sign-vec branch from b9ef430 to 29cd018 Compare August 10, 2026 15:27
@ItoroD

ItoroD commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

Just did a rebase on this one and I see errors. Because I am changing the structure of keymap in this PR any other PR that makes use of keymap will cause this PR to fail after rebase. I will fix this and alert you when its done.

But we might want to consider reviewing this and merging this soon, to reduce the number of iterations. Or I fix it when we are almost ready for it.

@reez

reez commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Just did a rebase on this one and I see errors. Because I am changing the structure of keymap in this PR any other PR that makes use of keymap will cause this PR to fail after rebase. I will fix this and alert you when its done.

But we might want to consider reviewing this and merging this soon, to reduce the number of iterations. Or I fix it when we are almost ready for it.

yeah feel free to just ping me here when it gets un-drafted so I can try to review it

@ItoroD
ItoroD force-pushed the keymap-psbt-sign-vec branch from 29cd018 to 841c17d Compare August 11, 2026 15:58
@ItoroD
ItoroD marked this pull request as ready for review August 11, 2026 16:22
@ItoroD
ItoroD requested a review from thunderbiscuit as a code owner August 11, 2026 16:22
@reez

reez commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Shaping up nice, a couple questions:
-Psbt::sign currently discards rust-bitcoin’s signing result and always returns Ok, is that intended?
-Should we keep KeyMap opaque and construct miniscript’s KeyMapWrapper internally so consumers get the direct psbt.sign(keyMap) workflow discussed in 866?

@ItoroD

ItoroD commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

-Should we keep KeyMap opaque and construct miniscript’s KeyMapWrapper internally so consumers get the direct psbt.sign(keyMap) workflow discussed in 866?

Yes, I agree. Theres nothing else users are using the wrapper for. I will update to reflect this.

Psbt::sign currently discards rust-bitcoin’s signing result and always returns Ok, is that intended?

No, that was not intended. At the very least error should be return if error (I guess I got too excited once i saw sign worked 😂). But I did intentionally discard the rust-bitcoins result. Just like keymapwrapper, do our users have use for SigningKeysMap (rust-bitcoin’s signing result) I was not sure.

@ItoroD
ItoroD force-pushed the keymap-psbt-sign-vec branch 2 times, most recently from a5f4516 to c407880 Compare August 20, 2026 04:50
@ItoroD
ItoroD force-pushed the keymap-psbt-sign-vec branch from c407880 to ef814ee Compare August 24, 2026 18:03
@ItoroD

ItoroD commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator Author

Updated error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants