Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miniscript #1986

Open
benma opened this issue May 25, 2023 · 4 comments
Open

Miniscript #1986

benma opened this issue May 25, 2023 · 4 comments

Comments

@benma
Copy link
Contributor

benma commented May 25, 2023

Hi

I just open sourced my implementation of Miniscript at https://github.com/benma/miniscript-go.

It depends on btcd for script generation and unit testing redemption (executing the script and witness to check that witness generation works).

kon from Lightning Labs pinged me about making a PR here. I think inclusion into btcd would be a very good idea:

  • Miniscript it is part if Bitcoin Core and btcd seems to be supporting all or most of what Bitcoin Core supports in terms of scripting
  • Shared maintainership and better core review, which reduces the risk of using it in many ways
  • Easier to discover, less fragmentation

My time is currently stretched very thin however, so I'd require someone else to take the above code, fill in the missing parts, open a PR here and bring it over the finish line.

There is even an accompanying blog post that explains how much of the code works 😄

Any takers? @Roasbeef @guggero - please tag anyone who might be interested

@guggero
Copy link
Collaborator

guggero commented May 25, 2023

Cool, thanks a lot for the implementation! I might take a stab at integrating it as a weekend project. Though since I don't know when that will be, if anyone's faster than myself, please go ahead!
I think it definitely makes sense to integrate the code into btcd.

Regarding attribution/license, how would you like us to proceed? Since your repo doesn't have a license. Would it be okay if the PR that adds your code would have you as the author and then any follow-up commits with changes would be the PR author? That would put your code under the ISC license.

@benma
Copy link
Contributor Author

benma commented May 25, 2023

Great!

Regarding attribution/license, how would you like us to proceed? Since your repo doesn't have a license. Would it be okay if the PR that adds your code would have you as the author and then any follow-up commits with changes would be the PR author? That would put your code under the ISC license.

Sounds good and ISC is fine. I quickly made this commit by just moving over all files to txscript/miniscript, if it helps:

https://github.com/benma/btcd/commits/miniscript

Feel free to take it and build on top. There is already one CI error: strings.Cut() was only added in Go 1.18, while btcd is using Go 1.17 at the moment.

@Roasbeef
Copy link
Member

Re the version: we tyupically try to track the last two versions (so Go 1.19 and 1.20 rn) so I think no issue bumping it. We'll also likely have more code start to use generics (eg: ##1934) in the near future.

@benma
Copy link
Contributor Author

benma commented May 25, 2023

@Roasbeef it would be great avoid generics until gopherjs/gopherjs#1013 is resolved - we use GopherJS to compile a library making use of btcd to JS.

Should even consider sticking to 1.17 until GopherJS catches up. strings.Cut() can easily be replaced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants