Deprecate wallet-owned signing APIs#505
Draft
noahjoeris wants to merge 5 commits into
Draft
Conversation
Add a thin wrapper method `sign_psbt` that delegates to `bitcoin::Psbt::sign`, passing the wallet's internal secp256k1 context. This allows users to sign PSBTs with their own `GetKey` implementor (e.g., `Xpriv` or hardware wallet adapters) without managing a separate secp256k1 context. docs(wallet): document Wallet::sign_psbt usage and requirement
Add tests covering signing with a matching and non-matching `Xpriv`. - `test_sign_psbt_with_xpriv`: verifies that a matching key signs at least one input - `test_sign_psbt_with_wrong_key_signs_nothing`: verifies that an unrelated key returns Ok but produces no signatures
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #505 +/- ##
==========================================
- Coverage 80.96% 80.32% -0.64%
==========================================
Files 24 24
Lines 5489 5515 +26
Branches 247 247
==========================================
- Hits 4444 4430 -14
- Misses 968 1006 +38
- Partials 77 79 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closed
8 tasks
ece8f37 to
6927b3c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Partially addresses #70
Deprecates wallet-owned signing APIs, migrating examples, tests, and documentation toward caller-owned keys using
Wallet::sign_psbtandWallet::sign_with_signers.Depends on:
Xprvwith key origin info rust-bitcoin/rust-miniscript#872derivation_pathfor keys with origin rust-bitcoin/rust-miniscript#867Notes to the reviewers
I intentionally migrated examples and docs to
Wallet::sign_psbt(#438) instead ofsign_with_signersas this is our long-term goal and possibly prevents users from needing to migrate twice.Please let me know if you agree to guide users directly toward signing via rust-bitcoin, or if you prefer to first migrate entirely to
sign_with_signers.Changelog notice
Wallet::{add_signer, set_keymap, set_keymaps, get_signers, sign},CreateParams::keymap, andLoadParams::{keymap, extract_keys}in favor of caller-owned keys andWallet::sign_psbtandWallet::sign_with_signers.FullyNodedExport::export_wallet; useFullyNodedExport::export_wallet_with_keymapsto supply keymaps explicitly.Before submitting