FHE Oracle Bridge

FHE Oracle: Private on-chain prices via encrypted comparisons—no MEV, no front-running.

Visit

About

## Wave 1 submission

FHE Oracle Bridge - Wave 1: Core Oracle Infrastructure

PROJECT OVERVIEW:

Built the foundational privacy-preserving price oracle where all price data is stored as FHE ciphertext (euint256), never appearing as plaintext on-chain. This eliminates MEV front-running and position hunting that plague existing DeFi oracles like Chainlink.

DELIVERABLES:

  • FHEOracleBridge.sol - Main Oracle Contract
  • Encrypted price storage using euint256 FHE type from Fhenix
  • Feed management system: createFeed(), pauseFeed(), resumeFeed()
  • Feeder authorization and price submission via submitPrice()
  • Round-based price updates with automatic finalization
  • Configurable staleness TTL per feed

2. Technical Implementation:

struct Feed { euint256 encryptedPrice; // FHE ciphertext - never plaintext uint256 lastUpdated; uint256 roundId; uint256 ttl; uint8 minFeeders; bool active; string description; }

3. Price Submission Flow:

- Feeders encrypt prices client-side using CoFHE SDK - Submit as inEuint256 via submitPrice(feedId, encPrice) - Contract stores as euint256 without ever decrypting - Round finalizes when quorum reached (minFeeders)

KEY INNOVATION:

Unlike Chainlink where latestAnswer() returns plaintext uint256 visible to everyone, FHE Oracle Bridge stores prices as euint256 FHE ciphertext that's completely opaque on-chain. No MEV bot, trader, or observer can read the price value.

VALIDATION:

- 8 passing tests covering: * Authorized feeder submission * Unauthorized feeder rejection * Insufficient stake rejection * Round finalization on quorum * Duplicate submission prevention * Non-existent feed rejection * Paused feed rejection * Pending submissions tracking

  • Gas profiling: ~80k gas per single-feeder submission
  • Security: Unauthorized feeders rejected, insufficient stake rejected, paused feeds blocked

TECHNICAL DETAILS:

- Solidity 0.8.24 with IR optimizer - Fhenix FHE types: euint256 for price storage - Feed IDs: 1 = ETH/USD, 2 = BTC/USD (extensible) - Default TTL: 3600 seconds (1 hour) - Minimum stake: 0.01 ETH per feeder

DELIVERABLE URLS:

- GitHub: [Your repo URL]/contracts/FHEOracleBridge.sol - Tests: [Your repo URL]/test/FHEOracleBridge.test.js (Wave 1 section) - Deployment: npx hardhat run scripts/deploy.js --network hardhat

COMPARISON WITH EXISTING ORACLES:

Chainlink: latestAnswer() → 350000000000 (plaintext $3,500 - visible to everyone) FHE Oracle: getEncryptedPrice() → euint256 ciphertext (unreadable without decryption key)

This foundational infrastructure enables all subsequent waves: access control (Wave 2), multi-feeder aggregation (Wave 3), production consumers (Wave 4), and multi-asset support (Wave 5).

## Wave 2 submission

## Wave 2 Deliverables — FHE Oracle Bridge

**What Wave 2 Proves**

"We turned the oracle from a public ticker into enforced infrastructure — encrypted feeds, strict on-chain access control, and consumer patterns that never ask for a plaintext price."

**1. On-Chain Access Control — AccessRegistry.sol** The AccessRegistry enforces that only approved consumer contracts can interact with encrypted oracle outputs — at the contract level, not the UI level. - Whitelisted consumer addresses tracked on-chain - Non-whitelisted calls revert — contract enforced, not UI filtered - One source of truth for authorized access

When a non-whitelisted contract reverts on Arbiscan, that's cryptographic access control — not a frontend decision.

**2. Consumer Integration Patterns**

Wave 2 shows how a protocol actually uses this oracle — without receiving a plaintext price.

MockConsumer.sol (+ CoFHE / Fhenix variants): - Pulls encrypted aggregates when authorized - Performs encrypted comparisons — "is spot below threshold?" not "give me the price" - Returns one thing: a boolean

IFHEOracleBridge interfaces provide a clean plug-in surface for third-party DeFi contracts — no internal contract knowledge required.

**3. Staleness Guards and Revert Paths** TTL-based staleness checks enforced at the contract level: - Reads revert if feed exceeds TTL window - Stale and non-whitelisted revert paths covered in test suite - Frontend freshness indicator backed by contract rules — not cosmetic

**4. Frontend Dashboard**

Location: frontend/index.html + frontend/config.json

Shows feed metadata (round, quorum, freshness) with no plaintext prices. Includes consumers page, feeders page, event log, config panel, and wallet connect. Auto-recovers if MetaMask switches networks mid-session — falls back to read-only RPC without error-spamming.

**5. Live Deployment — Arbitrum Sepolia** Chain: Arbitrum Sepolia (421614) FHEOracleBridge: 0x030815AF032e051346Ec9dD575D781BB52e44B7F AccessRegistry: 0x6Bf530a2CDbCE59be2c106F1B5C43BbEc562A7E1 Hosted: https://fhe-oracle-bridge-demo.surge.sh Local: npm run frontend → http://127.0.0.1:8765

All addresses wired in frontend/config.json. A judge can open the dashboard and immediately confirm real deployed contracts.

**Wave 2 In One Line**

"Encrypted feed, strict whitelist, real testnet — so protocols can build private predicates on top without ever seeing a price."

## Wave 3 submission

Privacy Guarantees ✅ No feeder can see other feeders' prices ✅ Median computed entirely in FHE ciphertext ✅ Only final boolean results cross plaintext boundary ✅ Collusion resistance through cryptographic privacy

Economic Security

✅ Feeder bonding (0.01 ETH minimum) ✅ Owner-controlled slashing for manipulation ✅ Double-submission prevention per round ✅ Quorum requirements prevent premature finalization

Operational Readiness

✅ Comprehensive test coverage (6/6 passing) ✅ Gas-optimized for n ≤ 5 feeders ✅ Multi-network deployment support ✅ Event emission for monitoring

Wave 3 is 100% implemented in code - all core multi-feeder aggregation, encrypted median computation, and economic security features are complete and tested. The remaining gap is operational: deploying feeder daemons on live testnets for continuous operation.

## Wave 4 submission

What Wave 4 Proves

Full liquidation cycle — encrypted check, boolean result, keeper action. Price drives logic; nobody sees a public USD tick.

1. Private Liquidation

PrivateLiquidator.sol / PrivateLiquidatorCofhe.sol — encrypted liquidation threshold, boolean only. requestLiquidationCheck → keeper → completeLiquidation. No MEV on a public price tick.

2. Keeper + Demo

liquidationKeeper.js — watches LiquidationCheckPrepared, decrypts bool, liquidates. demoFlow.js (Hardhat) + wave4LiveE2E.js (testnet).

3. Live Deploy

Arbitrum Sepolia: PrivateLiquidator 0x5d9DD91F4d8D8bF1c7Df801c6a0453316f4Af3ff. Dashboard, spin, README runbook (wave4:live, preflight).

4. Still Completing

Recorded live wave4:live tx hashes on Arbiscan. Always-on liquidation keeper during demo window.

Hosted: https://fhe-oracle-bridge-demo.surge.sh/

In One Line: Encrypted threshold, boolean result, keeper action — the triggering price was never seen by anyone.

## Wave 5 submission

Private Threshold Alerts & Multi-Asset Monitoring

This completes FHE Oracle Bridge as a privacy-preserving monitoring stack on Fhenix CoFHE (Arbitrum Sepolia). Protocols and users set encrypted price thresholds, compare them to encrypted ETH/USD and BTC/USD feeds entirely in FHE, and receive boolean-only triggers after CoFHE decrypt — no plaintext spot, no public threshold, no strategy leakage.

Core deliverable: PrivateThresholdAlertsCofhe.sol — subscribe (encrypted threshold) → prepareThresholdCheck (FHE lt/gt) → keeper decryptForTx → completeThresholdAlert (publishes ThresholdAlert(triggered: bool) only). Live: 0x80886CCF7253337E1ABe911CD36f1F7BAAdB1932

Multi-asset: Feeds 1 ETH/USD and 2 BTC/USD on oracle 0x4c1A…26dC3; feeder daemon encrypts and submits both; FEED_ID=2 supported in wave5LiveE2E.js.

Ops: thresholdAlertKeeper.js, wave5LiveE2E.js, demoThresholdAlerts.js, split register/prepare/complete scripts, npm run spin (feeder + liquidation + threshold keepers + frontend). 42 Hardhat tests (6 new for threshold alerts).

Live proof (ETH/USD):

Prepare: https://sepolia.arbiscan.io/tx/0x98cd60918f517771c6f15393dbd56f02e15adf066b4abb41c76a548f0e859b43 Complete: https://sepolia.arbiscan.io/tx/0x8edfcef0aaebf2fedcd78c706acff80fc2b609f609b60379ee1a3bebed98ae33 Dashboard: Redesigned fintech hero + glass dashboard; shows feed freshness/quorum and ThresholdCheckPrepared / ThresholdAlert events — no plaintext USD by design.

URLs:

Demo: https://fhe-oracle-bridge-demo.surge.sh/ Repo: https://github.com/Nanle-code/fhe-oracle-bridge Alerts: https://sepolia.arbiscan.io/address/0x80886CCF7253337E1ABe911CD36f1F7BAAdB1932 Oracle: https://sepolia.arbiscan.io/address/0x4c1A39704D65992464C4BE356c1A0BA001526dC3 Reproduce: npm run setup:env → npm run wave5:live (or FEED_ID=2 npm run wave5:live for BTC)

One line: Encrypted thresholds, multi-asset alerts, keeper automation — institutional monitoring without strategy exposure.

From the public Akindo product page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

No public repo linked, so we can't tell.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.

FHE Oracle

FHE Oracle is a fully homomorphic encryption-powered data oracle on Fhenix blockchain. It can compute or fetch any data using Lit Protocol actions and is indexed using Envio HyperIndexer.