Covenant Genesis & Transition
This guide demonstrates how to orchestrate a 1:1 auth-bound Toccata covenant using HardKAS CLI.
Prerequisites: You must have a compiled SilverScript record (compile_record.json) and a funded account (alice).
1. Covenant Genesis
The Genesis step binds a new UTXO to a freshly derived covenant_id.
hardkas silver covenant genesis compile_record.json \
--from alice \
--amount 5000 \
--compute-budget 50000 \
--fee 20000000 \
--wait
What HardKAS does:
- Loads your compiled SilverScript artifact.
- Derives the P2SH Kaspa address for the contract's initial state.
- Finds a spendable UTXO from
alicelarger than the requested amount + fee. - Constructs a
v1Kaspa transaction. - Explicitly assigns a new
covenant_idto the output (Output Covenant Binding). - Submits the transaction to the network and waits for confirmation.
2. State Transition
To advance the covenant's state, you must spend the Genesis UTXO and create a Successor UTXO, satisfying the SilverScript policy constraints.
hardkas silver covenant transition genesis_record.json \
--policy "increment" \
--constructor-args args.json
What HardKAS does:
- Resolves the current state of the covenant from the
genesis_record.json. - Compiles the expected successor state using
silverc. - Constructs a
v1transaction that spends the current covenant UTXO and creates the successor UTXO. - Automatically copies the exact same
covenant_idfrom the input to the successor output via bindings. - Signs the transaction (using standard or PSKT coordination if required) and submits it.
PSKT Covenant Compatibility
HardKAS pskt workflows (delegating to upstream rusty-kaspa v2.1.0) are fully compatible with Toccata covenants.
When you export a covenant transition plan to a PSKT, the PSKT binary preserves:
- The
v1transaction serialization format. - The explicit
compute_budgetrequired for the script validation. - All Output Covenant Bindings and
covenant_idmetadata.
This allows you to construct a complex SilverScript state transition on an online machine, and safely transfer it to an air-gapped signer for authorization.