bitcoindevkit / bitcoindevkit/bdk_wallet
Do not include satisfaction in policy id calculation
- Dominant language
- Rust
- Stars
- 59
- Forks
- 105
- Avg merge
- 10d 9h
- Merged PRs (30d)
- 1
Description
Currently every node in the `Policy` tree has an id which is calculated as a checksum on the string of the json-serialized object:
https://github.com/bitcoindevkit/bdk/blob/d6a0cf0795d9f8a1550e614e96b339a18fc537dc/crates/bdk/src/descriptor/policy.rs#L174-L178
The object includes details about whether the current wallet can satisfy the policy in some ways (aka `contribution`), and these are also included in the checksum. The same is true for what in a psbt is currently satisfied, which is the `satisfaction` field of `Policy`.
This causes the id of the nodes to change from wallet to wallet, depending on which private keys a wallet has or depending on which psbt you are looking at. Ideally if both wallets have the same public descriptor, they should also have the same id for the nodes, which makes sharing `policy_path`s much easier.
I would recommend changing the way the id is calculated, if you have any ideas let me know. I could also try working on it myself.
Contributor guide
Assessment
This issue has not been assessed yet.