docs/protocol/architecture/coprocessor.md
This document explains one of the key components of the Zama Protocol - Coprocessor, the Zama Protocol’s off-chain computation engine.
Coprocessor performs the heavy cryptographic operations—specifically, fully homomorphic encryption (FHE) computations—on behalf of smart contracts that operate on encrypted data. Acting as a decentralized compute layer, the coprocessor bridges symbolic on-chain logic with real-world encrypted execution.
Coprocessor works together with the Gateway, verifying encrypted inputs, executing FHE instructions, and maintaining synchronization of access permissions, in particular:
add, mul, div, cmp, etc.) on ciphertexts.Each coprocessor independently executes tasks and publishes verifiable results, enabling a publicly auditable and horizontally scalable confidential compute infrastructure .
When users submit encrypted values to the Gateway, each coprocessor:
This ensures only valid, well-formed encrypted values enter the system .
When a smart contract executes a function over encrypted values, the on-chain logic emits symbolic computation events.
Each coprocessor:
This offloads expensive computation from the host chain while maintaining full determinism and auditability .
Coprocessors replicate the Access Control List (ACL) logic from host contracts. They:
This ensures decentralized enforcement of access rights, enabling proper handling of decryptions, bridges, and contract interactions .
To ensure verifiability and mitigate misbehavior, each coprocessor:
This is essential for fraud-proof mechanisms and eventual slashing of malicious or faulty operators .
Coprocessors assist in:
These roles help maintain cross-chain interoperability and enable privacy-preserving data access for users and smart contracts .
Coprocessors are designed to be minimally trusted and publicly verifiable. Every FHE computation or input verification they perform is accompanied by a cryptographic commitment (hash digest) and a signature, allowing anyone to independently verify correctness.
The protocol relies on a majority-honest assumption: as long as more than 50% of coprocessors are honest, results are valid. The Gateway aggregates responses and accepts outputs only when a majority consensus is reached.
To enforce honest behavior, coprocessors must stake $ZAMA tokens and are subject to slashing if caught misbehaving—either through automated checks or governance-based fraud proofs.
This model ensures correctness through transparency, resilience through decentralization, and integrity through economic incentives.
The coprocessor architecture includes:
This modular setup supports horizontal scaling: adding more workers or machines increases throughput. Symbolic computation and delayed execution also ensure low gas costs on-chain .