You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is a lot of work, but conceptually it should be possible to split rust-miniscript into descriptors and miniscript. For people who want simple descriptors without miniscript can then use it.
"let's split rust-miniscript into two crates", which I think is a great idea, though it will be a lot of work, and we'll need to spend a bunch of time bikeshedding which parts go into which pieces, and we'll also want to think a bit about how the new descriptors crate would relate to bitcoin-addresses. (Maybe miniscript should depend on addresses which depends on descriptors/bech32/base58/etc?)
The text was updated successfully, but these errors were encountered:
You can see that Pkh, Wpkh and the key-only form of Tr, and possibly the basic multisig/sortedmulti forms of Bare/Sh/Wsh, might make sense in a descriptors crate while everything else is generic Miniscript and would not make sense. However, Rust does not give a good way to split things up like this.
We could attempt to replace the Descriptor enum with a Descriptor trait, though things like parsing would be pretty difficult (would need to return a Box<dyn Descriptor> and then the trait would need some sort of downcasting ability I guess?). This is something people have requested anyway, notably to experiment with CTV and APO. But I feel like I've tried it and really struggled. It may be that removing the Ctx parameter #723 would make this possible while it's currently impossible?
If we were throwing around Box<dyn Descriptor> then the trait would need to be object-safe -- this means no methods returning Self and no associated types. Is that feasible?
Without converting the enum to a trait I think this idea is just dead in the water, because it would mean that descriptors and miniscript traits would need different and incompatible Descriptor types. If we did convert the enum to a trait, this introduces some more questions -- what parts should be part of the API? Would rust-miniscript need to define an extension trait? Would it be possible to implement this extension trait generically for everything supporting the basic trait?
Moving from rust-bitcoin/rust-bitcoin#3695
From @sanket1729:
From @apoelstra:
The text was updated successfully, but these errors were encountered: