Deprecate wallet-owned signing APIs - #505
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/3.x #505 +/- ##
===============================================
+ Coverage 81.77% 81.90% +0.12%
===============================================
Files 25 25
Lines 6487 6499 +12
Branches 296 296
===============================================
+ Hits 5305 5323 +18
+ Misses 1080 1071 -9
- Partials 102 105 +3
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:
|
44a49b6 to
769b782
Compare
769b782 to
8857be6
Compare
oleonardolima
left a comment
There was a problem hiding this comment.
overall it's looking good, it's best if you fix the first commit and let the last one just adding the deprecation notice. let's us know when it's ready for final review.
8857be6 to
c810938
Compare
|
Thanks for spotting this. It seems I added the change to the last commit and not the first, my bad. I cleaned up the commits. |
|
I still need to look into |
|
For One tricky part is A possible migration path is adding Downside: policy-path users get one more builder call, and |
|
Neither
|
|
No, passing empty signers won't work. It can create different A path built from |
|
So after some discussion with @thunderbiscuit and @notmandatory we concluded that we cannot remove the signers fields unless we update TxBuilder to accept a spending policy to be passed in. If we don't want to update it (from what I heard) then the wallet signer removal is coupled to the TxBuilder removal. And it might make sense to deprecate both at the same time once we integrated |
That sounds extreme. The whole policy path ceremony in |
c810938 to
9a9b2ca
Compare
Prefer bitcoin::Psbt::sign or Wallet::sign_with_signers in docs, examples, and tests instead of relying on wallet-owned signer state. Add FullyNodedExport::export_wallet_with_keymap for explicitly supplied private descriptor material, while keeping export_wallet public-only and independent of wallet-owned signer state.
Add TxBuilder::set_condition and wire create_tx to prefer an explicit Condition, falling back to policy-path derivation. Export Condition / Condition::merge. Migrate the compiler example off Wallet::policies.
Mark Wallet::sign, signer/keymap accessors, keymap load/create helpers, Wallet::policies, and TxBuilder::policy_path as deprecated. Replacement: keep KeyMaps/Xprivs outside Wallet; bitcoin::Psbt::sign or Wallet::sign_with_signers; extract_policy + Policy::get_condition + TxBuilder::set_condition for spending paths.
9a9b2ca to
469d16c
Compare
Description
Partially addresses #70
Deprecates wallet-owned signing APIs, migrating examples, tests, and documentation toward caller-owned keys using
bitcoin::Psbt::signandWallet::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
bitcoin::Psbt::signwhere possible. And usedWallet::sign_with_signersif we need SignOptions.Changelog notice
Wallet::{add_signer, set_keymap, set_keymaps, get_signers, sign, policies},CreateParams::keymap, andLoadParams::{keymap, extract_keys}in favor of caller-owned keys andbitcoin::Psbt::signandWallet::sign_with_signers.FullyNodedExport::export_wallet; useFullyNodedExport::export_wallet_with_keymapsto supply keymaps explicitly.TxBuilder::set_conditionas replacement forTxBuilder::policy_path.Before submitting