Skip to content

feat(specs): add session scheme for EVM streaming payment channels #2080

Closed
jimmyye123 wants to merge 5 commits intox402-foundation:mainfrom
okx:add-scheme-session
Closed

feat(specs): add session scheme for EVM streaming payment channels #2080
jimmyye123 wants to merge 5 commits intox402-foundation:mainfrom
okx:add-scheme-session

Conversation

@jimmyye123
Copy link
Copy Markdown

@jimmyye123 jimmyye123 commented Apr 20, 2026

Add the session scheme specification for EVM, enabling streaming payment channels via on-chain escrow and off-chain EIP-712 cumulative vouchers. Ships both the network-agnostic scheme definition and the EVM-specific implementation.

Files:

  • specs/schemes/session/scheme_session.md — network-agnostic session scheme (7 core properties)
  • specs/schemes/session/scheme_session_evm.md — EVM implementation covering the full channel lifecycle (open / topUp / voucher / close), two open modes (client-broadcast and server-submitted via EIP-3009 receiveWithAuthorization), deterministic-nonce front-running mitigation, split payments, SSE balance signaling, ERC-1271 smart-wallet signing, and the escrow contract interface.

Tests
N/A — documentation only. No TypeScript / Python / Go source changes, so pnpm test, uv run pytest, and go test ./... are not applicable.
Checklist
[x] I have formatted and linted my code — N/A (docs only)
[x] All new and existing tests pass — N/A (docs only)
[x] My commits are signed (required for merge) — verify before merge; rebase to sign if needed
[x] I added a changelog fragment for user-facing changes — skipped per template guidance (docs-only changes can skip)

jimmyye123 and others added 5 commits April 20, 2026 20:36
- Replace transferWithAuthorization with receiveWithAuthorization
  (enforces msg.sender == to, blocks mempool signature extraction)
- Expand Section 12.13 with parameter-substitution front-running
  and deterministic-nonce mitigation (keccak256 over channel params)
- Pack (v, r, s) into bytes signature in openWithAuthorization /
  topUpWithAuthorization for consistency with settle / close

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- topUpWithAuthorization gains topUpSalt parameter; nonce formula
  becomes keccak256(channelId, additionalDeposit, from, topUpSalt)
  so repeated top-ups of the same amount produce distinct nonces
- TopUp payload (feePayer: true) carries topUpSalt
- Voucher-merge deposit.salt becomes unconditional Required
  (dual-purpose: channelId on open, topUpSalt on topUp)
- close() forfeit path: signature MAY be empty when
  cumulativeAmount <= channel.settled
- Token compatibility note: escrow calls USDC v2.2 bytes overload
  of receiveWithAuthorization directly; (v,r,s)-only tokens are
  unsupported
- ERC-1271 smart-wallet voucher signing: authorizedSigner MAY be
  either an EOA (ecrecover) or an ERC-1271 contract wallet
  (isValidSignature), removing the EOA-delegation requirement

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 20, 2026

@jimmyye123 is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the specs Spec changes or additions label Apr 20, 2026
@jithinraj
Copy link
Copy Markdown
Contributor

This is a strong addition, @jimmyye123.

The one thing I’d lock down before multiple SDKs implement it is session continuity across open / topUp / voucher / close.

A verifier should be able to tell which vouchers belong to one session even after balance changes. I’d add vectors for:

  • open -> voucher -> topUp -> later voucher
  • replay of a pre-topUp voucher against post-topUp state
  • close after partial spend
  • an explicit note that SSE balance signals are advisory, not authoritative settlement evidence

That would keep implementations from drifting on what counts as the same session.

@phdargen
Copy link
Copy Markdown
Collaborator

Hi @jimmyye123, thanks a lot for putting this up! We’ve been working through the same problem space and landed on the batch-settlement EVM spec in #2051, which aligns with the network-agnostic batch-settlement spec from Cloudflare in #1145

Lots of overlap (unidirectional, cumulative vouchers, gasless deposits) with the most notable differences being:

  • Dynamic pricing (like upto)
  • Two-phase claim/settle for efficient multi-channel batching
  • Facilitator can also sponsor server-side gas for claim/settle
  • Pluggable deposit collectors via EIP-3009 or Permit2
  • Long-lived channels that can be reused after refund

Closing in favor of #2051 to keep discussion in one place, we would appreciate your feedback there

@phdargen phdargen closed this Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

specs Spec changes or additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants