rust-bitcoin / rust-miniscript

Support for Miniscript and Output Descriptors for rust-bitcoin
Creative Commons Zero v1.0 Universal
350 stars 137 forks source link

Support for sortedmulti_a #320

Open dr-orlovsky opened 2 years ago

dr-orlovsky commented 2 years ago

The support is part of Bitcoin core, but absent here

sanket1729 commented 2 years ago

Note that this would only be supported at the top level. Supporting it at the miniscript level is not possible and is currently not in spec. Same reason why miniscript only has multi and no sorted_multi

notmandatory commented 2 years ago

Is it possible to remove this issue from the 8.0.0 milestone so that the next release can go out sooner? Projects like bdk need #450 before we can update to rust-bitcoin 0.29.

apoelstra commented 2 years ago

I would also like #478 -- let's bump this to the next milestone so we can do a quick release. Ok by you @sanket1729 ?

apoelstra commented 2 years ago

Oh, actually I don't care (I'm working on elements-miniscript but it is just a fork off the git repo, it doesn't use crates.io versions). But I agree with the sentiment that we ought to have a current release that matches rust-bitcoin.

sanket1729 commented 2 years ago

In future releases, we should automatically release a new version of rust-miniscript whenever there is a new version of rust-bitcoin. Other normal feature releases of rust-miniscript can go at their own pace.

apoelstra commented 2 years ago

I will prepare a new release ... but apparently we have 71 PRs since the last one so it may take me a while to make a changelog!

sanket1729 commented 2 years ago

@apoelstra, I think I made some progress on changelog

sanket1729 commented 2 years ago

Let me check my local branh

sanket1729 commented 2 years ago

@apoelstra, there is already a changelog at https://github.com/rust-bitcoin/rust-miniscript/pull/462/commits/6f3c9672650444a358b7261be9a6b997902861ce

sanket1729 commented 1 year ago

Adding top-level support for sortedmulti_a is certainly something we want to do. But something I don't have the time for now. Perhaps, a simple good first issue for someone who is looking for intermediate coding.

ameya-deshmukh commented 1 year ago

@sanket1729 I'd love to pick this up! Can I?

sanket1729 commented 1 year ago

Sure, feel free to ask any questions here

Harshit933 commented 9 months ago

Hello @sanket1729 @apoelstra I would like to take up this issue, Although I am still learning about descriptors, this would be a good issue to apply my knowledge.

apoelstra commented 9 months ago

@Harshit933 yep, this looks like a fairly self-contained issue. You can look at the existing tr descriptor for how Taproot works, and the existing sortedmulti descriptor to see what a top-level "sorted multisig" descriptor looks like.

Harshit933 commented 8 months ago

I read some things about sortedmulti_a. Although the documentation around it is quite less. There are somethings that I wanted to ask.

And this is a basic one :

apoelstra commented 8 months ago
  • Does sortedmulti_a supports only x-only public keys? If this is true why is this descriptor only for taproot

Only Taproot has the CHECKSIGADD opcode. If you are using the old CHECKMULTISIG then the existing sortedmulti will do you.

  • Like in the taproot descriptor we can have multiple trees in it. Does sortedmulti_a also can have multiple trees?

No, sortedmulti is only a top-level thing.

How miniscript and descriptor related? From reading the miniscript module I am thinking that miniscript is used as blocks for building descriptors. But I am still confused as how this works

(Output) descriptors describe the script part of Bitcoin outputs (the other part of an output is a BTC amount, which stands on its own). They indicate whether the output is Taproot, segwit v0, P2SH, P2WPKH, etc etc. For descriptor types that have a freeform script (p2sh, p2wsh, taproot, etc) Miniscript sits inside and describes the script itself.

Harshit933 commented 8 months ago

Only Taproot has the CHECKSIGADD opcode. If you are using the old CHECKMULTISIG then the existing sortedmulti will do you.

Is there any website where I can find all the opcode?

(Output) descriptors describe the script part of Bitcoin outputs (the other part of an output is a BTC amount, which stands on its own). They indicate whether the output is Taproot, segwit v0, P2SH, P2WPKH, etc etc. For descriptor types that have a freeform script (p2sh, p2wsh, taproot, etc) Miniscript sits inside and describes the script itself.

Thanks, this clears a lot of things.

sanket1729 commented 8 months ago

@Harshit933, you can cross reference bitcoin core implementation for sortedmulti_a, while attempting this PR. That should serve as a good starting point for what needs to be done.

Harshit933 commented 8 months ago

@Harshit933, you can cross reference bitcoin core implementation for sortedmulti_a, while attempting this PR. That should serve as a good starting point for what needs to be done.

Thanks for the suggestion. I have looked inside the core implementation of sortedmulti_a and I have some questions inside #641