Skip to content

PaymentChannel: delegated voucherSigner + voucher-less close #1476

Closed

Description

@alpergundogdu

1 - openChannel(address provider, uint256 deposit, address voucherSigner)

Adds voucherSigner — the address the four settlement paths (withdraw, closeChannel, disputeChannel, cooperativeClose) verify vouchers against, instead of ch.client. ch.client stays the funder and refund destination.

  • publishers can open channels on behalf of users to fund their downloads
  • clients can create voucher-signing keys without moving money to smaller wallets, allowing parallel downloads without managing vouchers between multiple "in-use" channels
  • drops thousands of remote signatures / eth_calls when using a Safe as custody — voucher generation and validation stay fast (local ecrecover), Safe stays cold as the funder

Details:

  • voucherSigner == address(0) defaults to msg.sender (unchanged self-signing behaviour)
  • No setVoucherSigner. Pinned at open, never mutable — immutability is the security property (repudiation-proofing: a mutable signer could retroactively void a voucher a node already earned). State the "no setter" explicitly, don't leave it implied by "immutable."
  • ChannelOpened must emit voucherSigner (indexed). The node builds channel state directly from this event — without the field it needs an extra getChannel RPC per channel. Structural, not cosmetic.
  • channelId derivation unchanged — stays keccak256(client, provider, nonce), not keyed on voucherSigner, so the funder still controls the nonce sequence and can predict IDs.
  • cooperativeClose becomes signable by the hot voucherSigner. A compromised hot key can force-settle at the watermark — bounded, no funds redirect (refund still goes to ch.client), but it's not zero authority, so say so.
  • InterfaceFreeze.t.sol: this breaks the frozen openChannel selector → deliberate re-freeze.

2 - closeChannel: drop the ch.claimedNonce == 0 guard on the existing voucher-less path

Lets a party close at the recorded watermark without presenting a voucher.

  • today a publisher must request and store a user voucher to close a used channel; if lost or withheld, the channel is stuck until expiry — up to 90 days of capital lock-in
  • safe: the watermark was already validated when set (withdraw runs the same checks), and the counterparty keeps its disputeChannel ratchet-up right during the dispute window. A voucher is still required only to raise the watermark.

3 - closeChannelWithoutVoucher(bytes32 channelId)

Convenience entrypoint / explicit signature to close at the recorded watermark without requiring or storing a voucher. Thin alias over the same shared close logic as (2); callable by client or provider.

  • InterfaceFreeze.t.sol: adds a new selector → additive baseline update.

4 - Node-side keying (Rust) — splits the payer/signer roles currently fused under state.client

  • ChannelState gains voucher_signer, hydrated from the ChannelOpened event; verify vouchers against it in channel.rs
  • move the signer checks to voucher_signer: binding gate (dispatch.rs), anti-leech / pull gate (fill.rs)
  • keep the funder checks on state.client — the trap: the three ADR-011 blacklist gates (dispatch.rs, window.rs, delivery.rs) refuse to serve any channel funded by a blacklisted address. A blanket state.client → voucher_signer rename silently moves takedown enforcement onto the throwaway signing key and breaks compliance with no compiler/test error.
  • existing records hydrate voucher_signer = client

(file references approximate — confirm against HEAD.)

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