rust-elements icon indicating copy to clipboard operation
rust-elements copied to clipboard

Validation of consensus rules

Open thomaseizinger opened this issue 4 years ago • 7 comments

Are there any plans on doing something similar in this library to the libbitcoinconsensus feature in rust-bitcoin?

At the moment, we are testing all of our stuff by spinning up elementsd instance which is obviously quite slow. It would be cool if we could at least test a subset of the functionality, in particular script evaluation, in a unit test.

What would it take to make that happen?

thomaseizinger avatar Jul 15 '21 04:07 thomaseizinger

Are there any plans on doing something similar in this library to the libbitcoinconsensus feature in rust-bitcoin?

At present, there is no such project planned.

What would it take to make that happen?

I guess we need bindings similar to those we have for rust-bitcoin for script/bitcoinconsensus.h file in ElementsProject/elements

sanket1729 avatar Jul 18 '21 08:07 sanket1729

I made a thing: https://github.com/comit-network/rust-elements-consensus

thomaseizinger avatar Jul 21 '21 06:07 thomaseizinger

Thanks for doing this :). We will also require this for internal testing of our complicated scripts like covenants. I can offer help in maintaining/reviewing code for the repository.

And if it is okay with you, we can also move this into ElementsProject org so that other developers who are working with rust-elements can also find it there. cc @apoelstra

sanket1729 avatar Jul 22 '21 10:07 sanket1729

It is highly experimental at the moment 😁

But have a look please yes! We will be playing around with it internally soon, can report back on whether or not it works as intended. Once that happens, I was planning to release it on crates.io.

If we wanted to make this more official-y, I think a good way forward would be to just have the -sys crate and integrate the rest directly into rust-elements. That way, less things have to be kept in sync.

Can always feature-gate it to reduce dependency bloat.

thomaseizinger avatar Jul 22 '21 11:07 thomaseizinger

If it's useful we can move it into ElementsProject, but let's give it a bit to see how much mileage we get out of it.

apoelstra avatar Aug 26 '21 20:08 apoelstra

It has worked well for us to test spending of covenant scripts, but it is not released yet to crates.io. Happy to transfer it into the org if you find it useful as well!

thomaseizinger avatar Aug 26 '21 23:08 thomaseizinger

Let's revisit after we get Elements 0.21 out. The more I think about this the more I like it.

apoelstra avatar Sep 08 '21 21:09 apoelstra