You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GetKey for KeyMapWrapper misses account-xprv path #610
We have a number of examples and test in bdk-wallet that use;
let signer = KeyMapWrapper::from(keymap);
as the signer for a psbt.sign. In the case where you give a descriptor that has an account level xprv key, and its corresponding psbt, it seems the getkey implementation of KeyMapWrapper from mininscript derives the key at the wrong path. For example;
Given the above, with KeyMapWrapper getkey implementation of getkey, the psbt will get signed but when you try to finalize it will fail because the signature is wrong and not what was expected on verification.
I tried the bdk_tx signer with the same constants above and this worked successfully. The problem seems to be that getkey for keymapwrapper is unaware that we have already walked 86h/1h/0h according to the descriptor given and then adds the full path again to derive the key. So
86h/1h/0h/86h/1h/0h/0/0 ❌
instead of
86h/1h/0h/0/0 ✅
This is not exactly a bdk-wallet error but more of a miniscript one. This was pointed out in bdk-ffi by @j-kon on the psbt.sign PR instead of bindings exposing KeyMapWrapper, it might be better to expose bdk_tx::Signer and use that for all getkey operations. Lastly, I noticed rust-miniscript has made some changes to their getkey implementation in latest releases (maybe bdk-wallet needs to bump the version). What I have not tested is if that now handles for account-xprv descriptors.
3. Thanks for opening this issue, @ItoroD.
This matches what I found while reviewing the PSBT signing changes in bdk-ffi #1051.
I noticed that rust-miniscript already addressed the origin-path derivation issue in #872, with a backport to 12.x in #867.
It would be worth testing the same PSBT against that backport to confirm whether it resolves the problem before introducing another fix in bdk-wallet.
I’ll look into reproducing this and checking whether a dependency update is enough.
Oh ok! Seems the links you have added are not clickable.
Yes, I am also expecting just an update to right version to resolve this.
Activity
j-kon commentedon Oct 27, 2026
Thanks for opening this issue, @ItoroD.
This matches what I found while reviewing the PSBT signing changes in bdk-ffi #1051.
I noticed that rust-miniscript already addressed the origin-path derivation issue in #872, with a backport to 12.x in #867.
It would be worth testing the same PSBT against that backport to confirm whether it resolves the problem before introducing another fix in bdk-wallet.
I’ll look into reproducing this and checking whether a dependency update is enough.
ItoroD commentedon Oct 27, 2026
Oh ok! Seems the links you have added are not clickable.
Yes, I am also expecting just an update to right version to resolve this.
noahjoeris commentedon Oct 27, 2026
Yes we still wait for a release of it. I have a PR open for it here
https://git.rust-bitcoin.org/rust-bitcoin/rust-miniscript/pulls/1035
j-kon commentedon Oct 27, 2026
Thanks for the update, @ItoroD and @noahjoeris.
Good to see the fix is already included in the upcoming rust-miniscript 12.3.8 release.
I’ll test the account-level xprv case against the updated code to confirm signing and finalization work as expected.
Once verified and released, we should be able to resolve this with a dependency update in bdk-wallet.
Thanks for pointing me to rust-miniscript PR #1035
noahjoeris commentedon Oct 29, 2026
fix was released. I opened a PR
Merge bitcoindevkit#618: bump miniscript to 12.3.8
Test an account-only SoftwareSigner on the taproot psbt of bitcoindev…