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.
Screenshots






Problem Statement
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.
Solution
The Architecture is divided in three parts:FHE Oracle Smart ContractsLit Action backed Oracle ServiceEnvio IndexerFHE Oracle Smart ContractsMost of the contracts are inspired from Chainlink Functions Architecture where a user can create aConsumerContract where they send requests and receive responses.Oracles are Deployed and Verified on Fhenix Helium Testnet:Router:0xbd533524e6f709AE55Bc7686C3e416D6870D1259Coordinator:0x1EA3bce6a8a08d8c08859Fe720024f98FeB11C4EConsumer:0x394403eE9b3b5e25D492Ad2FD4cc0836D8e75B52Before using the Oracle, the user needs to register their Consumer contract with the Oracle by creating a Subscription and adding theConsumercontract 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 ServiceOnce 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 usingFhenix Blockchain Network Keyand then sent toOff-Chain Reporting (OCR)Contract. This is where the transmitter can batch and send multiple responses back to theCoordinatorcontract. 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 IndexerEvents are indexed using the Envio Indexer. The Indexer listens for theCoordinatorcontract events mainlyRequestSentandRequestFulfilledand indexes the data. The data is then available for querying using theFHE Oracle Frontend.This Indexed Data can be used by the Request Fulfillers/Transmitters to fetch the data and send the response back to theCoordinatorcontract.
Hackathon
ETHOnline 2024
2024
Prizes
- 🏆
Participation Trophy
Lit Protocol
Contributors
- Envoy-VC
70 contributions