Skip to content

Implement EIP-712 payment voucher creation and verification #319

Closed

Description

@alpergundogdu

Context

ADRs 003 and 004 specify off-chain USDC payment channels with EIP-712 voucher signatures. This is required for cdn/client/v1 — without vouchers, nodes cannot be paid for serving content.

Scope (crates/incentive)

  • Voucher struct: channel_id, amount (cumulative USDC), nonce (monotonically increasing), signature (secp256k1 over EIP-712 typed data)
  • Voucher creation (client-side): sign cumulative payment amount using Ethereum keystore
  • Voucher verification (server-side): recover signer address, verify channel_id matches, verify amount >= previous, verify nonce > previous
  • Channel state tracking: per-channel cumulative bytes served, last voucher amount/nonce
  • Rate enforcement: verify amount_delta / bytes_delta >= rate_per_mb within tolerance

EIP-712 domain

EIP712Domain {
  name: "deCDN Payment Channel",
  version: "1",
  chainId: <arbitrum_sepolia_chain_id>,
  verifyingContract: <payment_channel_address>
}

References

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