Skip to content

Conversation

@GideonBature
Copy link
Contributor

@GideonBature GideonBature commented Oct 28, 2025

Description

This PR adds a new helper method get_keymap() to the Wallet struct that returns a combined KeyMap containing all signing keys from both external and internal (change) signers.

Notes to the reviewers

Changelog notice

Added Wallet::get_keymap() helper method to retrieve a combined KeyMap from all wallet signers for convenient PSBT signing

Checklists

All Submissions:

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

Closes #331

@coveralls
Copy link

Pull Request Test Coverage Report for Build 18873961904

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 25 of 25 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 85.04%

Totals Coverage Status
Change from base Build 18850737341: 0.05%
Covered Lines: 7026
Relevant Lines: 8262

💛 - Coveralls

@thunderbiscuit
Copy link
Member

thunderbiscuit commented Nov 4, 2025

If I understand correctly, this method relies on the wallet having access to the private keys in order to produce this map, but the new 3.0 wallet will not have access to those, so the method is not really useful for 3.0 users, nor as an example for how to perform signing when a wallet doesn't have private descriptors.

@notmandatory
Copy link
Member

@GideonBature your approach isn't quite what we're looking for. Can you try updating this PR or creating a new one based on @ValuedMammal's recent comment on #331? see: #331 (comment)

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

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

feat(bdk_wallet): add helper method to get the KeyMap for Psbt.sign

5 participants