-
Notifications
You must be signed in to change notification settings - Fork 163
Exclusive bounds for thresh: 1 < k < n #242
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
Conversation
We were accepting 'thresh()'s with a single sub-policy or a number of sub-policies equals to the threshold. This differs with both the C++ implementation and the 'reference' (http://bitcoin.sipa.be/miniscript/) Reported-by: Stepan Snigirev <snigirev.stepan@gmail.com> Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
See #241 (it was actually opened before my PR but i did not see it..) |
@apoelstra @sanket1729 do you have an opinion on how to proceed to compile |
The logic was quite intricate, this cleans it up as we are going to reuse it for testing compilation to nested 'or()'s. In addition, this extends the test to larger multisigs. Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
darosior: - is it *that* bad? cargo bench: - worse. Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
So i went ahead and implemented the Policy compilation part. Added a benchmark for the compilation of nested 'or's too. Wonder if we should add a limit on the number of nested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darosior, I should have seen this earlier. Sorry for the delay in response, but I think we decided to allow these scripts for easier way to write miniscripts. It seems natural to write a miniscript with thresh 1
and thresh k = n
, so I think we should allow it. This was discussed with Pieter and I was supposed to update the c++ version.
Since we are allowing miniscripts thresh |
Should we close this PR as we have decided to update the spec to allow these? |
Yes, i planned to do this as well as maybe opening a PR for the last 3 commits that are not dependent on the spec change. Closing for now :) |
38b046f index: inclusive bounds for thresh's k (Antoine Poinsot) 51e0cb1 miniscript: allow thresh for k=1 and k=len(subs) (Antoine Poinsot) e41693e gitignore: ignore the miniscript binary (Antoine Poinsot) Pull request description: As per #39 and discussions on IRC this removes the exclusion of `k = 1` and `k = subs.size()` for `thresh`. This is the opposite of rust-bitcoin/rust-miniscript#242 (adapting the Rust implementation to the C++ one) after sanket1729 's feedback. Fixes #39 ACKs for top commit: sipa: utACK 38b046f Tree-SHA512: 8d76763117c05892ff309b409c70fe928f02b2e8adc54716d0c6363e4993fb1ddc11c858f069694eb7a69ff1f00fe8e2588a3d74021da6cf97a9cc4e36f3a524
Currently a draft as i'm unsure how to proceed with the compiler. Fork == n
, we already translate toand()
s, but fork == 1
we stepped by because of the exponential behaviour (see #126).(Credits to @stepansnigirev for finding the inconsistency)
Fixes #241
Fixes #237
Fixes #126