Skip to main content
You’re viewing an old version of the Arkade contracts documentation. Go to Your first contract for the current version.
Lightning channels within Arkade are a research design. Do not use them with real funds.
Arkade can act as a channel factory for Lightning Network channels. The operator takes part when Alice and Bob open, renew, resize, or close a channel. Payments and HTLCs flow over Lightning between Alice and Bob, without the operator. The channel’s funding output is the Dryja-Poon funding output, held as a virtual output. A reference implementation by Vincenzo Palazzo is in lampo.rs.

Channel lifecycle

Funding

Alice and Bob submit an Arkade transaction that creates a virtual output with the funding output script. The channel is usable once the operator accepts the transaction (preconfirmation). Alice and Bob then exchange their first commitment transactions, as in any Lightning channel.

Normal operation

Alice and Bob exchange commitment transactions, rotate revocation secrets, and forward HTLCs as specified in the BOLTs. The operator has no role.

Renewal

The funding output expires at its batch expiry. Before then, either party submits an Arkade transaction that moves the funding output to a new virtual output with the same script. Alice and Bob do not need to pause the channel for this.
This flow roots the funding output in a confirmed batch output. It assumes one party is a Lightning service provider (LSP).
  1. The user and the LSP pause HTLC forwarding (quiescence).
  2. They register the funding output for the next batch swap, with the same capacity.
  3. The commitment transaction confirms onchain.
  4. They sign new commitment transactions that spend the new funding output, with the same balances.
  5. They sign a forfeit transaction on the old funding output, which revokes the old channel state.
  6. They resume HTLC forwarding on the new funding output.
The forfeit transaction makes sure that the old and new funding outputs cannot both be spent.

Resize

A resize is a renewal with new balances. If Alice wants more inbound capacity, the new funding output reflects that. If Bob withdraws funds, the new funding output is smaller and Bob receives a separate virtual output.

Cooperative close

Alice and Bob sign a transaction that spends the funding output to their own addresses.

Force close

If one party stops cooperating, the other party works with the operator to force close. The party broadcasts its latest commitment transaction, and resolution follows Lightning rules (to_local delay, HTLC resolution). If the operator is unavailable, Alice and Bob can still unroll the funding output onchain and spend it through its exit path, after the operator’s exit delay.

HTLC timeouts and batch expiry

If an HTLC’s timeout (CLTV) is later than the funding output’s batch expiry, the funding output can expire before the HTLC resolves. Never accept an HTLC whose timeout is later than the batch expiry minus a safety margin:
The limit tightens as expiry approaches. A channel with 12 hours left cannot accept an HTLC with a 24-hour timeout, so renew the channel early.