Repository navigation
Description
Investigation + brainstorm: a simpler "publisher pays" model to replace ERC-1271 / Safe
Status: investigation + design brainstorm. No decision yet.
Spun off from #1431 (removing the off-chain ERC-1271 verification + Safe-as-wallet surface). That removal leaves a gap we want to fill with something simpler than smart-account signature verification: a "publisher pays" / delegated-funding model where an end user doesn't hold TOKEN/USDC or manage a wallet at all — they sign in to a service (the publisher/app), and the service funds their fetches.
This issue is to investigate the design space and brainstorm concrete options. Not milestoned — it's net-new design, not a simplification cut.
The shape of what we want
- A user signs in to an app (e.g. a streaming service built on deCDN). The app already has a funded on-chain identity.
- The user fetches paid content; the app's funds pay the per-MB vouchers, not the user's.
- The user should need little or no crypto UX — ideally a session key issued at sign-in that can authorize fetches/vouchers up to some bound, without exposing the app's main key.
This is the legitimate use case ERC-1271 + session keys were reaching for in ADR 024 — but ADR 024 deferred session keys and shipped a node-side smart-account verification path for clients that don't exist. We want to go the other way: design the session-key "publisher pays" flow directly, as simply as possible.
The two hard problems (must be answered by any proposal)
-
Rate-limiting / spend-bounding. A session key that can spend the app's money must be bounded — per-session cap, per-time-window cap, expiry, revocability. What enforces the bound, and where (on-chain channel invariants, off-chain node policy, the app's own issuance)? What happens when a session key is leaked?
-
Fund-theft / self-dealing (the "Netflix attack"). The scenario: a user signs up to a service, gets a funded session, then repeatedly pays the app's money to a node the attacker controls for content the attacker "serves" to themselves — draining the funder's balance into the attacker's own operator payout. Because delivery is paid per verified byte, the attacker can manufacture "legitimate" paid deliveries to self. What stops a session-holder from routing the funder's money to a colluding node? (Consider: node/operator identity binding, per-content or per-namespace scoping of a session, deny-listing self-dealing patterns, requiring the funded content to belong to the app's own namespace, etc.)
Grounding (read before proposing)
- ADR 003 (payment channels, vouchers, cumulative voucher payment) — the mechanism any delegated-funding model has to plug into.
- ADR 024 (account abstraction) — what was tried (ERC-1271, Safe, deferred session keys) and why it's being dropped (see Remove off-chain ERC-1271 verification + Safe-as-wallet (ADR 024) #1431).
- ADR 012 (client) — client identity, key handling, rotation posture.
- The
incentivecrate (PaymentChannel, vouchers) andclient-pull(buyer-side channel open + cumulative voucher pay).
Deliverable of this investigation
A short design note comparing 2–3 concrete "publisher pays" architectures, each stating how it bounds spend (problem 1) and how it prevents self-dealing (problem 2), with a recommendation and the contract/protocol surface each would need. It should be simpler than ADR 024's smart-account path, or it isn't worth doing.
Open questions
- Does "publisher pays" need any new on-chain surface at all, or can it be a session-key + channel-scoping convention on top of today's
PaymentChannel? - Is scoping a funded session to the app's own namespace (so the funder only ever pays for its own content) enough to defang the self-dealing attack, given ADR 1394's namespace-as-address model?
- Where does session-key issuance/revocation live — purely off-chain in the app, or does the channel need an on-chain "authorized session key" notion?
- How does this interact with the low-operator-barrier and content-agnostic-payment principles?
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
altanoruc commentedon Jul 24, 2026
Automated implementation triage note for a later run: skipped because this issue is explicitly an investigation with no selected design. Before dispatch, pin one publisher-pays architecture, including the exact spend-bound enforcement and revocation point, the self-dealing defense, and whether any new on-chain surface is required. Then split the chosen design into a bounded ADR and/or implementation issue.
alpergundogdu commentedon Jul 27, 2026
The design exploration converged on a single protocol-side primitive: a delegated, immutable
voucherSigneronopenChannel(defaultmsg.sender) that separates who funds from who signs. Same primitive serves publisher-funded no-wallet delivery and self-funded parallel fetch (throwaway signer per channel). Remote signing was rejected (per-voucher round-trips don't survive streaming) and ERC-1271/Safe-as-signer was rejected (repudiation + aneth_callper voucher) — Safe stays as the cold funder, not the signer.Filed as #1476, which also carries the voucher-less
closeChannelchange that removes the capital lock-in on funded channels.Everything else (budgets, expiry, revocation, per-user attribution, rate caps) lives publisher-side off-chain; the deposit is the on-chain loss cap.
alpergundogdu commentedon Jul 28, 2026
The client/CLI side that turns that primitive into the actual no-wallet flow is now scoped in #1481.
Shape: the user signs in to the publisher (off-chain), the publisher opens a channel pinning the user's
voucherSignerand hands back thechannelId(off-chain), the user fetches by id. Everything the investigation put publisher-side — budgets, expiry, revocation, per-user attribution, rate caps — stays there; deCDN's CLI surface is just enough to open on behalf, discover a node, and fetch on a channel it didn't open.Findings worth recording here:
ChannelOpened, and feat(payments): delegated voucherSigner + voucher-less close #1478's delivery binding gate already checks the recovered address againstvoucher_signer. The client tells the node nothing beyond thechannel_idit already sends.voucher_signer, so it doesn't leak to a channel-id guesser), and the client self-heals. The publisher may cache the watermark as an optimisation, not a source of truth.topUp,closeChannel/settle/cleanare all funder-only on-chain, so lifecycle stays with the publisher — which matches the model. The CLI must skip its fetch-time auto-top-up on a delegated channel (it would revert).handle_cooperative_closeis unauthenticated (anyone knowing the chain-derivablechannel_idcan freeze a channel); its fix is the same binding→voucher_signergate, tracked separately.Sequencing: #1481 depends on #1478 (the
voucher_signerpin +closeChannelWithoutVoucher) and shouldn't start until it merges — the schema and fetch changes touch files that PR moves.alpergundogdu commentedon Jul 29, 2026
Investigation complete. The design space converged on a single protocol-side primitive — a delegated, immutable
voucherSigneronopenChannel(defaultmsg.sender) that separates who funds from who signs — with all spend-bounding, expiry, revocation, and per-user attribution living publisher-side off-chain (the deposit is the on-chain loss cap), and the app's-namespace scoping defanging the self-dealing/"Netflix attack" case. Remote signing and ERC-1271/Safe-as-signer were both rejected.All spawned work has landed:
PaymentChannel: delegatedvoucherSigner+ voucher-less close (merged)Closing as completed.