A sealed-bid auction with fully homomorphic encryption (FHE) is an onchain auction where every bid is encrypted before it touches the chain, the contract compares bids without ever decrypting them, and only the winner and clearing price are revealed at the end. You build it on Fhenix CoFHE, the FHE coprocessor that runs live on Ethereum Sepolia, Arbitrum Sepolia, and Base Sepolia today, with mainnet on the roadmap. This is an advanced project, and it is one of the sharpest ways to prove you can write confidential smart contracts that most Solidity developers cannot.
What you are building and who it is for
The product is a first-price or second-price (Vickrey) sealed-bid auction contract. Bidders submit encrypted bids as euint values. The contract runs homomorphic comparisons to track the highest bid and the leading bidder, all on ciphertext. When the auction closes, the contract requests decryption of the winning bid only, and settles onchain. No competitor ever sees a losing bid, and no one, including the auctioneer, can front-run based on bid amounts.
This is for developers targeting confidential DeFi, NFT drops, RWA auctions, MEV-resistant markets, and any use case where visible mempool bids leak strategy. It is also for anyone building toward the FHE and privacy ecosystem forming around Fhenix, Zama, and Inco. If you want to be the developer these teams notice, an end-to-end confidential auction is a strong, legible proof of skill.
Why this positions you as a developer on Fhenix
Most Solidity developers have never touched encrypted types. Writing a working FHE auction forces you to understand the three hard parts of confidential contracts: encrypted arithmetic and comparison, access control on ciphertext, and the asynchronous decryption flow. Fhenix published its FHE Rollup whitepaper in March 2026 and secured a strategic investment from BIPROGY and the Translink Sustainability and Innovation Fund in October 2025, so the ecosystem is funded and growing. Shipping a real confidential dApp now, while the tooling is fresh, is exactly the kind of onchain work that gets you cited, invited, and remembered. See our take on positioning at /insights.
The build path and stack
Start with the official CoFHE Hardhat starter, which ships a Counter.sol example using euint32 and FHE.add. There is also a Foundry mocks package if you prefer Foundry. The core stack is:
- Contracts: Solidity with
import "@fhenixprotocol/cofhe-contracts/FHE.sol";and encrypted types likeeuint32,euint128, andebool. - Client SDK:
cofhejsfor encrypting bids in the browser, and unsealing revealed values. - Local testing: the CoFHE mock contracts, a 1:1 drop-in replacement so
FHE.decryptandFHE.sealoutputresolve synchronously in tests. - Networks: deploy to Ethereum Sepolia, Arbitrum Sepolia, or Base Sepolia.
Contract logic, step by step
- Bid submission. Accept an encrypted bid
InEuint128from the client, convert it withFHE.asEuint128, and store it per bidder. CallFHE.allowThisso the contract can operate on the ciphertext, andFHE.allowSenderso the bidder retains access. - Running winner. On each bid, compute an
eboolwithFHE.gt(newBid, highestBid), then useFHE.selectto update the encryptedhighestBidand the encryptedwinningBidderwithout branching on plaintext. Neverifon a decrypted value mid-auction, that defeats the privacy. - Close and reveal. After the deadline, call
FHE.decrypton the winning bid. Decryption happens off-chain in CoFHE and the plaintext is posted back on-chain in the TaskManager's PlaintextStorage, so this is asynchronous. Poll or use a callback pattern, then settle. - Settlement. Transfer the asset to the winner and, for a Vickrey auction, charge the second-highest encrypted bid, which you track with the same
FHE.selectpattern.
Frontend
Use cofhejs to encrypt the bid amount client-side before it is ever broadcast. For the reveal, the contract calls FHE.allow to grant the caller permission, then the frontend calls cofhejs.unseal to read the cleartext result. The cofhe-miniapp-template gives you a Base miniapp starting point.
Common pitfalls
- Assuming encrypted means access-controlled. Privacy is not private by default. If you forget
FHE.allowThisorFHE.allow, operations revert or values are unreadable. Access control is explicit on every ciphertext. - Branching on ciphertext. You cannot
requireorifon anebooldirectly. UseFHE.selectfor conditional logic and only decrypt at the very end. - Treating decryption as synchronous. In tests with mocks it resolves instantly, but on a live network
FHE.decryptandFHE.sealoutputare async. Design your close-and-settle flow around a callback or polling step, or it will break in production. - Gas and ciphertext size. FHE operations are far more expensive than plaintext. Keep the encrypted state minimal, prefer the smallest
euinttype that fits your bid range, and avoid looping homomorphic comparisons over large arrays. - Leaking through metadata. Bid timing, gas, and event logs can leak signal even when amounts are hidden. Think about what your events emit.
How DEPLOYR builds and ships it with you
DEPLOYR builds this with you and gets it deployed to a live testnet under your name and wallet. We scaffold the CoFHE Hardhat or Foundry project, write the encrypted auction contract with the FHE.select winner logic and the async reveal flow, wire up cofhejs on the frontend, and set up the mock-based test suite so you can iterate fast. You end up with a real confidential dApp in your portfolio, verified onchain, plus a build log that shows you did the work. That is the storefront: your deployments, provable, yours.
Because FHE is genuinely advanced, this is the kind of build that separates you from the crowd of tutorial-followers. Start at /build to spec your auction, browse /hackathons for FHE and privacy tracks where this project fits, and read more at /insights.
Airdrops are never guaranteed, and no one can promise you a payout. What we can do is help you ship real, verifiable onchain work that makes you the kind of developer these ecosystems actually look for.