ReadonlyclaimReadonlyleavesOptional ReadonlynonOptional ReadonlynonOptional ReadonlynonOptional ReadonlynonOptional ReadonlynonOptional ReadonlynonReadonlyoptionsReadonlypkReadonlyrefundReadonlyrefundReadonlyscriptsRaw tapscript bytes for each leaf
ReadonlytweakedReadonlyunilateralReadonlyunilateralReadonlyunilateralBuild the Arkade address corresponding to this virtual output script.
Bech32 human-readable prefix
32-byte Arkade server public key
Arkade address for this script
Return the collaborative claim tapleaf script.
Return all unilateral exit paths embedded in the virtual output script.
CSV-based exit paths found in the leaves
Look up a tapleaf script by its hex-encoded tapscript body.
Hex-encoded tapscript body without the leaf version byte
Matching tapleaf script
Return the non-interactive claim tapleaf script as well as the ArkadeScript.
Return the non-interactive refund tapleaf script as well as the ArkadeScript.
Return the timelocked non-interactive refund tapleaf and its ArkadeScript.
SPENDING THIS LEAF, CONCRETELY — confirmed from this SDK's own
emulator client and covenant-spend builder (EmulatorProvider in src/providers/emulator.ts, and ArkadeTransactionBuilder in src/arkade/contract.ts), which is
the general machinery every covenant leaf in this file goes
through:
tapLeafScript, this script's VtxoScript.encode as tapTree), plus its checkpoint tx.EmulatorPacket (type 1) — { vin, script: <this ArkadeScript>, witness: <empty> }, empty because the
script pushes its own input/output index with
PUSHCURRENTINPUTINDEX rather than reading one from the
witness — wrapped in an Extension OP_RETURN output on the
ark tx.PrevArkTx on
input 0 — required so the emulator can resolve that input's
prevout pkScript/value; it does not otherwise have them.{ arkTx, checkpointTxs } to the emulator's POST /v1/tx.THE COVENANT CHECK the emulator runs against that ArkadeScript —
enforcePayTo(senderPkScript), see that function above — is: the
output at this SAME input's index is a v1 P2TR output paying
senderPkScript, with a value at least the input's. Only on that
check passing does the emulator sign for nirCosigner (the
emulatorPubkey tweaked by this ArkadeScript's hash); the
response carries the fully co-signed signedArkTx and
signedCheckpointTxs — ArkadeTransactionBuilder.send()'s own
comment on this path: "the emulator executes the arkade script
and finalizes with arkd" — no separate call to arkd is made by
this SDK for a covenant spend.
Neither server nor receiver play any part in that check: this
leaf's tapscript still requires server's own signature
alongside nirCosigner's (see the class doc above), but that is
consensus-level multisig, not something the covenant enforces.
NOT SPENDABLE UNTIL refundLocktime MATURES — the tapscript's
OP_CHECKLOCKTIMEVERIFY is arkd's concern, not the emulator's;
the emulator will happily co-sign an immature spend and arkd will
then refuse it. A block-height-typed refundLocktime (below the
standard height/timestamp boundary this SDK names
CLTV_HEIGHT_THRESHOLD, 500,000,000, in
src/contracts/handlers/helpers.ts) is refused by arkd for a
forfeit-eligible leaf independent of maturity — use a
seconds-typed (absolute Unix timestamp) value.
Return the collaborative refund tapleaf script.
Return the refund-without-receiver tapleaf script.
Return the unilateral claim tapleaf script.
Return the unilateral refund tapleaf script.
Return the unilateral refund-without-receiver tapleaf script.
StaticdecodeDecode a virtual output script from an encoded TapTree.
Encoded TapTree bytes
Decoded virtual output script
Virtual Hash Time Lock Contract (VHTLC) script implementation.
VHTLC enables atomic swaps and conditional payments in the Arkade protocol. It provides multiple spending paths:
nonInteractiveParameters): server + emulator can push the receiver's claim, pinned to a pre-committed destinationnonInteractiveParameters): server + receivernonInteractiveParameters): server + emulator can push the sender's refund afterrefundLocktime, pinned to a pre-committed destination — the only refund tier needing no participant signature at allSee ScriptV2 for the current recommended construction — same leaf ladder, same options shape, an added length check on the claim preimage. This class is unchanged and stays available as-is.
Pre-existing limitation: the
vhtlccontract handler registers none of the covenant leaves.nonInteractiveParametersbuilds on this class exactly as it does on ScriptV2 — both extend the sameBaseScriptwhere those leaves are constructed. But thevhtlccontract handler (src/contracts/handlers/vhtlc.ts) round-trips none of them: its params type carries no covenant fields, andcreateScriptonly ever builds the six signature-only leaves. A V1 script built with the covenant suite therefore compiles and can be funded, but cannot be registered as avhtlccontract — the handler would derive a different (six-leaf) script for the same params andContractManagerrefuses the mismatch. Register through thevhtlc-v2handler instead, which round-trips the suite.Example