shesek / minsc

An highly-specialized DSL scripting language for Bitcoin Script and Miniscript
https://min.sc
MIT License
190 stars 19 forks source link

OP_CTV support #42

Open ursuscamp opened 8 months ago

ursuscamp commented 8 months ago

UTXOS.org specifically lists minsc under resources as supporting CTV. I don’t see any mention of this on the website or the repo. I know also that Sapio uses rust-miniscript under the hood, just like this project.

Does this policy language actually support CTV? If so, how can I use it? Also curious if this repo has any relation to Sapio.

Thanks.

shesek commented 3 months ago

Hi there, sorry for the slow reply.

Minsc indeed supports CTV, the website's documentation is outdated and doesn't include quite a few features. The playground on the main website is outdated too, but you can find an updated version at https://min.sc/v0.3/.

The current version of Minsc supports CTV in Script, using the ctv() and ctvHash() functions. There are some examples here.

There was also a previous Minsc version that supported CTV in Miniscript too, using Sapio's rust-miniscript fork with support for the txtmpl() policy. However using two different versions of rust-miniscript was too cumbersome so currently it is only supported in raw Script.

(If you're interested, the old code for CTV in Miniscript is available in this branch, and there's also an old playground version that supports it at https://min.sc/nextc/. Here are some example of its use: two-step recovery, chicken hodl.)

Also curious if this repo has any relation to Sapio.

No relation, apart from previously using its miniscript library.