Skip to main content

x402 FHE

Privacy-preserving payments using Fully Homomorphic Encryption (FHE) on Ethereum.

What is x402 FHE?

x402 FHE implements the HTTP 402 Payment Required protocol using fhEVM technology. It enables pay-per-access to resources using confidential tokens where balances and transfer amounts remain encrypted on-chain.

Key Features

  • Confidential Payments: Transfer amounts are encrypted using FHE
  • On-chain Privacy: Balances are never exposed publicly
  • ERC7984 Tokens: Standard interface for confidential tokens
  • Server-side Verification: Payment amounts verified without revealing values

Architecture

The system consists of three main components:

ComponentDescription
FacilitatorBackend service that verifies FHE payments
FrontendNext.js application with wallet integration
fhevm-sdkSDK for FHE operations in React

How It Works

  1. Client requests a protected resource
  2. Server returns HTTP 402 with payment requirements
  3. Client makes a confidential token transfer
  4. Client sends transaction hash to server
  5. Facilitator extracts and decrypts the transfer amount
  6. Server grants access if payment is valid

Production Facilitator

A hosted facilitator service is available for Sepolia testnet:

ServiceURL
Facilitator APIhttps://zama-facilitator.ultravioletadao.xyz
Health Checkhttps://zama-facilitator.ultravioletadao.xyz/health

Provided by Ultravioleta DAO.

License

BSD-3-Clause-Clear