docs/protocol/architecture/relayer_oracle.md
This document explains the service interface of the Zama Protocol - Relayer & Oracle.
The Oracle is an off-chain service that acts on behalf of smart contracts to retrieve decrypted values from the FHEVM protocol.
While the FHEVM protocol’s core components handle encryption, computation, and key management, Oracles and Relayers provide the necessary connectivity between users, smart contracts, and the off-chain infrastructure. They act as lightweight services that interface with the Gateway, enabling smooth interaction with encrypted values—without requiring users or contracts to handle complex integration logic.
These components are not part of the trusted base of the protocol; their actions are fully verifiable, and their misbehavior does not compromise confidentiality or correctness.
Since the decrypted values are signed by the KMS, the receiving smart contract can verify the result, removing any needto trust the oracle itself.
If one oracle fails to respond, another can take over.
Goal: Enable contracts to access decrypted values asynchronously and securely, without embedding decryption logic.
The Relayer is a user-facing service that simplifies interaction with the Gateway, particularly for encryption and decryption operations that need to happen off-chain.
This allows users to interact with encrypted smart contracts without having to run their own Gateway interface,
validator, or FHE tooling.
Goal: Make it easy for users to submit encrypted inputs and retrieve private decrypted results without managing infrastructure.
Together, Oracles and Relayers help bridge the gap between encrypted execution and application usability—without compromising security or decentralization.