// 00

What Is Ladder Script

Ladder Script introduces transaction version 4 (RUNG_TX). Spending conditions are declared as named, typed blocks organised into rungs — a model borrowed from industrial PLC ladder diagrams used in safety-critical factory control. Every byte in every block has a declared type with enforced size constraints. Evaluation is deterministic with bounded execution time. There are 59 block types across 10 families covering signatures, timelocks, hash verification, covenants, recursion, anchors, programmable logic, compound patterns, governance, and legacy Bitcoin transaction types.

Anti-spam hardened. Three coordinated defenses close all practical data embedding surfaces. merkle_pub_key: public keys are not stored in condition fields at all — they are folded into the Merkle leaf hash at fund time and verified positionally at spend time. There is no writable pubkey slot in conditions for an attacker to fill with arbitrary data. Selective inversion: key-consuming blocks (SIG, MULTISIG, HTLC, and 14 others) cannot be inverted. This prevents the garbage-pubkey attack where an attacker uses a junk key, lets the signature fail, inverts the result to SATISFIED, and lands arbitrary data in the block witness. Hash lock deprecation: HASH_PREIMAGE and HASH160_PREIMAGE are removed. These were invertible non-key blocks with writable hash fields — an inverted hash lock with a garbage hash and arbitrary preimage data could embed up to 252 bytes per block. All legitimate hash-lock use cases are covered by HTLC and HASH_SIG compound blocks, which combine hash verification with a mandatory signature. With MLSC (0xC2), the on-chain output is a fixed 33-byte scriptPubKey regardless of how many spending paths or conditions exist.

Post-quantum ready. FALCON-512, FALCON-1024, Dilithium3, and SPHINCS+ are native signature schemes. A single SCHEME field on any signature block routes verification to classical Schnorr or any post-quantum algorithm without changing the wire format or condition structure. With merkle_pub_key, condition size is constant regardless of key size — a 33-byte Schnorr key and a 1,952-byte Dilithium3 key produce the same Merkle leaf. The full key is provided only in the witness at spend time, where its hash is verified against the committed leaf. COSIGN lets a single PQ-secured UTXO serve as a co-spending guardian for unlimited classical UTXOs (theoretical max depth ~4.3 billion spends) — incremental PQ migration without a flag day.

Programmable money. Covenants, recursive conditions, rate limiters, state machines, sequenced approvals, fee-band gating, adaptor signatures, and protocol anchoring — all as composable typed blocks within the same wire format. The PLC family alone brings 14 block types drawn from decades of proven industrial automation patterns. Legacy Bitcoin transaction types (P2PKH through P2TR script-path) are wrapped as typed blocks, significantly reducing data-embedding surfaces including the taproot inscription vector.

// 01

How It Works

Ladder Script organizes spending conditions as blocks within rungs. All blocks in a rung must pass (AND logic). The first rung that passes wins (OR logic). This comes from industrial PLC ladder diagrams — the same model used to wire safety-critical factory control systems.

Example: Hot/Cold Vault
R000
SIG
hot_key
CSV
144 blocks
(
UNLOCK
)
R001
MULTISIG
2-of-3 cold
(
UNLOCK
)

Rungs = OR, Blocks = AND

This vault has two spending paths. Rung 0 requires both a hot key signature AND a 144-block CSV timelock. Rung 1 is a cold recovery path with 2-of-3 multisig.

The evaluator tries rungs top to bottom. The first rung where every block passes wins — OR across rungs. Power flows left to right through each rung, just like current through a relay circuit.

The amber glow shows which rung is energized (satisfied). Blocks that pass light up. Blocks that fail break the circuit.

createrungtx output

  "version" 4
  "outputs"
    
      "amount" 0.001
      "conditions"
                                             // Rung 0: hot spend
          "blocks"
             "type" "SIG" "fields" "type" "PUBKEY" "hex" "02a1b2..." 
             "type" "CSV" "fields" "type" "NUMERIC" "hex" "9000" 
          
        
                                             // Rung 1: cold recovery
          "blocks"
             "type" "MULTISIG" "fields"
               "type" "NUMERIC" "hex" "02"    // threshold
               "type" "PUBKEY" "hex" "02c3..." 
               "type" "PUBKEY" "hex" "03d4..." 
               "type" "PUBKEY" "hex" "02e5..." 
            
          
        
      
    
  
