Skip to content

feat: implement shared payment pool (PaymentPool) #1654

Closed

Description

@alpergundogdu

Implementation follow-up to #1650, which adopted the shared payment pool over pairwise channels.

Scope (payment subsystem only; data plane untouched):

  • Contract (PaymentChannel → pool): 2D sharded register — paid[channel][signer][provider] (monotone cumulative) + authorized[channel][signer] = {cap, expiry, spent}; capability verification (register-once); min(cumulative − paid, capRoom, remaining) redemption (partial-on-drain, NothingToRedeem, redeemMany skips empty lanes); regular close only (drop cooperativeClose and maxChannelDuration); add getPools / getAuthorization / getWatermark views.
  • Wire (protocol): capability EIP-712 type; voucher {channelId, signer, provider, cumulative} (drop the voucher nonce and the token field — single-currency); remove VoucherAck (keep StreamError / VoucherRejectReason).
  • Node/client (incentive, client-pull, node): per-(signer, provider) lanes; owner-side capability issuance; near-stateless client (regenerate/re-fetch capability, reconstruct from views); node-side floor M = solvency (M = κ·ρ·B_max·Δ, node policy) with eager-near-floor redemption.

Explicitly not building (design residue): credit window, onboarding cost, full provisioning, rate-anomaly clamping, redemption epoch.

Cautions: remove only the voucher nonce (the channel-open nonce in channelId = keccak(owner, nonce) stays); on VoucherAck removal, verify the cumulative-resend + on-chain-idempotency model covers the #527/#856/#857/#852 crash/close cases.

Pre-launch: one PR, delete the pairwise design, no compat shims. Design rationale: #1650.

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