Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 the instance.NAME namespace they populate.
  • Constructors: an action carrying a create_instance block 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.