Skip to content

BlockstreamResearch/smplx

Repository files navigation

License: MIT Tests Community

Smplx

A blazingly-fast, ux-first simplicity development framework.

What

Simplex is a Rust-based, comprehensive development framework for Simplicity smart contracts, aiming to provide a rich tooling suite for implementing, testing, and deploying smart contract on Liquid.

  • CLI for managing simplicity-based projects.
  • SDK with essential simplicity utilities.
  • Liquid regtest for local integration testing.
  • Extensive framework configuration.

Warning

The framework is at the extremely early stage of development, unforeseen breaking changes and critical bugs are expected.

Installation

curl -L https://raw.githubusercontent.com/BlockstreamResearch/smplx/master/simplexup/install | bash
simplexup

See the simplexup manual for more details.

Getting started

Add smplx-std dependency to cargo:

cargo add --dev smplx-std

Optionally, initialize a new project:

simplex init

Usage

Simplex is a zero-config framework. However, it requires a simplex.toml file to exist in the project root. The default configuration is the following:

# Simplex config

[build]
src_dir = "./simf"
simf_files = ["*.simf"]
out_dir = "./src/artifacts"

[regtest]
mnemonic = "exist carry drive collect lend cereal occur much tiger just involve mean"

[test]
mnemonic = "exist carry drive collect lend cereal occur much tiger just involve mean"

[test.esplora]
url = "<esplora url>"
network = "<Liquid, LiquidTestnet, ElementsRegtest>"

[test.rpc]
url = "<rpc url>"
username = "<rpc username>"
password = "<rpc password>"

Where:

  • build (simplex build config)
    • src_dir - The simplicity contracts source directory.
    • simf_files - A glob pattern incidating which contracts are in scope.
    • out_dir - The output directory where contracts artifacts are generated.
  • regtest (simplex regtest config)
    • mnemonic - The signer's mnemonic regtest will send initial funds to.
  • test (simplex test config)
    • esplora
      • url - Esplora API endpoint url
      • network - Esplora network type (Liquid, LiquidTestnet, ElementsRegtest).
    • rpc
      • url - Elements RPC endpoint url
      • username - Elements RPC username
      • password - Elements RPC password
    • mnemonic - The signer's mnemonic internal regtest will send initial funds to.

CLI

Simplex CLI provides the following commands:

  • simplex init - Initializes a Simplex project.
  • simplex config - Prints the current config.
  • simplex build - Generates simplicity artifacts.
  • simplex regtest - Spins up local Electrs + Elements nodes.
  • simplex test - Runs Simplex tests.

To view the available options, run the help command:

simplex -h

Example

Check out the complete project examples in the examples directory to learn more.

Contributing

We are open to any mind-blowing ideas! Please take a look at our contributing guidelines to get involved.

Future work

  • Complete simplex init and simplex clean tasks.
  • SDK support for confidential assets, taproot signer, and custom witness signatures.
  • Local regtest 10x speedup.
  • Regtest cheat codes.
  • Browser compatibility.
  • Simplicity dependencies management once the language adds support for modules.
  • Comprehensive documentation.

License

The framework is released under the MIT License.

About

A blazingly-fast, ux-first simplicity development framework.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors