-
Notifications
You must be signed in to change notification settings - Fork 47
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
Help Wanted, Understanding duplicate keys in conditions #142
Comments
I think the compiler doesn't support spaces inside policy strings. Other than that, this seems like it should work. |
I think this policy is also equivalent to |
Oh, the compilation error is due to key reuse within the policy; miniscript's non-malleability properties rely on keys not being reused (i should add an option to the site to ignore this, probably). |
I noticed the miniscript implementation in rust throws I'm not really understanding how malleability comes into play here. The keys needing to sign would not change, is this in the case for utxo spending? Also in ref to what you offered:
I didn't know you could have a timelock in the |
For wallet accounts, the standard that wallets like Liana are using (kinda implied by BIP-388's placeholders) is to have |
@bigspider AFAIU only 1 spending path can ever be put on chain to satisfy a tapscript? So why is this considered a malleability issue, if there's redundant usage of a key in logic branches that are there as backup conditions? |
Miniscript's malleability issues are about a single Script, so either:
On taproot, you can technically use the same pubkey across different leaves, and in most cases it would be perfectly fine, as you said. (Off-topic, but: BIP-388 forbids reusing the exact same pubkey even across different leaves. However, that was a choice mostly for practical convenience and some considerations about future-proofing, not related to malleability) |
I'm still a little confused on what an example condition woud be to cause malleability, but I get there's an idea of a complexity/genericity tradeoff miniscript made here with key reuse to address it. thanks. |
@darosior wrote a nice general explainer: https://bitcoin.stackexchange.com/a/116282/101498 Pubkey reuse causes malleability because the same signature works for multiple spending conditions. For example if you have a miniscript like |
I'm trying to build some pseudo miniscript code and check my logic with the compiler on bitcoin.sipa.be/miniscript. I'm trying to work my way outward, to a more complicated script. I'm getting stuck with this below nested example. I want to have a threshold 3/4 with timelock 1000, OR, 2/4 with 3000.
It seems the parent
or
directly going toand
's is not the proper syntax. How would I be able to accomplish this sort of multiple or timelock conditions with miniscript?Condensed:
or(and(thresh(3, pk(A), pk(B), pk(C), pk(D)),older(1000)), and(thresh(2, pk(A), pk(B), pk(C), pk(D)),older(3000)))
Note, the individual inner
and
's work fine.The text was updated successfully, but these errors were encountered: