About
## Wave 2 submission
ShieldFi is a confidential insurance protocol built on Fhenix CoFHE. It solves a fundamental problem: insurance requires sensitive personal data to price risk, but blockchains make everything permanently public. ShieldFi breaks that contradiction — the smart contract computes premiums and validates claims entirely on encrypted inputs, never seeing plaintext age, risk score, coverage amount, or claim details.
This matters because DeFi insurance today is either overcollateralised (because lenders cannot assess risk privately) or it requires trusting a centralised intermediary with your data. FHE is the only technology that enables arithmetic on two unknown encrypted values simultaneously — ZK proofs can verify a statement, but cannot compute riskScore × coverage ÷ 100 when both values are unknown. ShieldFi is only possible on Fhenix.
WHAT WE BUILT THIS WAVE
Smart Contract — ConfidentialInsurance.sol, deployed on Arbitrum Sepolia. The contract implements 11 FHE operations across the full insurance lifecycle:
Premium computation: FHE.mul(riskScore, coverage) → FHE.div(product, 100) → FHE.add(BASE, riskComponent). The protocol computes a personalised premium without knowing any of the inputs.
Claim validation: FHE.lte(claimAmount, coverage) checks the claim does not exceed cover. FHE.gte(severity, 30) checks the incident meets minimum threshold. FHE.and combines both gates. All on ciphertexts.
Tiered payout selection: FHE.select(severity ≥ 70, fullPayout, halfPayout) picks the payout tier based on incident severity — without decrypting either value.
Premium reveal: full 3-step CoFHE decrypt flow using FHE.publishDecryptResult and FHE.getDecryptResultSafe. Only the policy holder can trigger and read their own premium.
Hardhat tasks for deploy, policy registration, and claim filing. 14-test suite verifying FHE computation correctness using the CoFHE mock environment — including premium formula, validity gates, payout tier selection, and the full async decrypt flow.
Frontend — Next.js 15 dApp with glassmorphism UI. Key screens: landing page with live pool stats, a 3-step policy wizard, dashboard showing encrypted policy and claim state, and a claim filing page with a live FHE validation preview that shows users exactly which operations will run on their encrypted inputs before they submit.
AI Risk Advisor — Claude (claude-sonnet-4-6) powers an off-chain risk assessment chat. Users describe their situation in plain English. Claude returns a risk score and recommended coverage. The numbers are encrypted via @cofhe/sdk before the wallet prompt — the AI never sees on-chain identity, and no plaintext risk data ever reaches the blockchain.
Privacy model: age, risk score, coverage, premium, claim amount, claim severity, and payout amount are all encrypted. Only aggregate pool statistics (total balance, total policies, total payouts) are public — enough for users to assess protocol solvency, nothing that identifies individuals.
## Wave 3 submission
WHAT WE BUILT THIS WAVE
Encrypted Actuarial Engine
The contract maintains a live encrypted pool risk accumulator. When a policy registers, _computeDynamicBase() reads the accumulator before the new risk is added — pricing each policy on existing pool state. FHE.add accumulates on join, FHE.sub removes on cancellation. Base premium rises with high-risk policies and falls as low-risk holders join. Actuarial pricing on ciphertexts. The aggregate is revealable via the 3-step CoFHE decrypt flow for solvency auditing with zero individual exposure.
Threshold Committee — Two-Layer Trust Model Claims are gated behind M-of-N committee governance before the CoFHE oracle result can be published. voteOnClaim(claimId) tracks per-member votes, emits ClaimQuorumReached at threshold, and requiresQuorum blocks publishClaimValidity until met. Layer 1 (cryptographic): the FHE circuit validates on ciphertexts — cannot be faked. Layer 2 (governance): quorum must be reached — cannot be bypassed. Quorum and membership are configurable. No single admin can approve a claim.
Policy NFT with On-Chain SVG
Every registerPolicy mints an ERC-721 where tokenId = policyId. tokenURI returns a fully on-chain data:application/json;base64,... payload with a live SVG: policy number, status pill, the encrypted FHE handle, and the premium formula. The _update hook syncs policies[tokenId].holder atomically on transfer. No IPFS, no off-chain metadata.
Frontend — CoFHE SDK End-to-End
Encryption is now live. CofheProvider wraps the app; useCofheAutoConnect pairs wallet with the FHE network. Policy registration and claim filing call encryptInputsAsync([Encryptable.uint64(...), ...]) before the wallet prompt — age, risk score, coverage, claim amount, and severity arrive as InEuint64 tuples. The AI risk score is encrypted before leaving the chat interface. No plaintext ever reaches the chain or the mempool.
FHE Proof Explorer
A new /explore page documents all 11 FHE operations as interactive cards — mul, div, add, lte, gte, and, select, allowThis, allowSender, allowPublic, publishDecryptResult — each with the exact ShieldFi formula and which function invokes it. The 3-step decrypt lifecycle is diagrammed with on-chain vs off-chain labels. The live pool accumulator handle is read from the contract in real time.
Committee Portal
A new /committee page gives members a dedicated claim review interface: vote progress bar, FHE validation pseudocode, a one-click voteOnClaim button, and a live QUORUM MET badge. Non-members see their status. The right panel shows committee config and the two-layer trust model.
Contract Architecture
The monolith was split into three modules: InsuranceTypes.sol (types only), ActuarialEngine.sol (encrypted accumulator), CommitteeManager.sol (vote tracking and governance). ConfidentialInsurance.sol inherits all three plus ERC721. The test suite grew from 14 to 21 tests, adding Threshold Committee and Policy NFT suites.
## Wave 4 submission
AI Fraud Oracle Fused with FHE Validity Circuit
Our Wave 4 centerpiece: we fused Claude Sonnet directly into the claims pipeline as a cryptographic fraud gate. We built /api/fraud-assess to send the claimant's description, coverage, and severity to claude-sonnet-4-6, which returns a fraudScore (0–100), confidence, and anomaly flags. We encrypt that score in-browser via encryptInputsAsync — plaintext never reaches the mempool. On-chain, we extended fileClaim with a fourth InEuint64 encFraudScore and wired it into a three-gate FHE circuit:
ebool amountValid = FHE.lte(amount, coverage); ebool severityValid = FHE.gte(severity, MIN_SEVERITY); ebool fraudValid = FHE.lte(fraudScore, FRAUD_THRESHOLD); // 70 ebool isValid = FHE.and(FHE.and(amountValid, severityValid), fraudValid); AI judgment is cryptographically enforced — fraud cannot pass even if a committee member is compromised.
Encrypted Reputation Engine
We built ReputationEngine.sol as an abstract inherited module keeping a per-address euint64 claim accumulator. At policy creation we call _applyNoClaimsBonus(), which runs FHE.eq(handle, FHE.asEuint64(0)) to select between standard and a 20%-discounted base — entirely on ciphertexts. Clean-record holders pay less without exposing their history. We increment via _recordClaim() after each paid payout.
Sealed-Bid Policy Marketplace
We deployed PolicyMarketplace.sol as a standalone ERC-721 escrow with blind FHE price matching. We built a 4-step flow: list(policyId, encAsk) escrows the NFT; placeBid(listingId, encBid) deposits ETH; requestMatchReveal computes FHE.select(FHE.lte(encAsk, encBid), 1, 0) and publishes via FHE.allowPublic; settleMatch transfers the NFT on match or refunds ETH on miss. Neither party sees the other's price. We paired it with a /marketplace frontend — bid slider, ETH preview, full CoFHE encrypt-before-send.
Parametric Insurance — Chainlink-Triggered Claims
We wired a Chainlink IAggregatorV3 feed into ParametricInsurance.sol (abstract, inherited). If we detect a 30% ETH/USD drop within 24 hours, any keeper calls triggerParametricClaim(policyId) — no human filing required. We mint the claim with full coverage, severity=100, fraudScore=0, bypassing the fraud gate by design. We gated setOracle() behind onlyCommitteeOwner.
Live on Arbitrum Sepolia
We deployed both contracts to arb-sepolia and confirmed setApprovalForAll on-chain:
ConfidentialInsurance: 0x3660FCB9d9320A6aa3a2A5A7b5E1C27C0D03aE95 PolicyMarketplace: 0x28D31576eA74Bb6a6Cbf6846b7f2C233653f6772 We connect via RainbowKit + @cofhe/react and encrypt every input before signing. All five FHE modules — ActuarialEngine, CommitteeManager, ReputationEngine, ParametricInsurance, ConfidentialInsurance — compile and run live. Wave 4 is the first insurance protocol where AI fraud scoring, encrypted reputation, parametric triggers, and blind price discovery are simultaneously FHE-enforced on a public testnet.
## Wave 5 submission
FHE Encrypted Governance — Ballots No One Can See
In this final wave, we replaced plaintext protocol governance with a fully encrypted ballot system. Any committee owner calls proposeParamChange(param, newValue) to open a vote on QuorumThreshold, MinSeverity, or FraudThreshold. Each member calls voteOnProposal(), which runs FHE.add on an encrypted tally — the running count is a ciphertext no one can inspect mid-vote. When voting closes, requestProposalReveal() computes FHE.gte(encTally, quorumThreshold), wraps the boolean in FHE.select, and publishes via FHE.allowPublic. executeProposal() calls publishDecryptResult — if passed, the parameter updates on-chain instantly. Individual votes are permanently invisible; even the committee owner cannot observe how members voted.
We wired governableMinSeverity and governableFraudThreshold directly into fileClaim's three-gate FHE validity circuit, so governance changes take live effect on every subsequent claim without redeployment. The fraud gate threshold and minimum severity are no longer hardcoded constants — they are live, encrypted-ballot-governed protocol parameters.
Blind Underwriter Auction — Capital Without Collusion
We deployed UnderwriterAuction.sol as a standalone contract where underwriters anonymously bid capacity on risk tranches. A tranche is a capital bucket for a specific risk tier — low, mid, or high — with a target capacity set by the committee owner. Underwriters call placeBid(trancheId, encCapacity) with ETH collateral. Their encrypted commitment is immediately added to the tranche's FHE running total via FHE.add. The match condition — does this bid fit within remaining capacity — is computed as FHE.lte(encFilled, targetCapacity) and stored as a ciphertext handle. No underwriter ever sees the total committed by others, or whether competing bids were placed. requestFillReveal publishes the match result; settleBid transfers collateral on acceptance or refunds ETH on miss.
Frontend
We shipped /governance — proposal list, encrypted vote button, reveal request, and live display of the three governable parameters. We shipped /underwriter — open tranche browser by risk tier, encrypted capacity bid slider with ETH collateral preview. Both pages use the full CoFHE encrypt-before-send flow.
Live on Arbitrum Sepolia
All three contracts are deployed and verified on arb-sepolia:
ConfidentialInsurance: 0x3660FCB9d9320A6aa3a2A5A7b5E1C27C0D03aE95 PolicyMarketplace: 0x28D31576eA74Bb6a6Cbf6846b7f2C233653f6772 UnderwriterAuction: 0x39cFE0476f8800fBfE62E90857BC0e3Bd5A0d3B5 ShieldFi closes the buildathon as a complete FHE-native insurance primitive: actuarial pricing, AI fraud detection, encrypted reputation, parametric triggers, blind price discovery, anonymous capital allocation, and encrypted governance — all enforced on ciphertexts, all live on a public testnet. No plaintext ever touches the chain.
Prizes
- Wave 5 grant · 350 USDC
From the public Akindo product page. Votes, swipes and the judge score are hackfeed's own.