// 02

Every Byte Is Typed

Typed Fields, No Free-Form Data

Ladder Script restricts conditions to typed fields: HASH256, HASH160, NUMERIC, SCHEME, and SPEND_INDEX — all fixed-size hashes or bounded integers with enforced size constraints. SCHEME routes signatures to classical (Schnorr, ECDSA) or post-quantum (FALCON-512, FALCON-1024, Dilithium3, SPHINCS+) verification. Public keys are not stored in conditions — they are folded into the Merkle leaf hash via merkle_pub_key.

PUBKEY, PUBKEY_COMMIT, SIGNATURE, PREIMAGE, and SCRIPT_BODY are not valid in conditions — consensus rejects them at deserialization. With MLSC (0xC2), conditions never enter the UTXO set at all — only a 32-byte Merkle root. There is no writable slot in conditions that an attacker can fill with arbitrary data.

Static analysis requires only parsing, not execution simulation. Every field in a Ladder Script output can be identified, validated, and displayed without running any code.

Data Types
// Condition fields (stored on-chain)
HASH256      // 32 bytes       (SHA-256 digest)
HASH160      // 20 bytes       (RIPEMD160(SHA256))
SPEND_INDEX  // 4 bytes        (uint32 LE)
NUMERIC      // 1-4 bytes      (uint32 LE)
SCHEME       // 1 byte         (sig scheme: 01=Schnorr, 02=ECDSA,
             //                  10=FALCON-512, 11=FALCON-1024,
             //                  12=Dilithium3, 13=SPHINCS+)

// Witness fields (revealed at spend time)
PUBKEY       // 1-2,048 bytes  (bound by Merkle leaf)
SIGNATURE    // 1-50,000 bytes
PREIMAGE     // 1-252 bytes
SCRIPT_BODY  // 1-520 bytes    (inner conditions)
DATA         // 1-80 bytes     (DATA_RETURN block only)
// 03

merkle_pub_key: Bound by Merkle, Not by Field

No Writable Pubkey Slot

Public keys are not stored in condition fields. Instead, they are folded into the Merkle leaf hash at fund time: TaggedHash("LadderLeaf", rung_blocks || pk1 || pk2 || ... || pkN). The RPC accepts raw public keys, validates them, and computes the leaf. There is no PUBKEY_COMMIT field in conditions — and therefore no writable slot for an attacker to fill with arbitrary data.

At spend time, pubkeys are provided in the witness. The evaluator walks the rung's blocks left-to-right using PubkeyCountForBlock() to assign pubkeys positionally. The Merkle proof verification guarantees these are the same pubkeys committed at fund time — only then does signature verification proceed.

merkle_pub_key Flow
// Build time — RPC validates + folds into leaf
1. Validate PUBKEY (size bounds, prefix)
2. Walk blocks: PubkeyCountForBlock() per block
3. leaf = TaggedHash("LadderLeaf",
           rung_blocks || pk1 || pk2 || ... || pkN)
// No pubkey data in condition fields

// Spend time — witness reveals full keys
PUBKEY = full_pubkey  // 32B SPHINCS+
                       // 33B Schnorr / ECDSA
                       // 897B FALCON-512
                       // 1,793B FALCON-1024
                       // 1,952B Dilithium3

// Evaluator checks:
4. Recompute leaf from witness pubkeys
5. Merkle proof verifies leaf == committed root
6. Verify(witness.SIGNATURE, witness.PUBKEY, sighash)
Why This Matters
Zero writable pubkey surface — There is no PUBKEY_COMMIT field in conditions. Public keys exist only in the Merkle leaf computation and the witness. An attacker cannot write arbitrary data into a pubkey slot because no such slot exists.

Uniform leaf size — Whether the key is 33 bytes (Schnorr) or 1,952 bytes (Dilithium3), the condition fields are identical. The leaf hash absorbs the key bytes during tree construction. The full key only appears in the witness at spend time.

Positional binding — Pubkeys are assigned to blocks by walking left-to-right across key-consuming blocks. A SIG consumes 1 pubkey, MULTISIG consumes N (from its threshold field), HTLC consumes 2. Wrong order → Merkle proof fails.
// 04

Evaluation & Relay Logic

Verification dispatches through three levels. The ladder tries rungs top to bottom (OR). Each rung checks all its blocks (AND). Each block runs its own type-specific logic.

Atomic Swap with Compound HTLC + Timelock Fallback
R000
HTLC
hash+sig+csv
(
UNLOCK
)
R001
SIG
my_key
CLTV
height 900000
(
UNLOCK
)
Evaluation Order
EvalLadder iterates rungs (OR). EvalRung iterates blocks within a rung (AND). EvalBlock dispatches to the type-specific evaluator (SIG_verify, CSV_check, HASH_compare, etc.). First rung where all blocks return SATISFIED wins. If no rung passes, the transaction is invalid.

Coils, Relays & Cross-Rung Logic

Each rung terminates in a coil that determines its effect. Relays are a separate mechanism — shared condition blocks that rungs reference via relay_refs for cross-rung AND composition.

Coil Types
UNLOCK      // 0x01 — Standard spend authorization
UNLOCK_TO   // 0x02 — Spend to specific address, recipient
            //         must also satisfy coil conditions
COVENANT    // 0x03 — Constrains the spending transaction
            //         structure via coil conditions

// Relays (separate from coils)
// Shared condition blocks referenced by rungs
// Forward-only: relay N can only require relays 0..N-1

Cross-Rung Composition

Relays are shared condition blocks that multiple rungs can reference. A rung lists the relay indices it depends on — all referenced relays must be satisfied (AND) for that rung to pass. This enables cross-rung AND composition beyond simple per-rung logic.

Example: Relay 0 checks a signature. Rung 0 references relay 0 and adds a timelock — it only passes if both the relay's signature AND the timelock are satisfied. Rung 1 references the same relay 0 with a different spending path. The relay condition is defined once and reused.

Relays use forward-only indexing: relay N can only require relays 0..N-1, preventing circular dependencies.

Example: Relay-Gated Approval
RLY0
SIG
approver
(
RELAY
)
R000
REF
relay 0
CSV
144 blocks
SIG
spender
(
UNLOCK
)
// 05

Block Type Families

59 block types organized into ten numbered families. New block types are added within families, not as opcodes. See the Block Reference for deep-dive documentation on each type.

Signature
0x0001-0x00FF
Identity verification with native post-quantum support via SCHEME field routing to FALCON-512/1024, Dilithium3, or SPHINCS+.
SIG MULTISIG ADAPTOR_SIG MUSIG_THRESHOLD KEY_REF_SIG
Timelock
0x0100-0x01FF
Temporal constraints using both relative (BIP-68) and absolute timelocks in blocks or seconds.
CSV CSV_TIME CLTV CLTV_TIME
Hash
0x0200-0x02FF
BIP-340 domain-separated hash verification. HASH_PREIMAGE and HASH160_PREIMAGE are deprecated — use HTLC or HASH_SIG compound blocks for hash-lock use cases.
TAGGED_HASH
Covenant
0x0300-0x03FF
Output constraints. Template verification (BIP-119), timelocked vaults, and amount range enforcement.
CTV VAULT_LOCK AMOUNT_LOCK
Recursion
0x0400-0x04FF
Self-referential conditions for perpetual covenants, state machines, countdowns, UTXO tree splitting, and progressive relaxation.
RECURSE_SAME RECURSE_MODIFIED RECURSE_UNTIL RECURSE_COUNT RECURSE_SPLIT RECURSE_DECAY
Anchor
0x0500-0x05FF
Typed L2 metadata. Tag UTXOs with protocol roles for channels, pools, reserves, sealed commitments, and oracle attestations.
ANCHOR ANCHOR_CHANNEL ANCHOR_POOL ANCHOR_RESERVE ANCHOR_SEAL ANCHOR_ORACLE DATA_RETURN
PLC
0x0600-0x06FF
Programmable Logic Controllers. Industrial automation patterns for stateful, rate-governed, and sequenced transaction logic.
HYSTERESIS_FEE HYSTERESIS_VALUE TIMER_CONTINUOUS TIMER_OFF_DELAY LATCH_SET LATCH_RESET COUNTER_DOWN COUNTER_PRESET COUNTER_UP COMPARE SEQUENCER ONE_SHOT RATE_LIMIT COSIGN
Compound
0x0700-0x07FF
Multi-block patterns collapsed into single blocks. Eliminates per-block headers and field counts for merged conditions.
TIMELOCKED_SIG HTLC HASH_SIG PTLC CLTV_SIG TIMELOCKED_MULTISIG
Governance
0x0800-0x08FF
Transaction-level constraints with no Tapscript equivalent. Enforce weight limits, I/O counts, value ratios, spending windows, and set membership proofs.
EPOCH_GATE WEIGHT_LIMIT INPUT_COUNT OUTPUT_COUNT RELATIVE_VALUE ACCUMULATOR
Legacy
0x0900-0x09FF
Wraps legacy Bitcoin transaction types (P2PK, P2PKH, P2SH, P2WPKH, P2WSH, P2TR key-path, P2TR script-path) as typed Ladder Script blocks. Same spending semantics, significantly reducing arbitrary data surfaces. Designed to close inscription and data-embedding vectors while giving legacy users access to full Ladder Script composability.
P2PK_LEGACY P2PKH_LEGACY P2SH_LEGACY P2WPKH_LEGACY P2WSH_LEGACY P2TR_LEGACY P2TR_SCRIPT_LEGACY
// 06

