1. Core Architecture1.1 Async FHE Coprocessing

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

PrincipleImplementation
Computation/Settlement DecouplingThe L2 chain acts solely as a state ledger and event broadcaster. FHE comparisons are delegated to FHEOS coprocessor nodes.
O(1) On-Chain StorageOnly a bytes32 ciphertext hash is persisted per bid. No full FHE objects or intermediate decryption states are written to Storage or Events.
Event-Driven FinalizationfinalizeAuction() emits a DecryptionRequested event and transitions the state to RESOLVING. Zero FHE math executes on-chain during closure.
Solvency Pre-ValidationA 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

MetricTraditional Synchronous FHEFhenix-FairMarket Async CoFHE
Gas per Bid~500k – 2M+ (scales with bid count)~15k – 25k (constant O(1))
Sequencer LoadHigh blocking computation during closureNear-zero; non-blocking event emission
Finality DependencyTied to L2 block production & FHE circuit verificationDecoupled; parallelized off-chain processing
Storage FootprintFull ciphertext arrays + intermediate statesbytes32 hash per participant
DoS VulnerabilityHigh (malicious bids can exhaust block gas)Neutralized (invalid bids revert pre-dispatch)

️ Security & Reliability Guarantees

  1. Timing Side-Channel Immunity: Since no FHE comparison executes on-chain, attackers cannot infer bid magnitudes by measuring transaction gas or execution time.
  2. Queue Overflow Prevention: The FHE.lte solvency gate acts as a cryptographic firewall. Bids exceeding the publicly deposited escrowBalances revert instantly, preventing malicious actors from flooding the off-chain coprocessor with invalid ciphertexts.
  3. State Integrity Preservation: The RESOLVING state locks new bid submissions. Even if the off-chain layer experiences latency, the on-chain state remains deterministic and auditable.
  4. Fallback Compatibility: If the coprocessor network experiences prolonged downtime, the Dynamic Dead Man's Switch (detailed in §2.4) triggers automatically, transitioning the auction to VOIDED and guaranteeing 100% fund recovery without requiring decryption.

Next Steps