fhenix-confidential-auction
Installation
SKILL.md
Fhenix Confidential Auction
Overview
A fully confidential auction: bids stay encrypted during bidding (no one can see or react to the current high bid), and the winner is revealed only after close via the decrypt-with-proof flow. Demonstrates encrypted inputs, encrypted comparison/selection, ACL, and on-chain decryption together.
Pattern
- State:
euint64 highestBid,eaddress highestBidder(both encrypted). - Bid: encrypt, compare with
FHE.gt, update withFHE.max+ branchlessFHE.select, thenFHE.allowThisboth new handles. - Close: auctioneer calls
FHE.allowPublic(highestBid)andFHE.allowPublic(highestBidder). - Reveal: client
decryptForTx(...).withoutPermit()each handle off-chain → submit torevealWinnerwhichFHE.publishDecryptResults both.
Reference contract
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19 <0.9.0;
import "@fhenixprotocol/cofhe-contracts/FHE.sol";