Documentation
Layers
The bitcoin layers Cassis routes across, and how each one expresses an HTLC.
Overview
A Cassis payment is a route with any number of hops, each of which is an HTLC,
all bound to the same hash H and honoring strictly decreasing timeouts.
Each network expresses that HTLC in its own idiom, the preimage R (with
H = sha256(R)) is the only key that settles a hop, and a timeout always
opens a refund path.
For each layer below:
- HTLC descriptor is what describes a locked HTLC on the wire: the
sender returns it in reply to
EXECUTE, and the receiver checks it against the ledger before going on. Every descriptor also carries the target it pays: the claim key (or hold invoice) that can settle it on that network. - Default incoming delta is how long a router needs, after learning the preimage at the last possible moment (when its outgoing HTLC expires), to get the claim of its incoming HTLC through on that network before the HTLC can be refunded.
- Outgoing lag is how long after its expiry an HTLC sent on that network can still be claimed, because the refund path opens by the network's own clock and can lag behind wall time. A router adds this lag to the default incoming delta it announces, so each hop's gap depends on both the network it receives on and the one it sends on (see how it works).
● Lightning
- Protocol
- BOLT
- NetworkId
lightning(mainnet),lightning::signet,lightning::mutinynet,lightning::regtest- HTLC
- native BOLT
update_add_htlcwithpayment_hashandcltv_expiry - HTLC descriptor
- BOLT11 hold invoice (
payment_request), sent as the outgoing target the payer pays verbatim to preserve the payment secret - Default incoming delta
- 60 min
- Outgoing lag
- 60 min
The hold invoice must be settled before its CLTV runs out, and that is counted in bitcoin blocks, which can come early.
● Liquid
- Protocol
- Liquid
- NetworkId
liquid(mainnet),liquid::testnet- HTLC
- P2WSH script,
OP_HASH160 <RIPEMD160(payment_hash)>claim path with CLTV refund - HTLC descriptor
- lockup outpoint (
lockup_txid+lockup_vout) pinning the broadcast lockup tx,refund_pubkey,refund_locktime, and the compressed-secp256k1target; the claim side is rebuilt from the route hash - Default incoming delta
- 10 min
- Outgoing lag
- 10 min
Liquid has regular one-minute blocks; the claim must confirm before the refund path opens.
● Arkade
- Protocol
- Arkade
- NetworkId
arkade(arkade.computer, mainnet),arkade::mutinynet(the public mutinynet operator),arkade::<operator host>(each operator is a separate network)- HTLC
VhtlcScripttaproot tree,RIPEMD160(payment_hash), seconds-based timelocks- HTLC descriptor
- VHTLC options —
senderx-only key,refund_locktime, three unilateral CSV delays (unilateral_claim_delay,unilateral_refund_delay,unilateral_refund_without_receiver_delay), and the x-onlytarget(the receiver). The operator is the network's server, andpayment_hash160follows from the route hash - Default incoming delta
- 20 min
- Outgoing lag
- 60 min
Batch expiry. Arkade VTXOs live in batches, and every VTXO expires with the batch it descends from (VTXOs created offchain inherit their inputs' expiry). After that the operator may sweep it, and it can no longer be spent offchain: a VHTLC still running then could neither be claimed nor refunded. So:
- An HTLC must be over at least 20 minutes before the batch of its VHTLC expires. Receivers reject VHTLCs that are not.
- Before locking an HTLC, a sender moves coins that would expire too early into a new batch.
- A router caps how long an incoming HTLC may run with
max_htlc_secsin its config (three days by default) and refuses longer ones. - Wallet coins older than a batch read as 0 until
cassis-wallet arkade --network <id> onboardsettles them into a new one.
Dust. Operators refuse outputs below their dust limit (330 sats by default), including change: a payment smaller than that, or one that would leave less change than that, is refused before anything is locked.
● Cashu
- Protocol
- Cashu
- NetworkId
cashu::<host[:port]>(each mint is a separate network)- HTLC
- NUT-14 spending conditions on a NUT-10 HTLC secret
- HTLC descriptor
- NUT-14 locked ecash proofs, one base64-encoded NUT-00
Proofper element, plus the x-onlytargetthat can claim them - Default incoming delta
- 5 min
- Outgoing lag
- 1 min
Claims are a single request to the mint, timed by the mint's clock. Real mints may charge input fees (e.g. 100 ppk), so a payee on such a mint nets slightly less than the invoiced amount.
● Fedimint
- Protocol
- Fedimint
- NetworkId
fedimint::<invite_code>(each fedimint is a separate network)- HTLC
- LNv2 direct HTLC: an
OutgoingContractfunded between two clients of the federation, with no Lightning gateway involved - HTLC descriptor
- where the contract was funded (
funding_txid+funding_out_idx), the contract itself as consensus JSON, and the x-onlytargetthat can claim it - Default incoming delta
- 40 min
- Outgoing lag
- 60 min
Contracts expire after a number of bitcoin blocks, which can come early or late: refunds may only go through a few blocks after the time the HTLC was planned to expire.
● Rootstock
- Protocol
- Rootstock
- NetworkId
rootstock(mainnet),rootstock::testnet- HTLC
- EtherSwap v3 contract,
sha256precompile matchesHbyte-for-byte - HTLC descriptor
amount_wei,refund_address, block-heighttimelock, and the compressed-secp256k1target(the claim address)- Default incoming delta
- 20 min
- Outgoing lag
- 60 min
Rootstock has ~30 s blocks with some variance, and its timelocks are block heights. Claiming is a contract call, so the receiver needs a little RBTC for gas, the payee included: without it the claim fails and the whole route stays locked until it expires.