Skip to main content
This guide walks you through setting up your development environment for Sigil smart contract development.

Full Development Environment

If you’re setting up a full Kontor development environment (including running the indexer and tests), see the Kontor README which covers:
  • Installing all build dependencies (Bitcoin, ZMQ, etc.)
  • Compiling Bitcoin Core for local testing
  • Running the full test suite
  • Docker deployment

Contract Development Only

To develop and test Sigil contracts without running a local indexer:

Install Dependencies

MacOS:
brew install binaryen brotli
Ubuntu:
sudo apt install binaryen brotli

Set Up Rust

  1. Install Rust from rust-lang.org/tools/install
  2. Add the WebAssembly target:
    rustup target add wasm32-unknown-unknown
    
  3. Install additional tools:
    cargo install wasm-opt
    

Working with Example Contracts

The example contracts in this documentation repository require the Kontor indexer core libraries. If you clone both repos as siblings, the paths work out of the box:
mkdir kontor-dev
cd kontor-dev
git clone https://github.com/KontorProtocol/Documentation.git
git clone https://github.com/KontorProtocol/Kontor.git
cd Documentation/example-contracts/hello-world/test
cargo test  # Will automatically build and test
If your directory structure is different, update the workspace dependencies in each example’s root Cargo.toml:
[workspace.dependencies]
testlib = { path = "/path/to/Kontor/core/testlib" }
stdlib = { path = "/path/to/Kontor/core/stdlib" }
Alternatively, create your own contract workspace from scratch following the Hello World example, which shows the complete setup.

Next Steps

After completing Hello World, explore more examples:
  • Token - Learn about storage, maps, and state management
  • Shared Account - See cross-contract calls in action
  • AMM - Build a full automated market maker with complex logic
  • Pool - Understand liquidity pool patterns
For deeper understanding, see the Reference documentation.