Skip to content

fix(signer): don't drop signers that share a root fingerprint - #639

Open
saket0187 wants to merge 1 commit into
bitcoindevkit:masterfrom
saket0187:fix-signers-shared-fingerprint
Open

saket0187 wants to merge 1 commit into
bitcoindevkit:masterfrom
saket0187:fix-signers-shared-fingerprint

Conversation

@saket0187

@saket0187 saket0187 commented Nov 8, 2026 •

Copy link
Copy Markdown

This handles a rare case where a descriptor holds two xprvs sharing a root fingerprint (e.g. a decaying multisig whose timelocked fallback uses a second key from the user's seed, since miniscript forbids repeating a key): SignersContainer::build kept one signer per root fingerprint, so one key was silently dropped, the wallet couldn't sign with it and as_key_map lost its secret.

Each (ordering, id) slot now keeps all its signers, so none is dropped, while find, add_external and remove return the same signer as before.

Changelog notice

- Fixed `SignersContainer::build` keeping only one signer when two descriptor keys share a root fingerprint, which left the wallet unable to sign with the dropped key and removed its secret from `as_key_map`.
- `SignersContainer::ids` can now return the same id more than once, and `add_external`/`remove` replace or remove all signers stored under an id and ordering, returning the last one.

Signed-off-by: saket0187 <72020337+saket0187@users.noreply.github.com>
@saket0187
saket0187 requested a review from a team as a code owner November 8, 2026 18:51
@github-project-automation github-project-automation Bot moved this to Triage in BDK Wallet Nov 8, 2026
@muawiya1

muawiya1 commented Nov 8, 2026

Copy link
Copy Markdown

Hi @saket0187, thanks for working on this! It would also be appreciated if you could GPG-sign your commits, as requested in the contribution guidelines. And also, If there’s a related issue, linking it in the description would also help reviewers follow the context. Thanks!

@saket0187

Copy link
Copy Markdown
Author

There's no existing open issue for this.

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

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants