A blazingly-fast, ux-first Simplicity development framework.
Simplex is a Rust-based, comprehensive development framework for SimplicityHL smart contracts, aiming to provide a rich tooling suite for implementing, testing, fuzz testing, and deploying smart contract on Liquid.
- CLI for managing Simplicity-based projects.
- SDK with essential SimplicityHL utilities.
- SimplicityHL contracts unit and fuzz testing suite.
- Liquid regtest for local integration testing.
- Extensive framework configuration.
Warning
The framework is at the early stage of development, unforeseen breaking changes and critical bugs are expected.
curl -L https://smplx.simplicity-lang.org | bash
simplexupSee the simplexup manual for more details.
Add smplx-std dependency to cargo:
cargo add --dev smplx-stdOptionally, initialize a new project:
simplex init <name>Simplex is a zero-config framework. However, it requires a Simplex.toml file to exist in the project root.
The example below keeps the default settings. Dependencies, regtest ports, fuzz options, and external providers are optional, so their examples are commented out.
# Simplex config.
[build]
src_dir = "simf"
simf_files = ["**/*.simf"]
out_dir = "src/artifacts"
[dependencies]
# my_lib = { path = "../my_lib" }
# std = { git = "https://github.com/BlockstreamResearch/simplicityhl-std.git", tag = "v0.1.0" }
[regtest]
mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
bitcoins = 10_000_000
# Ports are assigned automatically. Authentication uses the node's cookie.
# rpc_port = 18443
# esplora_port = 3000
# rpc_user = "user"
# rpc_password = "password"
[test]
mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
bitcoins = 10_000_000
verbosity = "None" # "None", "Debug", or "Trace"
# [test.fuzz]
# cases = 10000
# seed = 12345 # random by default
# network = "ElementsRegtest" # "Liquid", "LiquidTestnet", or "ElementsRegtest"
# [test.esplora]
# url = "http://localhost:3000"
# network = "ElementsRegtest" # "Liquid", "LiquidTestnet", or "ElementsRegtest"
# [test.rpc]
# url = "http://localhost:18443"
# username = "user"
# password = "password"Where:
build(simplex buildconfig)src_dir- The simplicity contracts source directory.simf_files- A list of glob patterns indicating which contracts are in scope.out_dir- The output directory where contracts artifacts are generated.
dependencies(simplex installconfig)- The list of SimplicityHL dependencies to install. Each entry uses either
pathorgitas its source.- A Git dependency can select one
tag,rev, orbranch. An optionalpackagefield selects the repository subdirectory containingSimplex.toml.
- A Git dependency can select one
- The list of SimplicityHL dependencies to install. Each entry uses either
regtest(simplex regtestconfig)mnemonic- The signer's mnemonic regtest will send initial funds to.bitcoins- Initial coins available to the signer.rpc_port- Optional fixed Elements RPC port. A port is assigned automatically when omitted.esplora_port- Optional fixed Electrs HTTP port. A port is assigned automatically when omitted.rpc_userandrpc_password- Optional Elements RPC credentials. Set both to use username/password authentication instead of the node's cookie.
test(simplex testconfig)mnemonic- The signer's mnemonic internal regtest will send initial funds to.bitcoins- Initial coins available to the signer.verbosity- Simplicity execution log level ("None","Debug", or"Trace").fuzzcases- The number of fuzz iterations to do.seed- The fuzzer random seed.network- Network type for local fuzz transactions (Liquid,LiquidTestnet,ElementsRegtest).
esploraurl- Esplora API endpoint url.network- Esplora network type (Liquid,LiquidTestnet,ElementsRegtest).
rpcurl- Elements RPC endpoint url.username- Elements RPC username.password- Elements RPC password.
Simplex CLI provides the following commands:
simplex init- Initializes a new Simplex project.simplex config- Prints the current config.simplex install <dep>- Installs SimplicityHL dependencies. Without a<dep>provided, installs everything listed in the[dependencies]config section. With one or more<dep>arguments, appends new entries to the config and then installs everything. The bare namestdpins the latestSimplicityHLstandard library release.simplex build- Generates simplicity artifacts.simplex regtest- Spins up local Electrs + Elements nodes.simplex test- Runs Simplex tests. Provide a--fuzzflag to run Simplex fuzz tests.simplex clean- Cleans up generated artifacts. Add--allto also remove installed dependencies.simplex fmt- Formats SimplicityHL files according to the specifiedsimfmt.tomlor default configuration.
To view the available options, run the help command:
simplex -hCheck out the complete project examples in the examples directory to learn more.
We are open to any mind-blowing ideas! Please take a look at our contributing guidelines to get involved.
- SimplicityHL storage compatibility.
- SimplicityHL dependencies management.
- Fuzz testing for SimplicityHL contracts.
- Browser compatibility.
- SDK support for taproot signer and custom descriptors.
- SimplicityHL contracts static analyzer.
- Test coverage reporting.
- Local regtest 10x speedup.
- Regtest cheat codes.
- Comprehensive documentation.
Check out the full roadmap here.
The framework is released under the MIT License.
