RaycashDocs
Protocol

Protocol Overview

Design principles and component map of the Raycash protocol.

The Raycash protocol is a set of smart contracts that convert cleartext ERC-20 tokens into FHE-encrypted confidential tokens, enforce compliance policy via hooks, and enable privacy-preserving deposits and withdrawals.

Design Principles

  1. Privacy by default — All balances are FHE-encrypted. Transfers use FHE.select to avoid balance-revealing reverts.
  2. Exit always callable — Burns and unwraps are never blocked by hooks. Users can always leave the encrypted domain.
  3. Custody/policy separation — The immutable wrapper holds tokens; configurable hooks enforce compliance policy.
  4. Counterfactual deposits — Users send tokens to a pre-computed CREATE2 address. No on-chain interaction required from the depositor.
  5. Permissionless finalization — Both wrap finalization and unwrap finalization can be triggered by anyone with valid proofs.
  6. Rage quit — Users can always recover cleartext tokens from their depositor address, even if the admin never calls initWrap().

Component Map

ComponentContract(s)Description
ConfidentialERC20ERC7984, ConfidentialERC20, ERC7984ERC20WrapperFHE-encrypted balances (via OpenZeppelin ERC7984) and amount scaling
WrappingRaycashWrapperOperator-gated initWrap() flow with CREATE2 depositors, encrypted recipients, and decoys
UnwrappingRaycashWrapperTwo-phase unwrap flow with permissionless relayer finalization
Hooks3 interfaces, RaycashKycHookPolicy enforcement separated from token custody
AttestationRaycashKycAttesterResolverEAS-based KYC attestation with single-attester policy
DepositsRaycashDepositor (CREATE2)Counterfactual CREATE2 deposits with FHE-encrypted recipients, integrated into the wrapper
Card EscrowCardChargesEscrowPassive escrow for card charge settlement via unwrap flow

Contract Dependency Graph

Was this page helpful?

On this page