Engineering notes/Security & trust model

Security & trust model

What Cadence enforces onchain, what's rate-limited off-chain, and where the trust boundaries actually sit.

What's enforced onchain#

  • Circle terms (contribution, deposit, member count, cadence, payout order) are immutable once deployed.
  • Every fund-moving function (join, leave, contribute, replenishDeposit, coverDeposit, executePayout, withdrawDeposit) is reentrancy-guarded.
  • Payout execution and default detection are restricted to the authorized keeper; every other member action is open to any member.
  • Withdrawals are pull-based per member, not a bulk loop, so one address can't block a refund for everyone else.

What the relay enforces off-chain#

  • Only a fixed allow-list of function selectors is ever sponsored — arbitrary calldata is never forwarded, even to a trusted target.
  • Every sponsored request is capped at a fixed gas limit and rate-limited per wallet per day.
  • The signature is re-verified onchain by the relay workflow itself before submission — the API route's own check is never trusted as the last word.

Off-chain data (names, email, reminders)#

Circle names and notification preferences live in Postgres, not onchain — there was nowhere onchain for them to go. Every write there requires a freshly signed message binding the exact values being saved and a short expiry window, so a captured signature can never be replayed to write something different, or replayed later after it's gone stale.