bitcoinerlab / miniscript

A Bitcoin Miniscript compiler and an explicit Satisfier decoupled from the tx signer.
https://bitcoinerlab.com/modules/miniscript
19 stars 6 forks source link

Is sortedmulti fragment supported? #8

Open louneskmt opened 9 months ago

louneskmt commented 9 months ago

Hi! Is the sortedmulti operator supported?

I've tried this descriptor: wsh(sortedmulti(2,tpubD6NzVbkrYhZ4YgjDd2FXNM3LVEHhopeVTfQmnUXWB8bGSoNKNzWHzTT3G8HYof6pLxn9qEwC5c9vVKWaFBUmqRzvZkdcXAzKWBFn9ETKMy5/0/*,tpubD6NzVbkrYhZ4Y33j8px4EZnUb3pxaz13AEc6QJTzWj3kcXpQc2Q4zKHhmMk4KsQV7CBjVUQYsfmdVCuQkT84zqYqKPbtFgiHyaGZ6KcC94N/0/*)) but I get the error Miniscript sortedmulti(2,@0,@1) is not sane. If I change sortedmulti to multi, it works as expected and doesn't raise any error.

I don't see SORTEDMULTI in the bindings, is that why? https://github.com/bitcoinerlab/miniscript/blob/d420729aa46d8ea785e69e6d0548386bda6774d0/js_bindings.cpp#L54

Thanks!

landabaso commented 9 months ago

Hi,

The error message is misleading. Currently, the library supports only miniscript expressions within sh/wsh script tags.

The sortedmulti operator isn't part of the miniscript specification, which is why it's not functioning.

I'll look into making this clearer in our documentation and error messages to avoid future confusion.