Build · 2 of 4

Your first covenant

This is SimpleCovenant, verbatim from the official Silverscript tutorial. Twelve lines that already do something real: coins locked by it can only ever be sent to one predetermined recipient.

pragma silverscript ^0.1.0;

contract SimpleCovenant(pubkey recipient) {
    entry spend() {
        byte[36] recipientScriptPubKey = new ScriptPubKeyP2PK(recipient);
        require(tx.outputs[0].scriptPubKey == byte[](recipientScriptPubKey));
    }
}

What each piece does

Compile it

Save the contract as simple.sil in your Silverscript checkout, then:

cargo run -p silverscript-lang --bin silverc -- simple.sil -o artifact.json

The artifact is your compiled covenant. Constructor arguments are supplied as JSON — for example [{ "kind": "int", "value": 100 }] for an integer parameter.

Step through it

The repo ships a CLI debugger that runs entries against arguments so you can watch a rule pass or fail:

cargo run -p cli-debugger -- silverscript-lang/tests/examples/if_statement.sil \
  --function hello --ctor-arg 3 --ctor-arg 10 --arg 1 --arg 2

Point it at your own simple.sil and an entry once you've compiled it.

Getting it on-chain

Deployment means funding an address whose script is your compiled covenant, then spending it with a witness Witness The data supplied when spending — signatures, arguments, revealed scripts — that satisfies (or fails) the lock on the coins. that satisfies the entry — on testnet-10 first, always. The official tutorial focuses on the language rather than deployment tooling (checked 2026-09-10), so the practical paths today are the kascov.io playground and the patterns in the KCC20 book. A full deploy-and-spend walkthrough lands here as the tooling settles.