-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not include satisfaction in policy id calculation #1218
Comments
@matthiasdebernardini I believe your project uses this feature pretty heavily, any thoughts? |
I was going to suggest simply removing the policy module in favor of pointing people to the planning module in miniscript. Thoughts? |
Yeah that would be better, but as far as I know it still hasn't been released, right? |
It's still not released yeah :\ |
@LLFourn I was gonna ask, where can I see this module? I can't find it. |
Here you go: It needs feedback and iterations but this is the way of the future. |
Currently every node in the
Policy
tree has an id which is calculated as a checksum on the string of the json-serialized object:bdk/crates/bdk/src/descriptor/policy.rs
Lines 174 to 178 in d6a0cf0
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 thesatisfaction
field ofPolicy
.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.
The text was updated successfully, but these errors were encountered: