Repository navigation
Description
Gap
ADR 003's zero-voucher close path is provider-only:
"This is the provider's mechanism for releasing channels where no vouchers were ever signed."
But the client-side mirror case is real: a client opens a 10 USDC channel, the node fails (crash, deregistration, network loss) before the first 1 MB voucher boundary, and the client has no way to close. Their only escape is `reclaimExpired` after `expiresAt` — default 90 days.
This is a real liquidity lock with no malicious actor needed; ordinary node infrastructure failure is sufficient.
Failure Mode
| Step | State |
|---|---|
| 1. Client `openChannel(provider, USDC, 10)` | Channel `Open`, `deposit=10`, `claimedNonce=0` |
| 2. Probe + StreamResponse signed; node serves <1 MB and crashes | No voucher signed yet (1 MB cadence) |
| 3. Client wants their 10 USDC back | Cannot `closeChannel(amount=0, nonce=0, sig=empty)` — provider-only path. Cannot `closeChannel` with any other args — no valid voucher exists |
| 4. Client waits | 90 days until `reclaimExpired` is callable |
The client's deposit is locked for the full `maxChannelDuration`. The 7-day governance floor on `maxChannelDuration` doesn't help — that's still a week of locked funds for a routine ops failure.
Proposed Fix
Make the zero-voucher close path symmetric. Drop the provider-only restriction on `closeChannel(amount=0, nonce=0, signature.length==0, claimedNonce==0)` so the client can trigger the same path.
// before
if (amount == 0 && nonce == 0 && signature.length == 0 && channel.claimedNonce == 0) {
require(msg.sender == channel.provider, \"zero-voucher close is provider-only\");
// ...
}
// after
if (amount == 0 && nonce == 0 && signature.length == 0 && channel.claimedNonce == 0) {
require(msg.sender == channel.client || msg.sender == channel.provider, \"unauthorized\");
// ...
}After the call, the standard 48h dispute window applies. If the node holds any signed vouchers (because the client did sign some off-chain), they dispute with the highest within the window. If the node holds none, settlement refunds the full deposit to the client.
Why This Is Safe
The attack surface reduces to exactly the existing stale-close attack surface from ADR 003 §Stale close (a client closing with a stale low-amount voucher). The defenses already in place handle it:
- 48h dispute window (per ADR 009, governable 12–72h)
- Permissionless `disputeChannel` (any address with a higher-nonce voucher)
- Local in-process dispute monitor for online nodes (ADR 003 §Stale close)
- Permissionless on-chain fraud detection (appendix-fraud-detection.md)
- Forced-inclusion deadline extension (ADR 003 §L2 sequencer censorship)
A griefing client who signs vouchers off-chain and then tries the symmetric close gets disputed by the online node, same as a stale-close attempt today. No new attack surface.
Alternatives Considered
| Option | Verdict |
|---|---|
| Shorten `maxChannelDuration` default (90d → 30d) | Hurts the channel-reuse amortization economics (ADR 003 §Deposit Economics). Partial fix only — still 30 days locked. |
| Inactivity-based early reclaim (`lastActivityAt + N days`) | Requires on-chain activity tracking, additional storage, governance parameter. Heavier than necessary. |
| UX guidance: "fund minimally, top up after first delivery" | Pushes a protocol gap onto user education. Doesn't fix the underlying asymmetry. |
| Symmetric zero-voucher close | Trivial contract change, reuses existing defenses, closes the gap completely. |
Refs
- ADR 003 — Provider-initiated zero-voucher close (lines 172, 402)
- ADR 003 §Stale close — the analogous client-side attack surface
- Appendix: Fraud Detection — the layered defenses that make the symmetric path safe
- ADR 009 §Dispute window safety bounds
Why This Matters Now
The fix is contract-only and small. The PoC's `StablePaymentChannel` is on the critical path for the implementation — closing this gap before the contract is finalized avoids a future breaking change. As-is, every node ops failure on a fresh channel costs the client up to 90 days of locked liquidity, which will surface as a "deCDN locked my money" complaint the first time a node crashes mid-onboarding.
Origin
Surfaced during ADR review while tracing the channel-failure handling chain in the watchtower → fraud-detection refactor (#420 / #422).
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
docs(adr): allow client-initiated zero-voucher close (#423)
docs(adr): allow client-initiated zero-voucher close (#423)
docs(adr): allow client-initiated zero-voucher close (#424)