Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ assignees: ""
- **OS**: <!-- e.g. Ubuntu 24.04, macOS 15 -->
- **Rust version**: <!-- output of `rustc --version` -->
- **Commit / tag**: <!-- git rev-parse --short HEAD -->
- **Affected crate(s)**: <!-- core / service / cli / jet_plugins -->
- **Affected crate(s)**: <!-- core / service / cli -->

## Logs

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ assignees: ""

## Affected crate(s)

<!-- Which crate(s) would this touch? core / service / cli / jet_plugins -->
<!-- Which crate(s) would this touch? core / service / cli -->

## Alternatives considered

Expand Down
2 changes: 0 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
## Affected crates

- [ ] `core`
- [ ] `jet_plugins`
- [ ] `service`
- [ ] `cli`
- [ ] `plugin_tests`
- [ ] CI / tooling

## Checklist
Expand Down
41 changes: 1 addition & 40 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ Contributions of all kinds are welcome — bug reports, documentation improvemen

The workspace is organised into focused crates. Keep changes scoped to the appropriate crate and discuss cross-crate changes in an issue first.

- [`core`](core/README.md): Simplicity execution engine, Bitcoin/Elements environments, and the dynamic jet loading API.
- [`jet_plugins`](jet_plugins/README.md): Procedural macro that derives the `Jet` trait and C FFI for custom jet plugins.
- [`core`](core/README.md): Simplicity execution engine and Bitcoin/Elements environments.
- [`service`](service/README.md): Axum HTTP service exposing the sign/PSBT, sign/PSET, and key-tweak endpoints.
- [`cli`](cli/README.md): `clap`-based CLI for interacting with the service and accessing ecosystem utilities.
- `plugin_tests/`: Example and integration-test jet plugins for Bitcoin, Elements, and opcode pubkey variants.

## Issues

Expand All @@ -33,43 +31,6 @@ If this is just a bug report or a feature request, please open an issue first so
- Adding a new dependency requires justification. Prefer `[workspace.dependencies]` entries and avoid floating version requirements.
- Add unit tests under a `#[cfg(test)]` module in the same file.

## Adding Custom Jets

Custom jets are the primary extension point. To add a new jet plugin:

1. Create a new crate that depends on `jet_plugins` and `simplicity_unchained_core`, declare it as a `cdylib`:

```toml
# Cargo.toml
[lib]
crate-type = ["cdylib"]
```

2. Define your jet functions matching the expected signature:

```rust
fn my_jet(_dst: &mut CFrameItem, _src: CFrameItem, _env: &BitcoinUnchainedEnv) -> bool {
// return true on success
todo!()
}
```

3. Register them with the `register_jets!` macro:

```rust
use jet_plugins::register_jets;
use simplicity_unchained_core::jets::environments::BitcoinUnchainedEnv;
use hal_simplicity::simplicity::ffi::CFrameItem;

register_jets!(
hal_simplicity::simplicity::jet::Core, // base jet set
BitcoinUnchainedEnv, // environment type
"my_jet_name" => my_jet, b"h", b"h", // (name, fn, source_type, target_type)
);
```

4. Pass the compiled `.so`/`.dylib` path to the core runner via the dynamic loading API. See `core/src/jets/jet_dyn.rs` and `cli/assets/custom_jet_dlls/` for reference.

## Running the Service Locally

```bash
Expand Down
88 changes: 8 additions & 80 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ resolver = "2"
members = [
"cli",
"core",
"jet_plugins",
"plugin_tests/bitcoin",
"plugin_tests/opcode_pubkey_elements",
"plugin_tests/opcode_pubkey_bitcoin",
"plugin_tests/elements",
"service",
]

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ See [core/README.md](core/README.md) for a detailed explanation of the unchained

## Project Structure

- [`core`](core/README.md): Contains the fundamental logic for executing Simplicity programs, interacting with Bitcoin and Elements environments and interface for loading custom jet implementations from dynamic libraries. (Note: In the future, parts of this logic may be migrated to [hal-simplicity](https://github.com/BlockstreamResearch/hal-simplicity))

- [`jet_plugins`](jet_plugins/README.md): Procedural macro for deriving Jet trait for given custom jets alongside with it's C FFI. Currently supports extending Bitcoin and Elements jets.
- [`core`](core/README.md): Contains the fundamental logic for executing Simplicity programs and interacting with Bitcoin and Elements environments. (Note: In the future, parts of this logic may be migrated to [hal-simplicity](https://github.com/BlockstreamResearch/hal-simplicity))

- [`service`](service/README.md): Implements a web service providing endpoints to interact with Simplicity Unchained. Currently, it supports a 2-of-2 multisig co-signing flow on Bitcoin and Elements, triggered by the successful execution of a Simplicity program.

Expand Down
Binary file removed cli/assets/custom_jet_dlls/libbitcoin.so
Binary file not shown.
Binary file removed cli/assets/custom_jet_dlls/libelements.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ hex-literal = "1.1.0"
hal-simplicity = { workspace = true }
thiserror = { workspace = true }
hex = { workspace = true }
dlopen2 = "0.8.2"
3 changes: 1 addition & 2 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ Contains the fundamental logic for executing Simplicity programs and interacting

- Execute Simplicity programs with provided data and environment.
- Utilities for interacting with Elements and Simplicity environments.
- Custom execution environment supporting the injection of custom jets.
- Provides API for loading custom Jet trait implementation derived via jet_plugins crate via dynamic library.
- Custom execution environment extending the Bitcoin and Elements jet sets with additional jets.

## How It Works

Expand Down
Loading
Loading