Wire Format

Output Formats & Wire Encoding

Ladder Script supports two output formats. Inline (0xC1) stores full serialized conditions in the output. MLSC (0xC2) stores only a 32-byte Merkle root — conditions are revealed at spend time in the witness.

Blocks use micro-headers — a 1-byte lookup table (0x00–0x3C) that encodes the block type, inversion flag, and implicit field layout in a single byte. Known block types with standard field layouts skip the 2-byte type code, field count, and type bytes entirely. Escape codes (0x80/0x81) fall back to the full header for unknown or non-standard blocks. Inversion is only permitted for non-key-consuming block types (timelocks, covenants, PLC, governance, anchors, recursion) — key-consuming blocks cannot be inverted.

Sighash uses a tagged hash "LadderSighash" that commits to the conditions hash (or Merkle root for MLSC outputs), binding each signature to the exact conditions it satisfies.

Wire Layout
// Inline output (0xC1)
0xC1  SerializedRungConditions

// MLSC output (0xC2) — 33-byte scriptPubKey
0xC2  conditions_root (32 bytes)

// Witness (v4 wire format)
n_rungs varint
  n_blocks varint
    micro_header uint8   // 0x00-0x3C lookup
                              // 0x80/0x81 escape
    // if escape:
    block_type uint16 LE
    n_fields varint
      data_type uint8
      data_len varint
      data bytes
coil_type uint8
attestation uint8
scheme uint8
address_len varint
address bytes
n_coil_conditions varint
n_relays varint           // relay blocks
rung_relay_refs varint[] // per-rung refs
// 07

Merkelized Ladder Script Conditions

MLSC (0xC2) replaces full inline conditions with a single 32-byte Merkle root. The complete conditions are never stored on-chain at creation — only the root appears in the output and UTXO set. At spend time, the spender reveals only the exercised rung plus a Merkle proof in the witness. Unused spending paths stay permanently hidden.

How It Works

Each rung is hashed into a leaf using TaggedHash("LadderLeaf", rung_blocks || pk1 || ... || pkN), then combined into a binary Merkle tree using TaggedHash("LadderInternal", ...) for interior nodes. Public keys are folded into the leaf hash via merkle_pub_key — they do not appear in condition fields. This follows BIP-341 (Taproot) convention for domain separation, preventing second preimage attacks between tree layers.

MAST Privacy

Only the satisfied rung is revealed. A 2-rung script reveals 1 rung + 1 proof hash (32 bytes). An 8-rung script reveals 1 rung + 3 proof hashes (96 bytes). Unused paths remain opaque — observers cannot determine the number, type, or structure of alternative spending conditions.

Data Embedding Resistance

