Install and setup
Silverscript is a Rust workspace. The main crate is silverscript-lang.
git clone https://github.com/kaspanet/silverscriptcd silverscriptcargo test -p silverscript-langIf the tests pass, your toolchain is fine.
Editor support
Editor extensions ship in the repository under extensions/, backed by a
tree-sitter grammar:
| Editor | Path |
|---|---|
| VS Code | extensions/vscode |
| Zed | extensions/zed |
| Neovim | extensions/silverscript.nvim |
Syntax highlighting for .sil is worth setting up before you write anything.
Covenant code is dense, and unhighlighted it reads as a wall.
The debugger
The workspace includes a source-level debugger — stepping, variable inspection, a REPL. For a language where failure normally shows up as “the spend was rejected”, being able to step a script is the difference between a minute and an afternoon.
cargo run -p cli-debugger -- \ silverscript-lang/tests/examples/if_statement.sil \ --function hello \ --ctor-arg 3 --ctor-arg 10 \ --arg 1 --arg 2Constructor arguments come first, then the arguments the spender supplies — mirroring the split between what is fixed at the address and what is provided at spend time.
Where the examples live
silverscript-lang/tests/examples/ holds over eighty .sil files, and they are
the best reading material available: multisig, hodl vaults, escrows, last-will
covenants, recurring allowances, and KCC-20 token contracts. Because they are
test fixtures, they compile — which is more than can be said for most sample
code.
Upstream reference
docs/TUTORIAL.md— the full language tutorialdocs/DECL.md— the covenant declaration spec- KCC-20 book