1.1. Asynchronous FHE Coprocessing
Traditional on-chain sealed-bid auctions execute Fully Homomorphic Encryption (FHE) comparisons (FHE.gt, FHE.select) synchronously within the transaction lifecycle. This approach forces the settlement layer to bear computational overhead that scales linearly with bid volume, resulting in gas costs 10x–100x higher than standard ERC-20 transfers and creating severe sequencer bottlenecks.
Fhenix-FairMarket v2.0 replaces this paradigm with an Asynchronous FHE Coprocessing (CoFHE) architecture. By offloading cryptographic heavy lifting to specialized off-chain processors and retaining only lightweight state validation on-chain, the protocol achieves O(1) storage complexity and near-zero computational latency for the base layer.
Core Design Principles
| Principle | Implementation |
|---|---|
| Computation/Settlement Decoupling | The L2 chain acts solely as a state ledger and event broadcaster. FHE comparisons are delegated to FHEOS coprocessor nodes. |
| O(1) On-Chain Storage | Only a bytes32 ciphertext hash is persisted per bid. No full FHE objects or intermediate decryption states are written to Storage or Events. |
| Event-Driven Finalization | finalizeAuction() emits a DecryptionRequested event and transitions the state to RESOLVING. Zero FHE math executes on-chain during closure. |
| Solvency Pre-Validation | A lightweight encrypted check FHE.lte(encryptedBid, escrowBalances[msg.sender]) runs at submission time to reject invalid bids before they enter the coprocessor queue. |
️ Technical Implementation
1. Encrypted Bid Submission (placeBid)
function placeBid(uint256 auctionId, InEuint32 calldata encryptedBid) external {
require(state == ACTIVE, "Auction not active");
require(block.timestamp < endTime, "Auction expired");
// O(1) Solvency Gate: Rejects bids exceeding deposited escrow
FHE.lte(encryptedBid, FHE.asEuint32(escrowBalances[msg.sender]));
// Only hash stored. No FHE evaluation, no decryption, no loops.
ciphertextHashes[auctionId].push(keccak256(abi.encode(encryptedBid)));
emit BidPlaced(auctionId, msg.sender, keccak256(abi.encode(encryptedBid)));
}2. Asynchronous Finalization Trigger (finalizeAuction)
function finalizeAuction(uint256 auctionId) external {
require(state == ACTIVE, "Invalid state");
require(block.timestamp >= endTime, "Auction still active");
// State transition without computation
state = AuctionState.RESOLVING;
// Dispatch event to off-chain Keeper/CoFHE layer
emit DecryptionRequested(auctionId, ciphertextHashes[auctionId]);
}Architectural Impact & Gas Comparison
| Metric | Traditional Synchronous FHE | Fhenix-FairMarket Async CoFHE |
|---|---|---|
| Gas per Bid | ~500k – 2M+ (scales with bid count) | ~15k – 25k (constant O(1)) |
| Sequencer Load | High blocking computation during closure | Near-zero; non-blocking event emission |
| Finality Dependency | Tied to L2 block production & FHE circuit verification | Decoupled; parallelized off-chain processing |
| Storage Footprint | Full ciphertext arrays + intermediate states | bytes32 hash per participant |
| DoS Vulnerability | High (malicious bids can exhaust block gas) | Neutralized (invalid bids revert pre-dispatch) |
️ Security & Reliability Guarantees
- Timing Side-Channel Immunity: Since no FHE comparison executes on-chain, attackers cannot infer bid magnitudes by measuring transaction gas or execution time.
- Queue Overflow Prevention: The
FHE.ltesolvency gate acts as a cryptographic firewall. Bids exceeding the publicly depositedescrowBalancesrevert instantly, preventing malicious actors from flooding the off-chain coprocessor with invalid ciphertexts. - State Integrity Preservation: The
RESOLVINGstate locks new bid submissions. Even if the off-chain layer experiences latency, the on-chain state remains deterministic and auditable. - Fallback Compatibility: If the coprocessor network experiences prolonged downtime, the
Dynamic Dead Man's Switch(detailed in §2.4) triggers automatically, transitioning the auction toVOIDEDand guaranteeing 100% fund recovery without requiring decryption.
Next Steps
- Proceed to 1.2 CoFHE Off-Chain Processing to understand how
FHEOSservers handle batched ciphertext comparisons.- Review 1.3 EigenLayer AVS Verification for the cryptoeconomic finality model.
- See 2.2 O(1) On-chain Storage for threat mitigations around ciphertext persistence.