Skip to content

Investigation: a simpler "publisher pays" model to replace ERC-1271 / Safe #1444

Closed

Description

@alpergundogdu

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)

  1. 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?

  2. 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 incentive crate (PaymentChannel, vouchers) and client-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

  1. 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?
  2. 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?
  3. 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?
  4. How does this interact with the low-operator-barrier and content-agnostic-payment principles?

Activity

  1. altanoruc commented on Jul 24, 2026

    @altanoruc
    Contributor

    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.

  2. self-assigned this
    on Jul 26, 2026
  3. alpergundogdu commented on Jul 27, 2026

    @alpergundogdu
    ContributorAuthor

    The design exploration converged on a single protocol-side primitive: a delegated, immutable voucherSigner on openChannel (default msg.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 + an eth_call per voucher) — Safe stays as the cold funder, not the signer.

    Filed as #1476, which also carries the voucher-less closeChannel change 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.

  4. alpergundogdu commented on Jul 28, 2026

    @alpergundogdu
    ContributorAuthor

    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 voucherSigner and hands back the channelId (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:

    • No new wire handshake. Nodes already learn channels from ChannelOpened, and feat(payments): delegated voucherSigner + voucher-less close #1478's delivery binding gate already checks the recovered address against voucher_signer. The client tells the node nothing beyond the channel_id it already sends.
    • Resume is the one non-obvious constraint. A client can't reconstruct its voucher watermark from chain (the claim watermark is 0 until settlement). Resolved without a wallet or a query round-trip: on a regression reject, the node bundles its true watermark (gated on a signature recovering to 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.
    • The delegate can only spend. topUp, closeChannel/settle/clean are 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).
    • Adjacent hardening: handle_cooperative_close is unauthenticated (anyone knowing the chain-derivable channel_id can freeze a channel); its fix is the same binding→voucher_signer gate, tracked separately.

    Sequencing: #1481 depends on #1478 (the voucher_signer pin + closeChannelWithoutVoucher) and shouldn't start until it merges — the schema and fetch changes touch files that PR moves.

  5. added this to the v0.1 milestone on Jul 28, 2026
  6. alpergundogdu commented on Jul 29, 2026

    @alpergundogdu
    ContributorAuthor

    Investigation complete. The design space converged on a single protocol-side primitive — a delegated, immutable voucherSigner on openChannel (default msg.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:

    Closing as completed.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions