Skip to content

Deprecate wallet-owned signing APIs#505

Draft
noahjoeris wants to merge 5 commits into
bitcoindevkit:masterfrom
noahjoeris:feat/sign-psbt-migration
Draft

Deprecate wallet-owned signing APIs#505
noahjoeris wants to merge 5 commits into
bitcoindevkit:masterfrom
noahjoeris:feat/sign-psbt-migration

Conversation

@noahjoeris

Copy link
Copy Markdown
Contributor

Description

Partially addresses #70

Deprecates wallet-owned signing APIs, migrating examples, tests, and documentation toward caller-owned keys using Wallet::sign_psbt and Wallet::sign_with_signers.

Depends on:

Notes to the reviewers

I intentionally migrated examples and docs to Wallet::sign_psbt (#438) instead of sign_with_signers as 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

  • Deprecated Wallet::{add_signer, set_keymap, set_keymaps, get_signers, sign}, CreateParams::keymap, and LoadParams::{keymap, extract_keys} in favor of caller-owned keys and Wallet::sign_psbt and Wallet::sign_with_signers.
  • Deprecated FullyNodedExport::export_wallet; use FullyNodedExport::export_wallet_with_keymaps to supply keymaps explicitly.

Before submitting

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

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.17%. Comparing base (58fe631) to head (769b782).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #505      +/-   ##
==========================================
+ Coverage   80.96%   81.17%   +0.21%     
==========================================
  Files          24       24              
  Lines        5489     5515      +26     
  Branches      247      247              
==========================================
+ Hits         4444     4477      +33     
+ Misses        968      958      -10     
- Partials       77       80       +3     
Flag Coverage Δ
rust 81.17% <100.00%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@noahjoeris noahjoeris changed the title refactor: deprecate wallet-owned signing APIs Deprecate wallet-owned signing APIs Jun 23, 2026
@oleonardolima oleonardolima added this to the Wallet 3.2.0 milestone Jun 23, 2026
@oleonardolima oleonardolima moved this to In Progress in BDK Wallet Jun 23, 2026
@noahjoeris noahjoeris force-pushed the feat/sign-psbt-migration branch from ece8f37 to 6927b3c Compare June 24, 2026 10:02
@noahjoeris noahjoeris force-pushed the feat/sign-psbt-migration branch from 6927b3c to 44a49b6 Compare June 25, 2026 11:11
@noahjoeris noahjoeris force-pushed the feat/sign-psbt-migration branch from 44a49b6 to 769b782 Compare June 25, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants