sipa / miniscript

Miniscript site and implementation
157 stars 47 forks source link

Compiler outputs suboptimal miniscript for `or(pk(k1),pk(k2))` #139

Open benma opened 11 months ago

benma commented 11 months ago

The second policy example at https://bitcoin.sipa.be/miniscript/

"One of two keys (equally likely)" - or(pk(key_1),pk(key_2))) - compiles to or_b(pk(key_1),s:pk(key_2)).

Should it not compile to multi(1,key_1,key_2) instead, which has the same witness size but a smaller script size (71 WU vs 72 WU)?