MLSC closes all practical data embedding vectors. Condition fields contain only fixed-size hashes, bounded integers, and scheme bytes — no writable pubkey slot exists (merkle_pub_key). Key-consuming blocks cannot be inverted (selective inversion). Pure hash locks are deprecated (hash lock deprecation). Consensus rejects witness-only types (PUBKEY, PUBKEY_COMMIT, SIGNATURE, PREIMAGE) in conditions at deserialization. The only value stored on-chain is a 32-byte Merkle root.

MLSC Merkle Tree
// 2-rung multisig + recovery vault

         conditions_root

       H(R0,R1)     H(COIL,EMPTY)

   rung_0  rung_1  coil_leaf  EMPTY

// Leaf hash (merkle_pub_key):
// TaggedHash("LadderLeaf",
//   rung_blocks || pk1 || pk2 || ...)

// scriptPubKey: 0xC2 + root = 33 bytes (fixed)
// tx output: value(8) + len(1) + spk(33) = 42 bytes
// leaf order: [rungs..., relays..., coil]

// Spending: reveal rung 0 + pubkeys in witness
// Proof: rung_leaf[1] (32 bytes)
// Rung 1 structure stays hidden
Weight Savings
// MLSC scriptPubKey is always 33 bytes
// 0xC2 (1) + Merkle root (32) = 33 bytes
// Inline scriptPubKey scales with complexity:

Single SIG:      MLSC 33 B
2-of-3 MULTISIG: MLSC 33 B
Complex covenant: MLSC 33 B

// Inline is useful for debugging
// MLSC is the production format
// 08

Use Cases

59 block types across 10 families enable a wide range of transaction patterns, from single-sig to complex stateful contracts.

HYSTERESIS_FEE
Fee-band gated spending. A UTXO that can only be spent when the transaction fee rate falls within a specified range, preventing overpayment during fee spikes.
PLC Family
AMOUNT_LOCK
Output amount range enforcement. Ensure the spending transaction creates outputs within a minimum and maximum satoshi range, enabling deposit/withdrawal bounds.
Covenant Family
Post-Quantum Migration
merkle_pub_key folds PQ keys (32–1,952 bytes) into the Merkle leaf — condition fields are constant-size regardless of key algorithm. COSIGN lets a single PQ-secured UTXO co-sign for unlimited classical UTXOs (theoretical max depth ~4.3 billion spends). Four PQ schemes: FALCON-512, FALCON-1024, Dilithium3, SPHINCS+.
Signature Family
Recursive Covenants
Six recursion types: RECURSE_SAME (perpetual re-encumbrance), RECURSE_MODIFIED (single mutation per spend), RECURSE_COUNT (countdown), RECURSE_SPLIT (output splitting), RECURSE_DECAY (progressive parameter relaxation), RECURSE_UNTIL (height-bounded). All with provable termination.
Recursion Family
Rate-Limited Vaults
RATE_LIMIT + VAULT_LOCK for time-gated withdrawal limits. ONE_SHOT for single-use emergency keys. SEQUENCER for multi-step approval flows.
PLC
Covenant
Adaptor Signatures
ADAPTOR_SIG enables atomic swaps and payment channel protocols with a single typed block. The adaptor point and signing key are folded into the Merkle leaf via merkle_pub_key.
Signature Family
Aggregate Threshold Signatures
MUSIG_THRESHOLD enables M-of-N multisig via MuSig2/FROST where the on-chain footprint is identical to single-sig (~131 bytes). A 3-of-5 treasury is indistinguishable from a solo wallet on-chain.
Signature Family
Protocol Anchoring
Seven typed anchor blocks for Lightning channels, mining pools, reserve sets, sealed commitments, oracle attestations, and prunable data outputs. All typed and validated at consensus.
Anchor Family
Structural Spam Resistance
Three coordinated defenses: merkle_pub_key eliminates writable pubkey fields from conditions. Selective inversion prevents key-consuming blocks from being inverted (closes garbage-pubkey attack). Hash lock deprecation removes HASH_PREIMAGE and HASH160_PREIMAGE (closes invertible-preimage attack). MLSC outputs store only a 33-byte scriptPubKey (0xC2 + 32-byte Merkle root).
Core Design
Compound Wire Savings
HTLC collapses hash + timelock + signature into one block, eliminating redundant headers. TIMELOCKED_SIG, HASH_SIG, CLTV_SIG each merge two blocks into one. PTLC collapses adaptor sig + CSV for payment channels. TIMELOCKED_MULTISIG collapses M-of-N + CSV for penalty branches and vault recovery.
Compound Family
Transaction Governance
EPOCH_GATE restricts spending to periodic windows. WEIGHT_LIMIT caps transaction size. INPUT_COUNT and OUTPUT_COUNT bound I/O fanout. RELATIVE_VALUE prevents fee siphoning. ACCUMULATOR proves Merkle set membership.
Governance Family
Timer-Controlled Access
TIMER_CONTINUOUS requires N consecutive blocks of activity before authorization. TIMER_OFF_DELAY holds spending rights for a grace period after a trigger expires. Together they implement watchdog patterns and supervised custody.
PLC Family
Approval Accumulators
COUNTER_PRESET accumulates approvals from independent parties. Each approval increments via RECURSE_MODIFIED. Once the preset count is reached, funds release. Unlike MULTISIG, approvals can arrive in separate transactions.
PLC Family
Value-Band Spending
HYSTERESIS_VALUE constrains output values to a band [low, high]. Prevents both dust outputs and excessive single-spend withdrawals. Useful for corporate disbursement policies and regulated fund flows.
PLC Family
Calendar-Dated Unlocks
CLTV_TIME locks funds until a specific Unix timestamp rather than a block height. Ideal for grant agreements, employment vesting, and financial contracts with real-world calendar deadlines.
Timelock Family
Tagged Hash Attestation
TAGGED_HASH enables BIP-340 domain-separated hash verification. Oracles, price feeds, and external data sources commit using tagged hashes, ensuring domain isolation and preventing cross-protocol replay.
Hash Family
UTXO Tree Splitting
RECURSE_SPLIT enables a single UTXO to split into multiple outputs, each re-encumbered with the same conditions. Enables binary tree distribution patterns for airdrops, batch payouts, and scalable covenant propagation.
Recursion Family
// 09

