Learn · stop 5 of 6 · interactive

Try to break a covenant

This is the real SimpleCovenant from the official tutorial — the same twelve lines this site compiles in CI every day. Imagine coins locked by it, with the recipient baked in at creation being you. Play the thief. Press the buttons.

This lesson runs in your browser against the contract's logic — no coins move. Every verdict shows the rule a real node would apply. Live testnet-10 broadcast: coming.

The contract — exactly as written

pragma silverscript ^0.1.0;

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

Build a spend and submit it

Esc to close