3. Market MechanicsMarket Mechanics

3. Market Mechanics

The Fhenix-FairMarket protocol fundamentally restructures auction theory by integrating Fully Homomorphic Encryption (FHE) into the core market mechanics. Traditional sealed-bid auctions struggle to balance privacy with fairness, often leaking information to validators or allowing manipulators to exploit the mempool.

Version 2.0 replaces “trust in transparency” with “trust in cryptographic proof”. By hiding bid values until the exact moment of resolution and enforcing economic collateral for participation, the protocol neutralizes predatory trading behaviors while ensuring that the highest bidder wins at the fairest possible price point.


3.1. Sealed-Bid Auctions

In a traditional blockchain auction, every transaction is visible in the mempool before confirmation. Fhenix-FairMarket eliminates this visibility gap by implementing a Sealed-Bid architecture where all financial commitments are encrypted on the client side before ever touching the network.

Core Implementation

  1. Client-Side Encryption: Bidders use @cofhe/sdk to convert their intended value into an InEuint32 ciphertext locally. The plaintext value never traverses the network, the mempool, or the node infrastructure.
  2. O(1) Ciphertext Vault: The smart contract accepts the ciphertext and stores only its bytes32 cryptographic hash in the ciphertextHashes mapping. This creates an immutable, “Dark Calm” registry where the number of participants is public, but their financial intent remains mathematically sealed.
  3. Async Resolution: The auction contract does not attempt to read or compare these bids on-chain. Instead, it waits for the endTime to dispatch the entire encrypted registry to the FHEOS Off-Chain Coprocessor for evaluation.

️ Technical Flow

// Bidders interact with the sealed vault. No bid value is revealed.
function placeBid(uint256 auctionId, InEuint32 calldata encryptedBid) external {
 require(state == AuctionState.ACTIVE, "Auction not active");
 require(block.timestamp < auctions[auctionId].endTime, "Expired");
 
 // Encrypted solvency check ensures bid <= public escrow ceiling
 FHE.lte(encryptedBid, FHE.asEuint32(escrowBalances[msg.sender]));
 
 // Only the hash is stored. The ciphertext is ephemeral.
 bytes32 bidHash = keccak256(abi.encode(encryptedBid));
 auctions[auctionId].ciphertextHashes.push(bidHash);
 
 emit BidPlaced(auctionId, msg.sender, bidHash);
}

3.2. Vickrey Price Sharing

The protocol natively supports Vickrey Auctions (Second-Price Auctions), ensuring that the winner pays the price of the second-highest bid rather than their maximum ceiling. This encourages participants to bid their true maximum valuation without fear of overpaying.

Off-Chain Computation & On-Chain Verification

Because evaluating second-price logic requires comparing all bids against each other, executing this synchronously on-chain would be computationally prohibitive. Fhenix-FairMarket solves this via the Asynchronous CoFHE Model:

  1. Off-Chain Sorting: The FHEOS server receives the batch of ciphertexts and uses FHE.select constant-time multiplexers to sort the bids and identify both the Winner and the Second-Price Value.
  2. Encrypted Result Return: FHEOS returns the encrypted winner identifier and the encrypted second-price value.
  3. AVS Verification: The EigenLayer AVS operators cryptographically sign this result. The smart contract verifies the aggregated signature (avsProof) via submitResolution() and transitions the state to FINALIZED.

Economic Impact

  • Bidder Efficiency: Rational bidders can confidently bid their exact upper limit, optimizing market liquidity.
  • Seller Security: The seller receives the true market value determined by competition, without manipulating the outcome.
  • Gas Optimization: Complex Vickrey math runs off-chain; the contract simply executes the verified distribution.

3.3. MEV Front-Running Protection

Maximal Extractable Value (MEV) bots typically exploit sealed-bid auctions by reading pending transactions in the mempool and front-running them to manipulate prices or steal opportunities. FHE renders MEV extraction mathematically impossible.

Neutralization Mechanism

  • Opaque Mempool Payloads: Since placeBid() transactions contain only encrypted bytes32 hashes and solvency proofs, validators and bots cannot determine the value or target of the bid.
  • Ordering Irrelevance: In a sealed-bid system, the final winner is determined by the value of the bid, not the timestamp of arrival. Being first in the block provides zero competitive advantage.
  • Protected Solvency Gate: Even the FHE.lte solvency check executes homomorphically. An MEV bot cannot determine a user’s available capital to front-run their deposit.
ScenarioTraditional AuctionFhenix-FairMarket FHE
Pending Transaction VisibilityFull plaintext bid value visibleOpaque ciphertext + hash only
Front-Running ProfitabilityHigh (bots can outbid instantly)Zero (value cannot be read)
Sandwich Attack VectorExploits public liquidity intentNeutralized (encrypted state)

3.4. Bid Sniping Prevention

Bid Sniping occurs when participants wait until the final seconds of an auction to submit a bid, preventing others from reacting. While sniping is sometimes seen as a “strategy,” in automated markets, it is often facilitated by scripts that exploit the visibility of the current highest bid.

Prevention Architecture

  1. Blind Bidding: Since all bids are encrypted (Sealed-Bid), a sniper has no data to target. They cannot see the current highest bid to outbid it by the minimum increment because the “current highest bid” is never computed or displayed until the auction closes.
  2. Hard State Closure: At endTime, the triggerFinalize() function is called (by a Keeper or user). This immediately transitions the state from ACTIVE to RESOLVING.
// State transition locks the registry instantly
auctions[auctionId].state = AuctionState.RESOLVING;
emit DecryptionRequested(auctionId, ciphertextHashes);

Any transaction attempting to placeBid() after this transition reverts instantly, regardless of network propagation delays. 3. Dynamic Dead Man’s Switch: If network congestion delays the triggerFinalize() call, the Dynamic Timeout ensures the auction voids or resolves safely, preventing snipers from exploiting “zombie” auctions.


3.5. Sybil Bidding Mitigation

In anonymous blockchain environments, malicious actors often create hundreds of “Sybil” (ghost) accounts to flood the auction, artificially inflate demand, or waste the seller’s time.

Collateral-Pegged Entry Barrier

Fhenix-FairMarket enforces a Dummy Ceiling Deposit model (lockEscrow) to attach real economic weight to every bid.

  • Upfront Capital Requirement: To participate, a user must call lockEscrow() and deposit ETH/WETH. The contract records this public balance.
  • Solvency Enforcement: When a user submits an encrypted bid, the contract checks FHE.lte(encryptedBid, escrowBalances[msg.sender]). If the user attempts to bid more than their public deposit, the transaction reverts.
  • Economic Disincentive: Every ghost account requires real capital to lock. If the auction is cancelled by the seller (cancelAuction()), the seller’s deposit is seized by SlashedPot.sol and distributed pro-rata to all valid bidders as compensation for their time and gas.

Impact on Market Quality

  • Signal-to-Noise Ratio: High. Only serious participants with available capital enter the registry.
  • Seller Accountability: Sellers cannot cancel auctions without severe financial penalty, as their entire deposit is at risk.
  • Platform Neutrality: The protocol takes 0% cut of these penalties, ensuring the funds go directly to the affected bidders.

Next Steps