Try the Builder

The Ladder Script Builder is a visual tool for constructing ladder transactions. Drag blocks onto rungs, configure typed fields, and see the resulting wire format in real time.

ladder-engine — 2-of-3 Multisig Vault
Ladder Diagram
RUNG 0 — AUTH
SIG
MULTISIG
( )
CLTV
SIG
( )
HYSTERESIS_FEE
( )
Wire Format (JSON)
{
"version": 4,
"rungs": [
{ "blocks": [
{ "type": "SIG", "code": "0x0001" },
{ "type": "MULTISIG", "m": 2, "n": 3 }
] },
{ "blocks": [
{ "type": "CLTV", "height": 52560 },
{ "type": "SIG", "code": "0x0001" }
] },
{ "blocks": [
{ "type": "HYSTERESIS_FEE",
"low": 5, "high": 50 }
] }
],
"wire_bytes": 142
}
Launch Builder
// 10

Examples

Pre-built programs from the Ladder Script Builder. Click any example to load it in the engine.

2-OF-3 MULTISIG VAULT
Corporate treasury with 2-of-3 multisig spending and a time-locked recovery path using a single backup key after 1 year.
SPEND
MULTISIG
( UNLOCK )
RECOVER
CSV
SIG
( UNLOCK )
ATOMIC SWAP (HTLC)
Cross-chain atomic swap via compound HTLC block. Hash + timelock + signature in a single block. Refund via CSV + SIG.
CLAIM
HTLC
( UNLOCK )
REFUND
CSV
SIG
( UNLOCK )
ADAPTOR SIG SWAP
Schnorr adaptor signature atomic swap. On-chain adapted sig reveals the adaptor secret for the counterparty.
EXECUTE
ADAPTOR_SIG
( UNLOCK )
CANCEL
CSV
SIG
SIG
( UNLOCK )
DCA COVENANT CHAIN
Dollar-cost averaging covenant. Splits UTXO into a buy output each spend, counting down 12 purchases with recursive state.
BUY
CTR_DN
AMT_LOCK
REC_MOD
( UNLOCK )
SWEEP
CTR_DN
SIG
( UNLOCK )
VAULT WITH UNVAULT + CLAWBACK
Bitcoin vault pattern: normal spend requires unvault delay (24h). Emergency clawback to cold key at any time.
UNVAULT
VAULT
CSV_TIME
SIG
( UNLOCK )
CLAWBACK
SIG
( UNLOCK )
RATE-LIMITED WALLET
Daily spending cap of 50,000 sats with accumulator. Refills over 144 blocks. Two-key override for full sweep.
DAY
SIG
RATE_LIM
RECURSE
( UNLOCK )
OVERRIDE
SIG
SIG
( UNLOCK )
DEAD MAN'S SWITCH (INHERITANCE)
Owner must sign within ~6 months to keep funds. On timeout, heir can claim. Resets each spend via latch.
ALIVE
SIG
LATCH_S
RECURSE
( UNLOCK )
INHERIT
CSV
SIG
( UNLOCK )
ESCROW WITH ORACLE
Buyer/seller escrow. Either party + oracle can release. Joint buyer+seller can settle directly without oracle.
RELEASE
SIG
ORACLE
COSIGN
( UNLOCK )
DISPUTE
SIG
ORACLE
COSIGN
( UNLOCK )
SETTLE
SIG
SIG
( UNLOCK )
PAYMENT CHANNEL
Lightning-style payment channel. Cooperative close with both sigs, or unilateral close after 1-day CSV timeout.
COOP
SIG
SIG
( UNLOCK )
FORCE_A
SIG
CSV_TIME
CTV
( UNLOCK )
FORCE_B
SIG
CSV_TIME
CTV
( UNLOCK )
SEQUENCED PAYOUT
Multi-stage project payout. Funds release in 5 sequential milestones. Each milestone requires oracle + recipient sig.
MILE
SEQ
ORACLE
SIG
AMT_LOCK
REC_MOD
( UNLOCK )
CANCEL
SIG
SIG
( UNLOCK )
FEE-GATED COVENANT
Covenant that only allows spending when fees are 5-50 sat/vB. Prevents panic-spending during fee spikes.
SEND
SIG
HYST_FEE
AMT_LOCK
( UNLOCK )
EMERG
SIG
SIG
( UNLOCK )
ONE-SHOT TRIGGER + LATCH
Single-use authorization: ONE_SHOT fires once, latching the output. The latch can only be reset by a separate key.
FIRE
SIG
ONE_SHOT
( LATCH )
EXEC
SIG
( UNLOCK )
RESET
LATCH_R
SIG
( UNLATCH )
RECURSIVE SPLIT (TREE)
Binary split covenant: UTXO splits into 2 equal children on each spend, up to 4 levels deep.
SPLIT
SIG
REC_SPLIT
REC_DECAY
CTV
( UNLOCK )
LEAF
SIG
REC_CNT
( UNLOCK )
BLOCK-HEIGHT TIMELOCK + COMPARE
Funds locked until block 900,000. After unlock, output amount must exceed 10,000 sats. CLTV + COMPARE combo.
SPEND
CLTV
SIG
COMPARE
( UNLOCK )
COUNTER-UP SUBSCRIPTION
Recurring subscription: counter increments each payment (max 24). Amount-locked to fixed payment size. Auto-renews via recursion.
PAY
SIG
CTR_UP
AMT_LOCK
REC_MOD
( UNLOCK )
CANCEL
SIG
SIG
( UNLOCK )
EXPIRE
CTR_UP
SIG
( UNLOCK )
QUANTUM-SAFE VAULT
Post-quantum vault using FALCON-512 hot spend and Dilithium3 cold recovery after 1-year CSV. Hybrid classical+PQ path.
PQ_SPEND
FALCON
AMT_LOCK
( UNLOCK )
PQ_COLD
CSV
DILITHIUM
( UNLOCK )
HYBRID
FALCON
SIG
( UNLOCK )
QUANTUM VAULT + CHILDREN
PQ-secured parent vault that splits into child UTXOs via RECURSE_SPLIT. Each child inherits Falcon-512 protection.
SPLIT
FALCON
CTR_DN
REC_SPLIT
REC_DECAY
( UNLOCK )
CHILD
FALCON
CTR_DN
AMT_LOCK
( UNLOCK )
EMERG
MULTISIG
( UNLOCK )
SWEEP
CSV
DILITHIUM
( UNLOCK )
MULTI-INPUT CONSOLIDATION
Consolidates 3 UTXOs into a single output. Demonstrates multi-input rung assignment with CTV template commitment.
MERGE
SIG
AMT_LOCK
CTV
( UNLOCK )
MUSIG_THRESHOLD TREASURY
3-of-5 corporate treasury using MuSig2/FROST. On-chain looks identical to single-sig. Time-locked backup key for recovery.
SPEND
MUSIG_THR
( UNLOCK )
RECOVER
CSV
SIG
( UNLOCK )
PTLC PAYMENT CHANNEL
Scriptless payment channel. Cooperative close via MuSig, unilateral close with PTLC adaptor sig + CSV timeout.
COOP
MUSIG_THR
( UNLOCK )
FORCE
PTLC
( UNLOCK )
CLTV_SIG VESTING SCHEDULE
Quarterly vesting unlocks at specific block heights using CLTV_SIG compound blocks with amount locks.
Q1
CLTV_SIG
AMT_LOCK
( UNLOCK )
FULL
CLTV_SIG
( UNLOCK )
TIMELOCKED_MULTISIG VAULT
Hot wallet spend, 2-of-3 board recovery after 1-week cooling period, emergency cold key sweep.
HOT
SIG
AMT_LOCK
( UNLOCK )
BOARD
TL_MULTI
( UNLOCK )
COLD
CSV
SIG
( UNLOCK )
HTLC COMPACT SWAP
Atomic swap using the HTLC compound block — hash + timelock + sig in a single block. Saves 16 bytes over decomposed blocks.
CLAIM
HTLC
( UNLOCK )
REFUND
TL_SIG
( UNLOCK )
HASH_SIG ATOMIC CLAIM
Preimage reveal + signature in one compound block. Ideal for atomic swap claim paths with hash verification and authorization together.
CLAIM
HASH_SIG
( UNLOCK )
REFUND
CSV
SIG
( UNLOCK )
GOVERNANCE-GATED TREASURY
Treasury restricted by governance: spending windows, I/O fanout limits, weight cap, and anti-siphon ratio enforcement.
GOVERNED
SIG
EPOCH
IN_COUNT
OUT_COUNT
WT_LIMIT
REL_VAL
( UNLOCK )
OVERRIDE
MULTISIG
( UNLOCK )
ACCUMULATOR ALLOWLIST
Merkle set membership proof. Destination must be in a pre-committed allowlist. Combines with SIG and AMOUNT_LOCK for full access control.
SEND
SIG
ACCUM
AMT_LOCK
( UNLOCK )
ADMIN
MULTISIG
( UNLOCK )
CLTV_TIME CALENDAR LOCK
Date-locked payment using absolute Unix timestamp. Funds locked until January 1, 2027. TAGGED_HASH adds domain-separated attestation gate.
UNLOCK
CLTV_TIME
TAGGED
SIG
( UNLOCK )
CANCEL
SIG
SIG
( UNLOCK )
TIMER WATCHDOG
Continuous timer requires N consecutive blocks of activity. Off-delay holds authorization after trigger. Tagged hash proves attestation.
ACTIVE
TMR_CONT
SIG
TAGGED
( UNLOCK )
HELD
TMR_OFF
SIG
( UNLOCK )
EMERG
CSV
SIG
( UNLOCK )
PRESET COUNTER BOARD VOTE
Multi-party approval accumulator. Counter tracks board approvals; once preset reached, funds release. Value band limits payout size.
APPROVE
CTR_PRE
SIG
HYST_VAL
REC_MOD
( UNLOCK )
EXECUTE
CTR_PRE
SIG
( UNLOCK )
CANCEL
MULTISIG
( UNLOCK )
ANCHORED CHANNEL + RECURSE_UNTIL
Lightning channel with anchor binding and recursive state until target block height. Bounds protocol lifetime on-chain.
COOP
MUSIG_THR
A_CHAN
( UNLOCK )
UPDATE
SIG
A_CHAN
REC_UNTIL
REC_MOD
( UNLOCK )
EXPIRE
CLTV
SIG
( UNLOCK )
// 10

Documentation

Full documentation covering the BIP proposal, technical specification, MLSC Merkle specification, block library, integration guide, examples, and more.

Read the Documentation MLSC Specification Block Reference Open Builder