Skip to content

add covenants example with dockerfile for nitro enclave#4

Open
stutxo wants to merge 1 commit into
joshdoman:mainfrom
stutxo:add_covenants_example
Open

add covenants example with dockerfile for nitro enclave#4
stutxo wants to merge 1 commit into
joshdoman:mainfrom
stutxo:add_covenants_example

Conversation

@stutxo
Copy link
Copy Markdown

@stutxo stutxo commented Aug 26, 2025

This adds an examples folder with a covenants_example using a custom CovenantVerifier which has OP_CAT, OP_CSFS and OP_CTV enabled

I have also added an example dockerfile that can be used to build targeted at aarch64-unknown-linux-musl to create a static binary that is needed for nitro enclaves

@stutxo stutxo force-pushed the add_covenants_example branch 3 times, most recently from bcace16 to 4b8d7f7 Compare August 26, 2025 04:35
@joshdoman
Copy link
Copy Markdown
Owner

Thanks for this PR! It's awesome we now have a working kernel that implements covenant opcodes. I need to run this on my own machine and may make a few changes to the examples folder (like putting this in its own sub-directory), but it looks good at first glance.

While I prefer building things with Nix (see enclaver and confidential-script-tee) because we want reproducible PCR0's, I think it would be good to have an example built with Docker as well.

Comment thread Dockerfile.example

ENV Boost_DIR=/usr/lib/aarch64-linux-gnu/cmake/Boost-1.83.0

RUN cargo zigbuild --release --target aarch64-unknown-linux-musl -p examples --bin covenants_example
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice example using Zig.

Comment thread examples/Cargo.toml Outdated
serde = { version = "1.0", features = ["derive"] }
vsock = "0.5.1"
serde_json = "1.0"
bitcoinkernel-covenants = { git = "https://github.com/stutxo/rust-bitcoinkernel-covenants", branch = "covenants_enabled"}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you're pointing to your GitHub instead of the Rust crate? It might not be a bad idea actually, just to make clear that this isn't some official "covenants" crate, but I'm curious if you had different thinking, or if this was inadvertent.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah i had to make a change to get it working, il change it back to use the crate

Comment thread examples/Cargo.toml
vsock = "0.5.1"
serde_json = "1.0"
bitcoinkernel-covenants = { git = "https://github.com/stutxo/rust-bitcoinkernel-covenants", branch = "covenants_enabled"}
confidential-script-lib = { path = "../" }
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My instinct is that examples should point to the latest version of the published library. That way users can just copy the example and run it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated Cargo.toml to use the latest verson of the bitcoinkernel-covenats crate with this commit 6cacaa6

@stutxo stutxo force-pushed the add_covenants_example branch from 4b8d7f7 to 6cacaa6 Compare August 30, 2025 17:39
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

Successfully merging this pull request may close these issues.

2 participants