Skip to main content

Security Model

Core Principles

On-chain Privacy

  • Balances are encrypted using FHE
  • Transfer amounts are never visible on-chain
  • Only encrypted handles are stored publicly

Trustless Verification

  • Server cannot fabricate payments
  • Amount handles extracted directly from blockchain
  • Client cannot lie about payment amounts

Minimal Authorization

  • Decryption signatures scoped to specific contracts
  • Time-limited authorization (default 365 days)
  • Ephemeral keys for decryption operations

Security Flow

Handle Extraction

Transaction Receipt
|
v
Extract ConfidentialTransfer Event
|
v
Get Encrypted Handle (from chain, not client)
|
v
Verify Recipient Address

The facilitator extracts the encrypted handle directly from the blockchain, preventing clients from providing fake handles.

Decryption Authorization

The decryption signature contains:

FieldPurpose
signatureUser's wallet signature
publicKeyEphemeral public key
privateKeyEphemeral private key
contractAddressesAuthorized contracts
startTimestampAuthorization start
durationDaysValidity period

The privateKey is an ephemeral key, not the user's wallet key.

Verification Checks

The facilitator performs these security checks:

  1. Schema Validation: Request structure matches expected format
  2. Network Match: Payload network matches requirements
  3. Transaction Exists: Receipt found on blockchain
  4. Event Found: ConfidentialTransfer event in logs
  5. Recipient Match: Transfer sent to correct payTo
  6. Sender Match: Transfer from authorized user
  7. Contract Authorization: Token in user's authorized list
  8. Amount Sufficient: Decrypted amount >= required

Threat Mitigation

Client Manipulation

ThreatMitigation
Fake transactionHandle extracted from chain
Wrong amountServer decrypts and verifies
Replay attackTransaction hash uniqueness

Server Attacks

ThreatMitigation
Fabricate paymentCannot decrypt without signature
Scope creepContract addresses limited
Long-term accessTime-limited authorization

Best Practices

For Merchants

  • Verify facilitator responses server-side
  • Store verification results for auditing
  • Use HTTPS for all endpoints

For Users

  • Review authorized contracts before signing
  • Use short authorization periods for testing
  • Revoke old signatures when changing wallets