Repository navigation
Description
Replaces #1 with a single general format, delegateed-template/v1. The main changes:
- One schema with a
typeofintent,offchain, oronchainreplaces therenewal-static/v1andboarding-static/v1profiles. - Values are byte templates: JSON literals,
<name>placeholders, and$(…)Arkade VM expressions that read the source transactions. They replace{"literal": …}and{"advertised": i}arguments, so advertisements no longer carry argument bytes and argument data no longer has to fit into the 520-byte advertisement packet. Contracts define their own packet layouts. - One template serves every address of a contract. Per-user values come from source packets through expressions, or, for a chain's first action such as boarding, from
variablessupplied withWatchInstanceorAnnounceOutputs. secretsare decrypted with delegateed's key using covclaimd's ECIES scheme, so delegateed can take over covclaimd's non-interactive VHTLC claims.- Covenant function inputs (
spend.arguments) and non-signature witness items (spend.witness) can be bound. - Packet rules are
copy,drop, andemit, whereemitcomputes the next state. - Fields with defaults can be omitted and are left out of the template ID.
This also addresses the review comments on #1: one template per contract, the type field, and the <name> placeholder syntax with template-declared values.
Delegation templates
Status: draft protocol specification of delegateed-template/v1. It replaces the profile-based earlier draft in #1; the two formats have different schemas and identities.
Overview
A template describes one transaction action that delegateed executes while the owner is offline: boarding, expiry renewal, an off-chain contract call or payment, a collaborative withdrawal, or an on-chain spend. It declares the inputs and the contract path spending each one, the outputs, an optional fee cap, and packet handling. Per-user values, such as owner keys, contract state, or destinations, are not baked in: expressions run on the emulator's Arkade VM derive them from the source transactions, from variables supplied through the API, or from secrets decrypted with the service's key. One template therefore serves every address of a contract.
An instance is a template with ordered source outpoints, the service key context resolved at discovery, and any variable values. Transaction advertisements, address watches, and API announcements discover instances. Discovery only informs; the spending conditions authorize. An action continues a chain only by advertising its outputs, to its own template or another.
A service rejects or keeps disabled any template whose mode, signing requirements, or script features it cannot support. Transport, storage, and scheduling belong to the implementation.
Template
| Field | Default | Meaning |
|---|---|---|
format |
required | Exactly delegateed-template/v1. |
type |
required | Execution mode: intent, offchain, or onchain. |
variables |
{} |
Map from name to scalar type, with values supplied through the API. |
secrets |
{} |
Map from name to secret declaration. |
inputs |
required | 1–255 ordered input slots. |
outputs |
required | 1–255 outputs with explicit indexes. |
fees |
no fee | {from, max}: the input that pays a fee, and its cap. |
packets |
no extension | Packet rules and advertisements. |
Names match [a-z][a-z0-9_]{0,63} and are unique among inputs, among outputs, and among variables and secrets together, which number at most 255. Objects have only their defined fields. Omitting a field and writing its default, including null for fees and packets, are equivalent.
template_id = hex(SHA256(canonical_json))
canonical_json is the template without the fields that equal their defaults, serialized by RFC 8785. Reject duplicate keys, unknown fields, invalid Unicode, and out-of-range values. Hex is lowercase, even-length, and unprefixed outside assembly, array order counts, and amounts are integers up to 2^53 - 1. The ID covers the whole template, including its contract definitions and the literal target self, but not variable values, source outpoints, admission settings, or service keys.
Execution modes
type |
Inputs | Outputs | Execution |
|---|---|---|---|
intent |
Boarding UTXOs and VTXOs. | On-chain and off-chain. | Build the intent proof and register message, obtain authorization, and join settlement. |
offchain |
VTXOs. | Off-chain. | Build the Ark transaction and its checkpoints, obtain signatures, then submit and finalize. |
onchain |
On-chain UTXOs. | On-chain. | Build, sign, and broadcast a Bitcoin transaction. |
Inputs and outputs each have a type, onchain or offchain, which defaults to onchain in an onchain template and to offchain otherwise. An intent requests its onchain outputs in the commitment transaction and its offchain outputs as VTXOs. Its onchain_output_indexes derive from these types, which the covenant must authorize along with the scripts and amounts.
Expiry renewal settles VTXOs into a fresh batch, so it is an intent; an offchain transfer does not refresh the expiry. Boarding is an intent with an onchain input, and its funding transaction needs no ARK extension. An onchain action cannot spend a still-virtual output.
Intent proofs and on-chain transactions use version 2. Off-chain Ark transactions and their checkpoints use version 3 and end with a zero-value anchor output. nLockTime is 0 wherever the builder chooses it, and a path that needs an absolute locktime or another header override is ineligible.
Contracts
An input's contract and an output's locking.contract are {definition, arguments}. definition is an inline executable definition with exactly the contractName, constructorInputs, structs, and functions of the Arkade compiler's ContractJson output. A function has name, optional arkade: {inputs, asm}, and leaves, and a leaf has name, asm, and witness. Function names are unique, as are leaf names within a function, and a function without arkade is a plain tapscript path. From a compiler artifact:
const {contractName, constructorInputs, structs = [], functions} = artifact;
const definition = {contractName, constructorInputs, structs, functions};Keep every function and leaf, in order, since paths the template does not use still shape the Taproot commitment, and leave out compiler metadata. Definitions are always inline and may be written by hand under the same rules. Reject unsupported types and opcodes, unknown fields or placeholders, and <VTXO:...> imports.
arguments, default {}, binds each scalar constructor field once. Arrays and structs flatten in ABI order to names such as owners.0 and policy.owner.
Keys
Service keys come from the configuration and the configured services' GetInfo, never from templates or requests. <SERVER_KEY> is the Ark server's x-only signer key, <EMULATOR_KEY:function> is the emulator key tweaked with that function's instantiated Arkade Script, and <TWEAK:parameter:function> applies the same tweak to a constructor pubkey. Delegateed's tree-cosigner key can be bound as a literal. Delegateed also publishes the public half of a separate decryption key for secrets, and keeps superseded decryption keys while ciphertexts sealed to them may still arrive.
Instances and watches keep the key context they were resolved under, and all contracts of an action use the instance's context. Rotation affects only new registrations; an older output is discovered only through a retained context that rebuilds its script.
Tree construction
Resolve the constructor values, instantiate each covenant, then resolve the tweaked keys and the leaves. L1 tapscripts use 32-byte x-only pubkeys, while covenant constructor pubkeys keep 33 bytes. Opcodes assemble as opcodes, decimal integers and int values as minimal Script numbers, and other values as data pushes; a value is never code.
Flatten the leaves in function order, then leaf order, with leaf version 0xc0, and build the tree as Ark's AssembleTaprootScriptTree does: a single leaf is the root; otherwise pair adjacent leaves, attach an odd last leaf to the last pair's branch, and repeatedly combine the first two branches, appending the parent, until one remains. Reject duplicate leaves. The internal key is BIP 341's unspendable H. The tree must derive the input's actual scriptPubKey and contain the selected leaf. Keep it whole, since Ark validates complete trees for boarding and VTXO inputs.
Values
Bindings
A binding is a JSON integer, which is an int literal, a boolean, which is a bool literal, or a string, which is a byte template.
| Scalar type | Literal | Canonical bytes |
|---|---|---|
pubkey |
Hex of a valid 33-byte compressed key. | Those 33 bytes. |
bytes, bytes20, bytes32 |
Hex. | The raw bytes, of the declared length if fixed. |
asset |
Hex of the 32-byte compiler ABI asset value. | Those 32 bytes. |
int |
JSON integer up to 2^53 - 1 in magnitude. |
Minimal Script number; zero is empty. |
bool |
JSON boolean. | Empty for false, 01 for true. |
Canonical bytes are data without push opcodes. They encode variable values in API requests, what a placeholder inserts, a secret's plaintext, and what a template must decode to. Reject invalid pubkeys, wrong lengths, noncanonical numbers including negative zero, missing or extra bindings, and unsupported types such as signature. The compiler's 32-byte asset is not the 34-byte ARK asset ID used by asset routes.
Byte templates
A byte template concatenates pieces:
| Piece | Contributes |
|---|---|
| Two lowercase hex digits | One byte. |
<name> |
The canonical bytes of a variable or secret. |
$(expression) |
The single element the expression leaves on the stack. |
For example, "5120<receiver_program>" builds a P2TR scriptPubKey, and "$(<preimage> OP_HASH160)" hashes a secret. Hex alone is a literal, and "" is empty. Pieces concatenate outside the VM, so only each expression's result is limited to 520 bytes. A lone <name> must fill a field of that name's type or one that takes any bytes, such as a bytes parameter, a scriptPubKey, or a packet body. Spelling is canonical, so that equal templates hash equally: lowercase hex, and exactly one space between tokens inside $(…).
A template's bytes decode as the field it fills:
| Field | Decodes as |
|---|---|
| Constructor argument, function argument, or witness item | Canonical bytes of its scalar type. |
| Fixed satoshi or asset amount | A positive int up to 2^53 - 1. |
locking |
A scriptPubKey valid for the output's type. |
emit data |
A non-empty packet body; the ARK extension cannot encode an empty one. |
Secret ciphertext |
The ciphertext. |
Expressions
An expression is Arkade assembly: opcode names, decimal integers, lowercase even-length 0x hex, and <name> placeholders, assembled like covenant assembly with values as minimal pushes. It runs on the configured emulator's Arkade VM, with the opcodes, semantics, and limits the emulator applies to covenants, including the 520-byte element limit. It must leave exactly one element, the result, which need not be true: an empty element is a valid zero, false, or byte string.
The VM sees a draft of the action's transaction, which for an intent is the proof with its message input at 0. The draft holds every participating input at its final position, with the final version, sequences, and lock time, and no outputs. Input introspection reports the source outputs, OP_INSPECTINPUTPACKET reads the packets of the transaction that created an input, and time opcodes read the service's clock. Each expression has a context input, which the VM treats as current for OP_PUSHCURRENTINPUTINDEX and OP_PUSHEXPIRY:
| Field | Context input |
|---|---|
An input's contract.arguments, spend.arguments, and spend.witness |
That input. |
An output's value.amount, locking, and asset amounts |
The output's value.from. |
An emit rule's data |
The rule's from. |
A secret's ciphertext |
The secret's from. |
For example, $(2 OP_PUSHCURRENTINPUTINDEX OP_INSPECTINPUTPACKET OP_VERIFY) yields packet 2 of the transaction that created the context input, and fails when it is absent. Script has no loops, so data that an expression must find needs a layout it can address directly.
Expressions cannot observe the transaction being built. Reject opcodes that read its outputs (OP_INSPECTOUTPUT*, OP_INSPECTNUMOUTPUTS, OP_INSPECTOUTASSET*, OP_TUNNEL), its packets and asset groups (OP_INSPECTPACKET, OP_INSPECTNUMASSETGROUPS, OP_INSPECTASSETGROUP*, OP_FINDASSETGROUPBYASSETID), its Emulator packet or intent message (OP_INSPECTINPUTARKADE*, OP_INSPECTINTENTMESSAGE), or its final serialization or signature hash (OP_TXID, OP_TXWEIGHT, OP_SIGHASH, OP_CHECKSIG, OP_CHECKSIGVERIFY, OP_CHECKSIGADD). An expression is context-free when it uses no opcode that reads the draft, a source transaction, an expiry, or the clock, and every secret it names is context-free. A template is context-free when its expressions and the secrets it names are.
Evaluate once the input layout is final, including any combination with other instances. A failed evaluation, a stack other than one element, or bytes that fail decoding make the action ineligible; there is no fallback. Templates propose values, and the covenant, run by the emulator on the final transaction, authorizes them. Both use the same VM, so a template can parse a packet with the instructions its covenant uses to check it.
Variables
variables maps names to scalar types. WatchInstance and AnnounceOutputs supply one value for each, which the instance keeps for its lifetime. Advertisements carry no values, so a template with variables cannot be an advertisement target, and successors never inherit variables: a value a successor needs travels in the transaction, usually in a packet the action writes. Variables serve chains whose first source carries no usable data, such as a payment to a boarding address. The emulator never sees them, so a covenant can check a variable's value only after an action writes it into a transaction.
Secrets
secrets maps names to {type, from, ciphertext}: a scalar type, the context input, and a template for the ciphertext, which may read a packet or insert a variable but cannot name a secret. <name> inserts the plaintext like a variable.
Decryption uses covclaimd's ECIES over secp256k1, so a client that seals values for covclaimd needs only delegateed's public key. A ciphertext is ephemeral_pubkey[33] || nonce[12] || sealed, where sealed is AES-256-GCM output with its 16-byte tag. The key is HKDF-SHA256 over the x-coordinate of the ECDH point of the service and ephemeral keys, with covclaimd/preimage/v1 as info and the compressed ephemeral key as both salt and associated data. The plaintext decodes as type. A malformed ciphertext, failed authentication under every retained key, or a plaintext that fails decoding makes the action ineligible.
A secret is context-free when its ciphertext template is. Decrypt for each attempt, and never log or persist a plaintext. A plaintext placed in a transaction, such as a preimage in a witness, becomes public once sent, so validate the complete action first. The scheme binds a ciphertext to no template or transaction: any template that reads it can have it decrypted, so give ciphertexts only to parties trusted to direct their use.
Inputs
| Field | Default | Meaning |
|---|---|---|
name |
required | Slot name. |
type |
by template type |
onchain or offchain. |
sequence |
4294967295 |
Unsigned 32-bit sequence. |
schedule |
{"immediate": true} |
When the input becomes eligible. |
contract |
required | {definition, arguments}. |
spend |
required | {function, leaf, arguments, witness}, where arguments defaults to [] and witness to {}. |
Source outpoints are instance data in slot order and must be distinct, including across type labels. An advertisement binds only outputs of its own transaction, a watch requires a single-input template, and AnnounceOutputs can bind several transactions and domains. An action consumes its whole group atomically.
| Schedule | Meaning |
|---|---|
{"immediate": true} |
Eligible once all spending and admission conditions hold. |
{"before_expiry_seconds": n} |
Off-chain only: a positive 32-bit lead time before expiry. |
{"min_confirmations": n} |
On-chain only: a positive 32-bit confirmation count. |
A group's schedules must all hold: its window opens at the latest expiry-window start, every input must still be spendable when the action completes, and an empty intersection makes it ineligible. Script and sequence timelocks still apply, and a block delay is never approximated in seconds. Boarding inputs also obey the server's boarding rules, such as its minimum exit delay, amount limits, and an eligibility deadline that no schedule extends. Avoid concurrent attempts on the same inputs.
spend.arguments binds the function's covenant inputs in flattened ABI order, and a plain tapscript function takes none. spend.witness binds each item of the leaf's witness metadata whose type is not signature, decoded as that type. Bound items go into the witness of the spend and of every checkpoint that spends the same leaf. Signatures are never bound: they are gathered at execution, and templates hold no keys or signatures.
Run an Arkade function's covenant in the actual execution context, and require the leaf to enforce the tweaked emulator key and the server signer wherever Ark requires them. Witness metadata must match the script. No path may need an unavailable owner signature or an unbound item that is not a signature, and an injected marker alone grants no signing capability. In an onchain action, covenant authorization counts only if a supported signer enforces it before signing that exact spend.
Outputs
Each output has name, index, value, and locking, plus type, which defaults as for inputs, and assets, which defaults to []. index is an absolute unsigned 16-bit position, as described under placement.
| Field | Form | Meaning |
|---|---|---|
value |
{"from": input} |
The input's satoshis left after fixed draws and any fee. |
value |
{"from": input, "amount": a} |
A fixed draw from the input. |
locking |
{"from": input} |
The input's scriptPubKey and contract. |
locking |
A template | The template's bytes. |
locking |
{"contract": construction} |
The contract's scriptPubKey. |
assets entry |
{"from": input} |
All of the input's remaining assets. |
assets entry |
{"from": input, "asset": id} |
The rest of one asset. |
assets entry |
{"from": input, "asset": id, "amount": a} |
A fixed amount of one asset. |
Asset IDs are hex of the 34-byte ARK asset ID, and an amount is a positive integer or a template that decodes to one. Off-chain outputs must be Ark-compatible P2TR, and on-chain outputs may use any script the backend accepts. Building a script implies no authority over it, and copying one advertises nothing.
Each input balances separately:
- Fixed draws must be available in full, and a fixed draw of an absent asset makes the action ineligible. Exactly one output takes the satoshi remainder, which also pays any fee.
- Each asset has at most one named remainder route and each input at most one catch-all, applied after the named routes. A route for an absent asset receives zero, and a positive balance without a route is rejected as a loss.
- An output lists each input/asset or input/catch-all pair at most once. Balances of one asset in one output combine, and zero balances are left out of the Assets packet.
- On-chain inputs and outputs carry no ARK assets. Input balances come from the configured source, not the template.
- Every output must meet its backend's amount and script rules, and a dust remainder is never dropped or added to the fee.
Per instance, input satoshis equal output satoshis plus the fee, and assets are preserved exactly, with no issuance, reissuance, burning, or undeclared transfer. A computed draw cannot span inputs.
Fees
Without fees, no satoshis may go to a transaction or protocol fee. {from, max} names the paying input and an unsigned cap: the actual fee is between 0 and max, and every draw and remainder must remain valid after it.
type |
The fee is |
|---|---|
intent |
A charge the Ark service requires for the intent, not the commitment transaction's miner fee. |
offchain |
Not permitted, so fees is omitted. |
onchain |
The signed transaction's miner fee. |
Where the server requires an intent charge, a zero-fee template is ineligible; a service never inserts a hidden deduction. On-chain, estimate from the actual paths and weight, verify the signed transaction, and never broadcast over the cap. A replacement keeps the recipients and routing, stays within the cap, and is signed and validated again. Fee sponsorship, extra wallet inputs, and undeclared change are unsupported.
A delegatee service payment is an ordinary fixed output to a static scriptPubKey, committed by the template ID and authorized by the covenant. It uses no fee budget and recurs on every execution.
Output placement
With M outputs, the declared indexes plus packets.output_index fill 0..M exactly once, or 0..M-1 without an extension. A contribution to a combined action may leave gaps that other instances fill. Indexes never shift to resolve a collision. The extension has value zero.
An intent with V off-chain outputs is laid out as off-chain [0..V-1] || extension [V] || on-chain, and without off-chain outputs an extension sits at proof index 0 as proof metadata. Ark's settlement builder keeps the off-chain outputs and the extension at their indexes in the leaf but moves on-chain outputs into the commitment transaction, so their outpoints are recorded after settlement.
In offchain and onchain actions, indexes are positions in the spend transaction. Anchors and other outputs a backend requires need defined positions, values, and funding that agree with the covenant and accounting, and never shift the declared outputs.
Packets
Without packets, the action emits no ARK extension. A packet object has a required unsigned 16-bit output_index, unmatched, which is reject or drop and defaults to reject, and the arrays rules and advertise, which default to []. The extension holds packets in ascending type order, at most one per type.
Types 0x00 (Assets), 0x01 (Emulator), and 0x05 (Delegation Advertisement, assigned here) are generated as needed, and rules cannot name them. A packet object is required whenever the action generates, advertises, or writes a packet, or its sources carry application packets. Rules handle types 2..255 except 5:
| Rule | Meaning |
|---|---|
{"type": n, "action": "copy", "from": input} |
Require packet n in the input's source transaction and emit it unchanged. |
{"type": n, "action": "drop", "from": input} |
Consume packet n without emitting it, whether or not it is present. |
{"type": n, "action": "emit", "from": input, "data": template} |
Emit the template's bytes as packet n, replacing the source packet whether or not it is present. |
from names a source transaction, so inputs created by one transaction share its packets; for emit, it is also the context input. For each source transaction and type, identical rules combine, a drop combines with an emit, and a copy conflicts with either; a drop from one source does not block an emit from another. A template has at most one emit per type, and emissions of one type by different instances combine only when identical. A missing copied packet fails construction.
Source application packets that no participating rule handles are unmatched: construction fails if any affected instance says reject, and otherwise drops them. A state transition is therefore a single emit. Malformed extensions are rejected, and a source without an extension has no packets, so an ordinary payer never adds a payload.
Contracts define their packet layouts, and templates parse them with expressions. A packet that a covenant or expression reads is one stack element, so it is at most 520 bytes.
Advertisements
A packets.advertise entry is {template, outputs}: a registered template ID or self, and distinct output names in the target's input-slot order, one per slot. A target declares no variables, and an output appears in at most one entry.
Validate each entry under the action's key context by evaluating the target's constructor bindings with the advertising transaction as their source, and require every rebuilt scriptPubKey and input type to match its output. For an intent, that transaction is the settlement leaf, which carries the intent's packets: check against the proof before settlement and against the leaf after. The target must be registered, enabled, and supported. A mismatch or failed evaluation is an error, even for a literal destination. A successor therefore gets its values only from the transaction, usually from packets the action emits.
Advertised outputs must coexist in the advertising transaction, so an intent advertises only its off-chain outputs, and its on-chain outputs are discovered after settlement through the API or a watch. An onchain action may advertise its own outputs if its backend supports the extension. A target that needs outputs of several transactions requires AnnounceOutputs.
Continuation is never implicit: an unadvertised output ends the chain unless a watch or announcement finds it. The covenant must enforce any advertisement its path promises, including the target ID, the output bindings, and the packets the target reads, and it locates source records by their actual input bindings. A renewing covenant finds its own ID in its source's advertisement, since self is never injected into assembly. A boarding covenant takes the renewal template's ID as a literal argument, which avoids a circular hash. A copied advertisement is valid only if its records and indexes still hold.
Wire format
Packet type 0x05 has this body:
advertisement = version:u8 || record...
record = body_length:u16le || body
body = template_id[32] || output_index:u16le...
version is 0x01, IDs are 32 raw bytes with self resolved, and body_length excludes its own prefix. A record holds one output index per target input slot, in slot order, and nothing else. The packet is omitted when there are no records. Reject unknown versions, bodies shorter than an ID, truncation, partial trailing records, and packets over 520 bytes, prefixes included, so that a covenant can read the packet as one element; at most 14 single-output records of 36 bytes fit. Readers skip records of unknown targets by length, and for known targets reject wrong counts, invalid indexes, overlapping groups, and type mismatches. Writers sort records by their smallest index but never sort the indexes within a record, which bind slots. A template may appear in several records.
one output 01 || 22 00 || T[32] || 00 00
two outputs 01 || 24 00 || T[32] || 00 00 || 01 00
two records 01 || 22 00 || A[32] || 00 00 || 22 00 || B[32] || 01 00
In Script
A covenant reads the advertisement it writes with tx.packet(5) and a source's with tx.inputs[i].packet(5), without building the ARK envelope:
// advertise targetTemplate at output 0
require(tx.packet(5) == 0x012200 + targetTemplate + 0x0000);
// the successor reads the owner key from packet 2
require(tx.packet(2) == owner);
// encode an index in 0..65535; num2bin is signed magnitude
require(outputIndex >= 0);
require(outputIndex <= 65535);
let encodedIndex = substr(num2bin(outputIndex, 3), 0, 2);
// keep an unchanged advertisement
require(tx.packet(5) == tx.inputs[this.activeInputIndex].packet(5));
To decode an index, append a zero sign byte before bin2num. These fragments complement the covenant's authorization, timing, fee, classification, and value checks. An announcement cannot make the last check pass for a source without an advertisement, so a chain's first action needs a covenant that accepts its actual source.
Discovery
A payer may know only an address, and a third-party wallet funding a boarding address adds no metadata, so the receiving application associates the template through the API. Neither a watch nor an announcement grants authority over a path that needs an unavailable owner signature.
Watches
WatchInstance(template, variables, expires_at) watches a single-input template's address for payments and returns the address. variables, default {}, maps each declared variable to its canonical value in hex, and the optional expires_at is a Unix time in seconds. The input's constructor bindings must be context-free, because the address precedes any source. Secrets they use are decrypted at registration, and a failure rejects the request. The input type selects the Bitcoin or Ark VTXO source, and the rebuilt contract and retained key context determine the address.
Each matching payment is a separate candidate. A watch lasts until it is removed, disabled, or reaches expires_at, and may also find existing outputs within an operator-set range. Repeating a request returns the existing watch, and ending a watch stops discovery without cancelling accepted instances. A caller that already knows its address must check that the returned one matches.
Announcements
AnnounceOutputs(template, outputs, variables) binds one existing group without subscribing. template is a registered, enabled ID, outputs lists one {txid, vout} per slot in slot order, with txid in display order, and variables is as for watches. Each slot's type selects its source domain, so a request may span transactions and domains. Callers cannot supply backend URLs or keys.
Anyone may announce, subject to admission. Fetch the sources independently and require existence, unspent status, valid amounts and assets, accepted VTXO status or a confirmation, a supported key context, and matching rebuilt scripts. An unknown or unconfirmed output allocates no tracking, and the caller retries. Success acknowledges tracking, not execution. Equivalent requests are idempotent across all discovery methods, and conflicting bindings are rejected.
An announcement is discovery data only: it cannot fabricate packets, signatures, balances, or confirmations, and a variable never replaces a missing source packet. An address commits only to scripts, so a variable used only in function arguments, outputs, or packets must be authorized by the covenant and the admission policy.
Admission
Template registration, watches, and announcements require admission, such as quotas, operator approval, or payment, because valid addresses can be generated without limit. Admission may bound expires_at, and an announcement never enables a template or creates a watch. Before allocating work, bound request size, definition and expression complexity, value lengths, decryption attempts, source lookups, and validation, and rate-limit even valid announcements. Keep nothing for invalid requests, and recheck source status before every attempt.
Combining and lifecycle
Each instance balances independently and consumes all its inputs. Instances share an action only if their execution types, key contexts, signers, paths, output layouts, fees, and packet results agree; index collisions, duplicate inputs, incompatible schedules, and conflicting packets rule it out. Instances that emit different bodies for one packet type, such as renewals with different owners in packet 2, run as separate intents, possibly in one batch.
Order groups by their smallest source key (input type, displayed txid, vout), with onchain first and vout compared numerically, and keep each group's slot order. Intent proof inputs start at 1, after the message input, and spend transaction inputs at 0, so covenants must authorize the actual positions. Discovery evaluates a group's bindings as if it executed alone, and a combination that changes a rebuilt script is invalid.
A combined action has one extension, at a position every packet object agrees on, so an instance without packets cannot join an action that needs one. Intent contributions jointly keep the off-chain, extension, on-chain order. A positive fee requires exactly one instance with fees, which pays all of it within its cap and must authorize the whole action; otherwise the instances execute separately.
Validate the complete action before requesting signatures: an intent's proof, message, leaf, boarding inputs, forfeits, and outputs; an off-chain transaction and its checkpoints through finalization; an on-chain transaction through broadcast and confirmation. Afterwards, derive successor outpoints from the finalized transactions, validate them, and retain the templates, variables, keys, and consumed sources. Deduplicate submissions and reconcile uncertain results before retrying, since a timeout does not prove the inputs unspent.
A consumed input invalidates its group, and a failed attempt consumes nothing. A spend through another path ends handling. Successors need their own advertisement, watch, or announcement, and missing data is not termination. Local revocations apply to every discovery method.
Examples
IDs, transaction IDs, scripts, and keys are mock values, and the IDs are not hashes of these examples. A string beginning EXAMPLE ONLY: stands for content to supply before hashing. In definitions, angle brackets name service keys and constructor parameters; in templates, they name variables and secrets. The covenants must enforce the behavior described, since template rules alone authorize nothing. No example needs the owner at execution time.
Renewal
DelegatedVtxo has an owner path, a delayed server reclaim, and a renew path. Its covenant renews into a fresh batch within the window, preserves value, script, and assets, requires packet 2 to equal owner, and keeps the advertisement. The template reads the owner key from packet 2 of the source transaction.
{
"format": "delegateed-template/v1",
"type": "intent",
"inputs": [
{
"name": "funds",
"schedule": {"before_expiry_seconds": 1024},
"contract": {
"definition": {
"contractName": "DelegatedVtxo",
"constructorInputs": [{"name": "owner", "type": "pubkey"}],
"structs": [],
"functions": [
{
"name": "spend",
"leaves": [
{
"name": "spend",
"asm": ["<SERVER_KEY>", "OP_CHECKSIGVERIFY", "<owner>", "OP_CHECKSIG"],
"witness": [
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true},
{"name": "ownerSig", "type": "signature", "encoding": "schnorr-64"}
]
}
]
},
{
"name": "delayed_server_spend",
"leaves": [
{
"name": "delayed_server_spend",
"asm": ["4194306", "OP_CHECKSEQUENCEVERIFY", "OP_DROP", "<SERVER_KEY>", "OP_CHECKSIG"],
"witness": [
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
}
]
},
{
"name": "renew",
"arkade": {"inputs": [], "asm": ["EXAMPLE ONLY: zero-fee renewal covenant ASM omitted"]},
"leaves": [
{
"name": "renew",
"asm": ["<SERVER_KEY>", "OP_CHECKSIGVERIFY", "<EMULATOR_KEY:renew>", "OP_CHECKSIG"],
"witness": [
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true},
{"name": "emulatorSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
}
]
}
]
},
"arguments": {"owner": "$(2 OP_PUSHCURRENTINPUTINDEX OP_INSPECTINPUTPACKET OP_VERIFY)"}
},
"spend": {"function": "renew", "leaf": "renew"}
}
],
"outputs": [
{
"name": "renewed",
"index": 0,
"value": {"from": "funds"},
"locking": {"from": "funds"},
"assets": [{"from": "funds"}]
}
],
"packets": {
"output_index": 1,
"rules": [{"type": 2, "action": "copy", "from": "funds"}],
"advertise": [{"template": "self", "outputs": ["renewed"]}]
}
}Let R be this template's ID once its covenant is filled in; the examples use 1111…1111. A 100,000-satoshi VTXO renews into a 100,000-satoshi VTXO at index 0, advertised as 01 || 22 00 || R || 00 00, with packet 2 copied. Alice and Bob share R, but the different owner keys in their packet 2 give them different addresses and separate intents. A VTXO whose source lacks packet 2 cannot be renewed by R; it enters the chain through a template that writes packet 2, as boarding does. The delay is the BIP 68 encoding of 1,024 seconds.
Boarding
The operator registers one boarding template for all wallets. DelegatedBoarding takes the owner key and the renewal template's ID. Its board covenant accepts a funding transaction without an extension and boards the full value into DelegatedVtxo for the same owner, requiring packet 2 to equal owner and the output to be advertised to R.
{
"format": "delegateed-template/v1",
"type": "intent",
"variables": {"owner": "pubkey"},
"inputs": [
{
"name": "deposit",
"type": "onchain",
"schedule": {"min_confirmations": 1},
"contract": {
"definition": {
"contractName": "DelegatedBoarding",
"constructorInputs": [
{"name": "owner", "type": "pubkey"},
{"name": "renewalTemplate", "type": "bytes32"}
],
"structs": [],
"functions": [
{
"name": "spend",
"leaves": [
{
"name": "spend",
"asm": ["<SERVER_KEY>", "OP_CHECKSIGVERIFY", "<owner>", "OP_CHECKSIG"],
"witness": [
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true},
{"name": "ownerSig", "type": "signature", "encoding": "schnorr-64"}
]
}
]
},
{
"name": "exit",
"leaves": [
{
"name": "exit",
"asm": ["4194306", "OP_CHECKSEQUENCEVERIFY", "OP_DROP", "<owner>", "OP_CHECKSIG"],
"witness": [{"name": "ownerSig", "type": "signature", "encoding": "schnorr-64"}]
}
]
},
{
"name": "board",
"arkade": {"inputs": [], "asm": ["EXAMPLE ONLY: boarding covenant ASM omitted"]},
"leaves": [
{
"name": "board",
"asm": ["<SERVER_KEY>", "OP_CHECKSIGVERIFY", "<EMULATOR_KEY:board>", "OP_CHECKSIG"],
"witness": [
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true},
{"name": "emulatorSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
}
]
}
]
},
"arguments": {
"owner": "<owner>",
"renewalTemplate": "1111111111111111111111111111111111111111111111111111111111111111"
}
},
"spend": {"function": "board", "leaf": "board"}
}
],
"outputs": [
{
"name": "funds",
"index": 0,
"value": {"from": "deposit"},
"locking": {
"contract": {
"definition": "EXAMPLE ONLY: the DelegatedVtxo definition of the renewal example",
"arguments": {"owner": "<owner>"}
}
}
}
],
"packets": {
"output_index": 1,
"rules": [{"type": 2, "action": "emit", "from": "deposit", "data": "<owner>"}],
"advertise": [
{"template": "1111111111111111111111111111111111111111111111111111111111111111", "outputs": ["funds"]}
]
}
}Let B be this template's ID, mocked as 2222…2222. A wallet opting in to delegated boarding calls WatchInstance once:
{
"template": "2222222222222222222222222222222222222222222222222222222222222222",
"variables": {"owner": "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"}
}Delegateed returns the boarding address, and the wallet checks that it equals its own. From then on, any Bitcoin wallet can pay the address without an extension or any knowledge of delegateed. For a one-off payment without a watch, the application instead announces the confirmed funding output:
{
"template": "2222222222222222222222222222222222222222222222222222222222222222",
"outputs": [{"txid": "3333333333333333333333333333333333333333333333333333333333333333", "vout": 0}],
"variables": {"owner": "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"}
}Delegateed builds the boarding intent with packet 2 holding the owner key, and the new VTXO advertises R. Renewals follow R from there, reading the owner key from packet 2 each time. Ark's boarding rules still apply, and an ordinary boarding address whose path needs the owner's signature cannot become noninteractive by registering B.
Counter
Two outputs of one source transaction, counter and reserve, renew together. Packet 2 of their source holds an 8-byte Script number that each renewal increments, and the covenants enforce the increment.
{
"format": "delegateed-template/v1",
"type": "intent",
"inputs": [
{
"name": "counter",
"schedule": {"before_expiry_seconds": 1024},
"contract": {
"definition": {
"contractName": "Counter",
"constructorInputs": [],
"structs": [],
"functions": [
{
"name": "delayed_server_spend",
"leaves": [
{
"name": "delayed_server_spend",
"asm": ["4194306", "OP_CHECKSEQUENCEVERIFY", "OP_DROP", "<SERVER_KEY>", "OP_CHECKSIG"],
"witness": [
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
}
]
},
{
"name": "renew",
"arkade": {"inputs": [], "asm": ["EXAMPLE ONLY: counter renewal covenant ASM omitted"]},
"leaves": [
{
"name": "renew",
"asm": ["<SERVER_KEY>", "OP_CHECKSIGVERIFY", "<EMULATOR_KEY:renew>", "OP_CHECKSIG"],
"witness": [
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true},
{"name": "emulatorSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
}
]
}
]
}
},
"spend": {"function": "renew", "leaf": "renew"}
},
{
"name": "reserve",
"schedule": {"before_expiry_seconds": 1024},
"contract": {
"definition": "EXAMPLE ONLY: the Reserve definition, shaped like Counter's with its own renew covenant"
},
"spend": {"function": "renew", "leaf": "renew"}
}
],
"outputs": [
{
"name": "next_counter",
"index": 0,
"value": {"from": "counter"},
"locking": {"from": "counter"},
"assets": [{"from": "counter"}]
},
{
"name": "next_reserve",
"index": 1,
"value": {"from": "reserve"},
"locking": {"from": "reserve"},
"assets": [{"from": "reserve"}]
}
],
"packets": {
"output_index": 2,
"rules": [
{
"type": 2,
"action": "emit",
"from": "counter",
"data": "$(2 OP_PUSHCURRENTINPUTINDEX OP_INSPECTINPUTPACKET OP_VERIFY OP_BIN2NUM OP_1ADD 8 OP_NUM2BIN)"
}
],
"advertise": [{"template": "self", "outputs": ["next_counter", "next_reserve"]}]
}
}With source outputs [3, 7], the slots become proof inputs [1, 2], the outputs are [next_counter, next_reserve, extension], and the advertisement is 01 || 24 00 || T || 00 00 || 01 00. The emit expression runs with input 1 as its current input, so body 0500000000000000 becomes 0600000000000000. Since both slots share a source transaction, the one rule also handles the packet seen through reserve. Separate templates could instead contribute outputs 0 and 1 around a shared extension at 2, advertising two records; if both groups come from one transaction, one template's rule handles the packet for both.
Mixed payment
A template whose pay covenant authorizes a 25,000-satoshi on-chain payment, with off-chain change at the original script, declares these outputs and packets. Without an advertisement, the chain ends here.
{
"outputs": [
{
"name": "change",
"index": 0,
"value": {"from": "funds"},
"locking": {"from": "funds"},
"assets": [{"from": "funds"}]
},
{
"name": "payment",
"type": "onchain",
"index": 2,
"value": {"from": "funds", "amount": 25000},
"locking": "5120f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9"
}
],
"packets": {"output_index": 1}
}A 100,000-satoshi input yields the proof outputs [75,000-satoshi VTXO, extension, 25,000-satoshi payment] and onchain_output_indexes: [2]. The leaf keeps the VTXO and extension at 0 and 1, and the payment's commitment outpoint is found after settlement.
Non-interactive VHTLC claim
This template does covclaimd's job: it claims a VHTLC while the receiver is offline. The definition reproduces the nine leaves of the SDK's VHTLC.ScriptV2 with the non-interactive suite, in order, so it derives the SDK's address. Both covenants are complete EnforcePayTo assembly: the output at the input's index must pay the destination program at least the input's value. The preimage hash comes from the decrypted preimage and every other value from a variable, so the input's bindings are context-free and the address can be watched before funding. Delays are BIP 68 values, and the refund locktime is a Unix time.
{
"format": "delegateed-template/v1",
"type": "offchain",
"variables": {
"sender": "pubkey",
"receiver": "pubkey",
"refund_locktime": "int",
"unilateral_claim_delay": "int",
"unilateral_refund_delay": "int",
"unilateral_refund_without_receiver_delay": "int",
"receiver_program": "bytes32",
"sender_program": "bytes32",
"ciphertext": "bytes"
},
"secrets": {"preimage": {"type": "bytes32", "from": "htlc", "ciphertext": "<ciphertext>"}},
"inputs": [
{
"name": "htlc",
"contract": {
"definition": {
"contractName": "VHTLC",
"constructorInputs": [
{"name": "sender", "type": "pubkey"},
{"name": "receiver", "type": "pubkey"},
{"name": "preimageHash", "type": "bytes20"},
{"name": "refundLocktime", "type": "int"},
{"name": "unilateralClaimDelay", "type": "int"},
{"name": "unilateralRefundDelay", "type": "int"},
{"name": "unilateralRefundWithoutReceiverDelay", "type": "int"},
{"name": "receiverProgram", "type": "bytes32"},
{"name": "senderProgram", "type": "bytes32"}
],
"structs": [],
"functions": [
{
"name": "claim",
"leaves": [
{
"name": "claim",
"asm": [
"OP_SIZE", "32", "OP_EQUALVERIFY", "OP_HASH160", "<preimageHash>", "OP_EQUAL", "OP_VERIFY",
"<receiver>", "OP_CHECKSIGVERIFY", "<SERVER_KEY>", "OP_CHECKSIG"
],
"witness": [
{"name": "preimage", "type": "bytes32", "encoding": "raw"},
{"name": "receiverSig", "type": "signature", "encoding": "schnorr-64"},
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
}
]
},
{
"name": "refund",
"leaves": [
{
"name": "refund",
"asm": [
"<sender>", "OP_CHECKSIGVERIFY", "<receiver>", "OP_CHECKSIGVERIFY", "<SERVER_KEY>",
"OP_CHECKSIG"
],
"witness": [
{"name": "senderSig", "type": "signature", "encoding": "schnorr-64"},
{"name": "receiverSig", "type": "signature", "encoding": "schnorr-64"},
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
}
]
},
{
"name": "refundWithoutReceiver",
"leaves": [
{
"name": "refundWithoutReceiver",
"asm": [
"<refundLocktime>", "OP_CHECKLOCKTIMEVERIFY", "OP_DROP", "<sender>", "OP_CHECKSIGVERIFY",
"<SERVER_KEY>", "OP_CHECKSIG"
],
"witness": [
{"name": "senderSig", "type": "signature", "encoding": "schnorr-64"},
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
}
]
},
{
"name": "unilateralClaim",
"leaves": [
{
"name": "unilateralClaim",
"asm": [
"OP_SIZE", "32", "OP_EQUALVERIFY", "OP_HASH160", "<preimageHash>", "OP_EQUAL", "OP_VERIFY",
"<unilateralClaimDelay>", "OP_CHECKSEQUENCEVERIFY", "OP_DROP", "<receiver>", "OP_CHECKSIG"
],
"witness": [
{"name": "preimage", "type": "bytes32", "encoding": "raw"},
{"name": "receiverSig", "type": "signature", "encoding": "schnorr-64"}
]
}
]
},
{
"name": "unilateralRefund",
"leaves": [
{
"name": "unilateralRefund",
"asm": [
"<unilateralRefundDelay>", "OP_CHECKSEQUENCEVERIFY", "OP_DROP", "<sender>",
"OP_CHECKSIGVERIFY", "<receiver>", "OP_CHECKSIG"
],
"witness": [
{"name": "senderSig", "type": "signature", "encoding": "schnorr-64"},
{"name": "receiverSig", "type": "signature", "encoding": "schnorr-64"}
]
}
]
},
{
"name": "unilateralRefundWithoutReceiver",
"leaves": [
{
"name": "unilateralRefundWithoutReceiver",
"asm": [
"<unilateralRefundWithoutReceiverDelay>", "OP_CHECKSEQUENCEVERIFY", "OP_DROP", "<sender>",
"OP_CHECKSIG"
],
"witness": [{"name": "senderSig", "type": "signature", "encoding": "schnorr-64"}]
}
]
},
{
"name": "nonInteractiveClaim",
"arkade": {
"inputs": [],
"asm": [
"OP_PUSHCURRENTINPUTINDEX", "OP_DUP", "OP_INSPECTOUTPUTSCRIPTPUBKEY", "1", "OP_EQUALVERIFY",
"<receiverProgram>", "OP_EQUALVERIFY", "OP_INSPECTOUTPUTVALUE", "OP_PUSHCURRENTINPUTINDEX",
"OP_INSPECTINPUTVALUE", "OP_GREATERTHANOREQUAL"
]
},
"leaves": [
{
"name": "nonInteractiveClaim",
"asm": [
"OP_SIZE", "32", "OP_EQUALVERIFY", "OP_HASH160", "<preimageHash>", "OP_EQUAL", "OP_VERIFY",
"<SERVER_KEY>", "OP_CHECKSIGVERIFY", "<EMULATOR_KEY:nonInteractiveClaim>", "OP_CHECKSIG"
],
"witness": [
{"name": "preimage", "type": "bytes32", "encoding": "raw"},
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true},
{"name": "emulatorSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
}
]
},
{
"name": "nonInteractiveRefund",
"arkade": {
"inputs": [],
"asm": [
"OP_PUSHCURRENTINPUTINDEX", "OP_DUP", "OP_INSPECTOUTPUTSCRIPTPUBKEY", "1", "OP_EQUALVERIFY",
"<senderProgram>", "OP_EQUALVERIFY", "OP_INSPECTOUTPUTVALUE", "OP_PUSHCURRENTINPUTINDEX",
"OP_INSPECTINPUTVALUE", "OP_GREATERTHANOREQUAL"
]
},
"leaves": [
{
"name": "nonInteractiveRefund",
"asm": [
"<SERVER_KEY>", "OP_CHECKSIGVERIFY", "<receiver>", "OP_CHECKSIGVERIFY",
"<EMULATOR_KEY:nonInteractiveRefund>", "OP_CHECKSIG"
],
"witness": [
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true},
{"name": "receiverSig", "type": "signature", "encoding": "schnorr-64"},
{"name": "emulatorSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
},
{
"name": "nonInteractiveRefundWithoutReceiver",
"asm": [
"<refundLocktime>", "OP_CHECKLOCKTIMEVERIFY", "OP_DROP", "<SERVER_KEY>",
"OP_CHECKSIGVERIFY", "<EMULATOR_KEY:nonInteractiveRefund>", "OP_CHECKSIG"
],
"witness": [
{"name": "serverSig", "type": "signature", "encoding": "schnorr-64", "injected": true},
{"name": "emulatorSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
}
]
}
]
},
"arguments": {
"sender": "<sender>",
"receiver": "<receiver>",
"preimageHash": "$(<preimage> OP_HASH160)",
"refundLocktime": "<refund_locktime>",
"unilateralClaimDelay": "<unilateral_claim_delay>",
"unilateralRefundDelay": "<unilateral_refund_delay>",
"unilateralRefundWithoutReceiverDelay": "<unilateral_refund_without_receiver_delay>",
"receiverProgram": "<receiver_program>",
"senderProgram": "<sender_program>"
}
},
"spend": {
"function": "nonInteractiveClaim",
"leaf": "nonInteractiveClaim",
"witness": {"preimage": "<preimage>"}
}
}
],
"outputs": [
{
"name": "payout",
"index": 0,
"value": {"from": "htlc"},
"locking": "5120<receiver_program>",
"assets": [{"from": "htlc"}]
}
],
"packets": {"output_index": 1, "unmatched": "drop"}
}Let C be this template's ID, mocked as 4444…4444. When a swap is quoted, the receiver's wallet seals the preimage to delegateed's key and registers the watch; the ciphertext is a mock 93 bytes:
{
"template": "4444444444444444444444444444444444444444444444444444444444444444",
"variables": {
"sender": "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
"receiver": "02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5",
"refund_locktime": "c07dc06a",
"unilateral_claim_delay": "020040",
"unilateral_refund_delay": "030040",
"unilateral_refund_without_receiver_delay": "040040",
"receiver_program": "2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4",
"sender_program": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
"ciphertext": "02f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9000102030405060708090a0b777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777"
},
"expires_at": 1791000000
}The integers are Script numbers: a refund locktime of 1,791,000,000 and delays of 1,024, 1,536, and 2,048 seconds. Delegateed decrypts the preimage, derives the VHTLC address, and returns it, and the wallet checks it against the quote. The solver funds that address. Delegateed then decrypts again, builds a claim paying the value and any assets to 5120 || receiver_program, puts the preimage in the claim leaf's witness on the transaction and its checkpoints, and submits it. The revealed preimage lets the solver settle its side. The watch ends at expires_at, the refund locktime, after which the sender can refund.
On-chain spend with a fee cap
OnchainRelease binds the delegatee signer as a literal delegate argument. Its plain tapscript release path has no covenant, and the configured signing policy authorizes the fixed recipient and cap.
{
"format": "delegateed-template/v1",
"type": "onchain",
"inputs": [
{
"name": "funds",
"schedule": {"min_confirmations": 1},
"contract": {
"definition": {
"contractName": "OnchainRelease",
"constructorInputs": [{"name": "delegate", "type": "pubkey"}],
"structs": [],
"functions": [
{
"name": "release",
"leaves": [
{
"name": "release",
"asm": ["<delegate>", "OP_CHECKSIG"],
"witness": [
{"name": "delegateSig", "type": "signature", "encoding": "schnorr-64", "injected": true}
]
}
]
}
]
},
"arguments": {"delegate": "02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5"}
},
"spend": {"function": "release", "leaf": "release"}
}
],
"outputs": [
{
"name": "payment",
"index": 0,
"value": {"from": "funds"},
"locking": "5120f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9"
}
],
"fees": {"from": "funds", "max": 1000}
}A 100,000-satoshi input with a 600-satoshi miner fee pays 99,400. A required fee above 1,000 satoshis makes the action ineligible.
Service payment
A service-fee variant of the renewal could add this output at index 1 and move the extension to 2, still without fees:
{
"name": "delegatee_payment",
"index": 1,
"value": {"from": "funds", "amount": 330},
"locking": "5120c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5"
}A 100,000-satoshi input then renews 99,670 satoshis and pays the delegatee 330, if the output minimum allows. Only the renewed output is advertised. Its covenant must authorize the payment, so the variant is a different template, not a change to R.
Out of scope
Expressions compute values within the declared structure: they cannot add inputs or outputs, move indexes, or observe the transaction being built. This version has no interactive secret collection, context-bound encryption, asset issuance or burning, key migration, exit transaction graphs, absolute locktimes, or fee sponsorship. An implementation may enable a subset of the modes, definitions, and binding forms.
Activity