Instance, state & constructors
📝 Draft. This chapter has not been reviewed yet — content may be incomplete or change.
Problem. Deploy a contract once and then act on it repeatedly — persisting the template's field values and tracking the live UTXO set across transactions.
🚧 This recipe is a stub. Outline of what it will cover:
- Manifest, instance and state in practice, and what a wallet has to keep.
- Contract templates: grouping actions under a typed contract with
fields, and theinstance.NAMEnamespace they populate.- Constructors: an action carrying a
create_instanceblock is a constructor — there is no separate flag — and recording the instance ({ "instance": { "template", "fields" } }) with resolved field values.- The state: how covenant outputs are added and spent inputs removed after each broadcast.
provided_inputs: pre-filling a counterparty's UTXO inline (the website-to-wallet integration pattern).
In the meantime, a Last Will covenant builds a template,
a constructor and an instance from scratch, and
ContractTemplate and InstanceCreate
in the field reference list the keys.