Skip to content

design: client abuse/fairness posture for shared pools — payment-priority scheduling (not per-IP) #1668

Closed

Description

@alpergundogdu

Context

The shared payment pool (#1667) intentionally drops the per-signer identity cost to ~0: a client (signer) needs no openChannel gas and no per-signer locked deposit, and for a self-owned pool, self-signing a capability is free. Provider-side sybil resistance (CapacityBond) is untouched — this issue is only about client-side abuse/fairness.

Two facts combine into a real (small) design gap:

  1. A throwaway signer buys one credit window of unbilled egress (default 8 MiB, node-configurable down to one voucher interval) before the mechanical per-lane pause, and throwaway signer keys are free to mint.
  2. The obvious lever — per-IP rate limiting — collateral-damages legitimate IP aggregation (CGNAT, a campus/office behind one NAT, VPN exits, ISP neighbourhoods). Throttling by IP punishes the honest majority behind a shared egress. This is the universal "IP is not identity" problem, not deCDN-specific.

The property we want: one attacker (or a few bad actors behind a shared IP) must not be able to degrade service for paying clients, and minting throwaway identities must cost the attacker something without costing honest clients — especially clustered ones — anything.

What already bounds this (do not re-solve)

  • Credit window — per-lane cap on unbilled egress; a fresh signer gets at most one window.
  • Pool deposit + on-chain cap — throwaway signers share one deposit; redeem pays min(cap−spent, deposit−totalRedeemed), so many keys ≠ multiplied spend.
  • Multi-provider mesh + CapacityBond — no single node is a network chokepoint; an abused node degrades locally and clients re-select (rate × rtt × reputation); an attacker can't cheaply become many nodes.
  • Lazy registration — the node registers a signer on-chain only on its first redemption, so a withholding sybil that never pays costs the node zero gas. Its only cost is the credit-window egress it fronted (bandwidth; for a cache miss, bounded by the floor-M guard + seed-leech caps).

Alternatives (implement ONE)

A — Payment-priority serve scheduling ✅ recommended (load-bearing)

Serve paying lanes (recent vouchers) at full rate; new/unpaid lanes get only spare capacity.

  • Guarantees the property that matters: a paying client is never starved by non-payers — including a legitimate hub whose users pay. A flood of free-riders can only contend for the free/spare tier, which is unmonetizable to the attacker.
  • No new client cost, no PoW, no stake, no wallet (preserves wallet-less delegation), and no IP-based collateral damage.
  • Residual: (i) free-riders contend among themselves for spare capacity — bounded and low-value; (ii) a brand-new paying client sits in the free tier for its first window until it signs its first voucher, then promotes — a minor cold-start, mitigated by the existing credit window and (optionally) source reputation / the client binding.
  • Today's serve path gates setup before payment; the change is to make coarse limits a deprioritization-under-load and let the first voucher promote a lane, rather than a hard pre-payment ban.

B — Cost the free surface (PoW or refundable dust micro-stake per fresh unpaid lane) ❌ rejected as primary

Restores a per-identity friction targeted at the free surface (an honest client pays a voucher within one interval and never feels it). But: PoW taxes honest low-power/mobile clients, and a refundable dust-stake requires the client to hold on-chain value — breaking the wallet-less delegated model that publisher-pays exists for. Wrong primary; revisit only if A proves insufficient.

C — Payment-ratio source throttle (soft demotion) ➖ optional secondary

Deprioritize a source (NodeId, then subnet) whose withhold-rate (served − paid / served) is high — a soft demotion under load, never a ban, so a mostly-paying hub degrades gracefully. Useful refinement of the existing rate-limit layer, but reactive (some free-ride leaks first) and attribution-weak (NodeId rotates free; subnet is coarse). Not load-bearing alone; fine as a complement to A if A alone leaves too much spare-capacity abuse.

D — Per-IP rate limit ⛔ status quo, replace as primary

The current lever, with the collateral damage above. Keep only as a coarse last-resort backstop; never the primary sort.

Recommendation

Implement A (payment-priority serve scheduling) as the load-bearing mechanism; keep the existing credit window + coarse rate limit as backstops; add C only if A leaves too much spare-capacity abuse under real load. Do not implement B (breaks wallet-less / taxes mobile) unless A is measured to be insufficient.

Plus a doc fix: correct ADR 003 § Voucher withholding's "a new key buys an attacker nothing it did not already have" to the honest statement — aggregate free-riding is bounded by scheduling + the credit window, not by key-creation cost.

Scope

Not in #1667 (the core self-owned + delegated pool). This is follow-up design + implementation.

Activity

  1. alpergundogdu commented on Aug 13, 2026

    @alpergundogdu
    ContributorAuthor

    Resolved — the posture this issue asked for now has a concrete home, split across two follow-ups.

    Mechanism: credit-slow-start (#1669). This is Option A (payment-priority scheduling) made concrete and simpler: every new lane starts at a one-chunk floor and ramps to a BDP-derived credit_max on its own confirmed payments (credit_ramp_speed, lower = faster, 0 = instant). A paying lane reaches full rate in a few RTTs; a non-paying lane stays pinned at the floor and can only ever contend for the free/spare tier. Crucially it needs no per-client/per-lane reputation storage or graduation table — the window is a pure function of that lane's payments. That delivers the property this issue wanted (a paying client is never starved by non-payers) without the reputation machinery Option A implied.

    Designed-and-parked alternative: pre-pay (#1671). The stronger form — client fronts payment per lane, so extraction collapses into 'buying data'. Designed end-to-end and parked on gas cost (it leans on the settlement-gas floor and needs a pre-payment-size knob we can't cleanly defend). Full reasoning is captured there: the per-lane cost principle, why every global/per-node criterion is amortizable, deposit over-commitment, and the gas-independent ~$20k lifetime value ceiling.

    Confirmed from the original options:

    • D (per-IP) stays rejected as primary — collateral-damages CGNAT/campus/VPN aggregation. Coarse backstop only.
    • B (PoW / dust-stake) stays rejected — taxes mobile / breaks wallet-less delegation.
    • C (source throttle) — optional refinement, not load-bearing; revisit only if slow-start leaves too much spare-tier abuse under real load.

    The ADR 003 §Voucher-withholding doc fix folds into the PayWord work (#1670).

    Closing; further design continues in #1669 / #1671.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions