project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

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.

FHE Oracle

Created At

ETHOnline 2024

Winner of

Lit Protocol - Participation Trophy

Project Description

FHE Oracle is a fully homomorphic encryption-powered data oracle on Fhenix blockchain. Computes or fetches data using Lit Protocol actions and is indexed using Envio.

Users can query any off-chain datasource, compute inside a Lit Action, execute transactions, sign messages or perform anything inside a Lit Action and get the result back in a fully homomorphic encrypted form.

How it's Made

The Architecture is divided in three parts:

  1. FHE Oracle Smart Contracts
  2. Lit Action backed Oracle Service
  3. Envio Indexer

FHE Oracle Smart Contracts

Most of the contracts are inspired from Chainlink Functions Architecture where a user can create a Consumer Contract where they send requests and receive responses.

Oracles are Deployed and Verified on Fhenix Helium Testnet:

Router: 0xbd533524e6f709AE55Bc7686C3e416D6870D1259

Coordinator: 0x1EA3bce6a8a08d8c08859Fe720024f98FeB11C4E

Consumer: 0x394403eE9b3b5e25D492Ad2FD4cc0836D8e75B52

Before using the Oracle, the user needs to register their Consumer contract with the Oracle by creating a Subscription and adding the Consumer contract address for the Subscription.

While creating a request a user can pass the following parameters:

  • Source: The source of the data. It can be a Lit Action IPFS CID or inline code to execute.
  • Public Arguments: The public arguments to pass to the Lit Action.
  • Private Arguments: The private arguments to pass to the Lit Action (will be encrypted using Lit Network and only decrypted inside the Lit Action).
  • Callback Gas Limit: The gas limit for the callback transaction.

Once the Request is created, it is sent to the `Router Contract. Then Router contract forwards the request to the Coordinator contract. The Oracle Service listens for the Coordinator contract events and fetches the request data.


Lit Action backed Oracle Service

Once the event is received, the Oracle Service fetches the request data and executes the Lit Action. The Lit Action can be a simple computation or a complex off-chain data fetch. Private Parameters are decrypted inside the Lit Action and used to perform the computation.

Once the Action is Executed the result is encrypted using Fhenix Blockchain Network Key and then sent to Off-Chain Reporting (OCR) Contract. This is where the transmitter can batch and send multiple responses back to the Coordinator contract. The batch is signed using the Transmitter PK and sent to the Coordinator Contract.

The Coordinator Contract verifies the signature and then sends the response back to the Consumer contract via Router.


Envio Indexer

Events are indexed using the Envio Indexer. The Indexer listens for the Coordinator contract events mainly RequestSent and RequestFulfilled and indexes the data. The data is then available for querying using the FHE Oracle Frontend.

This Indexed Data can be used by the Request Fulfillers/Transmitters to fetch the data and send the response back to the Coordinator contract.

background image mobile

Join the mailing list

Get the latest news and updates