TECHNICAL PROTOCOL v1.0.4

FHE Auction Infrastructure

Privacy-preserving sealed-bid auction platform, built on Zama's FHEVM v0.9. Truly confidential bidding where bid amounts remain encrypted throughout the lifecycle.

🔒

End-to-End Privacy

Bid amounts are encrypted client-side and never revealed during calculation.

Instant Verification

Cryptographic proofs ensure the winner is valid without leaking amounts.

🎨

Asset Escrow

Native support for ERC-721 and ERC-1155 collectible targets.

📈

On-chain Indexing

Real-time state tracking powered by decentralized subgraphs.

User Flow Overview

The platform caters to two primary user roles, each with a streamlined, encrypted interaction path designed for maximum security.

Bidder Journey

1.Connect Wallet
2.Browse Active Auctions
3.Select Target
4.Sign Encrypted Bid
5.Wait for End
6.Verify Result

Seller Journey

1.Connect Wallet
2.Deploy Auction Instance
3.Escrow NFT Target
4.Monitor Encrypted State
5.Trigger Settlement
6.Receive Payment

01 Protocol Core

1

PENDING

Initial validation

2

ACTIVE

Bidding window open

3

ENDED

Homomorphic calculation

4

REVEALED

Winner declared

FHE Encryption Flow

Plaintext Bid
5.00 ETH
fhe.encrypt()
Ciphertext Handle
0x4a7f...3d82
Bid A (Ciphertext)
enc(3)
FHE.gt()
Homomorphic Op
Bid B (Ciphertext)
enc(5)
Result
Ciphertext(false)

Computation succeeded on-chain without any party (including validators) seeing the actual values.

02 System Stack

User Interface

Next.js / React / MetaMask

Web3 Integration

Wagmi + Ethers.js / Viem

FHE SDK

Zama Relayer SDK (TFHE-rs)

Smart Contracts

Solidity + FHEVM Protocol

Execution Layer

Sepolia Testnet / Zama L1

AuctionFactory
FirstPriceAuction.sol
BaseAuction.sol (Inheritance)
ERC721.sol
FHEVM.lib

03 FHEVM Workflow

EntityActionTarget
Seller
—— Deploy Auction ——▶
Factory
Bidder
—— Submit Encrypted Bid ——▶
Contract
Timer
—— Block Height Met ——▶
Trigger
Admin
—— Call endAuction() ——▶
KMS
Relayer
—— Generate Proof ——▶
Client
Client
—— revealWinner(proof) ——▶
Contract
Smart Contract Event
Graph Node Listener
Mapping Handler
Schema Entity Update
GraphQL Store
Frontend Query (Apollo)

04 Security Model

Privacy Design Principles

Confidentiality

No validator can view the bid amounts. Only the KMS can decrypt results based on threshold signatures.

Verifiability

All computations are deterministic and verified on-chain. Decryption proofs must be submitted by the reveal agent.

05 Privacy Implementation

Zama FHEVM v0.9 powers a suit of privacy features that shield auction mechanics from prying eyes.

Privacy ComponentBenefit
Encrypted BidsBid amounts hidden until auction ends
Encrypted WinnerWinner identity hidden during active phase
Private ReserveMinimum price hidden from bidders to prevent strategic gaming
Hidden Bidder CountTotal participation volume obscured during live bidding
Self-Relaying DecryptionOracle-free verifiable decryption via v0.9

Access Control & FHE Select

We use FHE.allow() to ensure only the authorized contract and the bidder can interact with the encrypted data.

solidity
// Grant access permissions
FHE.allowThis(bidAmount);           // Contract can use this value
FHE.allow(bidAmount, msg.sender);   // Bidder can decrypt their own bid

// Compare without revealing
ebool isGreater = FHE.gt(currentBid, maxBid);
maxBid = FHE.select(isGreater, currentBid, maxBid);

06 Testing & Reliability

100%

85/85 Passing Tests 🎉

Comprehensive coverage across factory deployment, FHE operations, and edge cases.

AuctionFactory.test.ts
Initialization (5)
Requests (9)
Registration (7)
Rejections (4)
View Queries (6)
FirstPriceAuction.test.ts
Encryption Flow (11)
Termination (6)
NFT Support (6)
Performance (1)
Edge Cases (4)
bash
# Run full protocol suite
npx hardhat test

# Scalability Verification
npx hardhat test test/Scalability.test.ts

07 Email Notifications

Automated notifications via Resend for seamless participant engagement.

⛓️
Event Emit
API
Route
🚀
Resend
📧
Recipient
🔨

Auction Ended

Seller

Alerts seller to reveal winner.

🏆

Winner Reveal

Winner

Step-by-step NFT claim instructions.

📊

Auction Result

Bidders

Refund status and result summary.

json
POST /api/send-notification
{
  "to": "recipient@example.com",
  "type": "winner_announced",
  "data": { "auctionTitle": "Rare Artifact", "winningBid": "5.5 ETH" }
}

08 API Reference

MethodParamsType
placeBid()euint32, bytes proofExternal
revealWinner()uint32, bytes proofPublic

09 Installation

bash
git clone https://github.com/fhe-auction/protocol.git
npm install
npx hardhat node --network fhevm

# Configure Environment
RESEND_API_KEY=re_xxx
SEPOLIA_RPC=xxx

10 How to Place a Bid

1

Connect Wallet

Use MetaMask or any Web3 wallet. Ensure you are on the Sepolia Testnet (Chain ID: 11155111).

2

Enter Bid Amount

Input your bid. The Zama SDK will immediately salt and encrypt this value locally.

3

Set Escrow

A public escrow (>= bid) is required to guarantee final settlement. This is fully refundable.

4

Sign & Submit

Confirm the transaction. Your bid is transmitted as an opaque handle to the EVM.

Guaranteed Escrow Safety

Your escrow is held by the smart contract's immutable logic. If you do not win the auction, your funds are automatically available for claim immediately after the reveal phase.

FHE Auction

Privacy Primitive Architecture

© 2024 FHE LABS PROTOCOL GROUP