Compute Provider (CP)
Compute Providers form the modular compute layer of the Enclave protocol, allowing you to choose the optimal balance of trust, cost, and scalability for your application. CPs are responsible for running your E3 Program's Secure Process and reporting results back to your E3 Program's smart contract.
Choosing a Compute Provider
CPs fall into two broad categories:
- Verifiable: Secured by cryptographic guarantees, produce outputs that are provable onchain.
- Oracle-Based: Secured by trusted attestations, consensus mechanisms, and/or economic games.
Select a CP that suits your needs. Options include:
Verifiable
- RISC Zero zkVM (opens in a new tab)
- Succint SP1 (opens in a new tab) (coming soon)
- Jolt (opens in a new tab) (coming soon)
Oracle-Based Systems
- zkTLS VMs (coming soon)
- Committee-based oracles (coming soon)
- Game theory-based oracles (coming soon)
Custom
- You can also implement your own custom CP. From Enclave's perspective, it simply requires a
contract that conforms to
IComputeProvider
.
Factors to Consider:
- Verifiability: Consider whether or not your use case requires cryptographic guarantees of correct execution.
- Cost: Verifiable CPs will incur higher compute overhead, which may translate to increased costs for your users.
- Performance: Verifiable systems will often be less performant compared to oracle-based CPs.
- Language Support: Choose a CP that supports the programming languages you're comfortable with.
Enclave provides a Compute Provider package (opens in a new tab) to simplify the integration, letting you focus on computation logic. More details can be found in the Writing the Secure Process guide.
Setup
In this guide, we'll go over setting up RISC Zero (opens in a new tab) as the CP.
RISC Zero provides a Foundry template (opens in a new tab) that can be used to run the Secure Process and create a ZK proof. The template includes a basic program that can be used to get started with the smart contract code to verify the proof.
Follow the instructions in the Foundry template (opens in a new tab) to setup RISC Zero.
Ensure the following tools are installed:
# Install Rust
curl https://sh.rustup.rs -sSf | sh
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
Next, you will use rzup
to install cargo-risczero
.
To install rzup
, run the following command and follow the instructions:
curl -L https://risczero.com/install | bash
Next we can install the RISC Zero toolchain by running rzup
:
rzup
You can verify the installation was successful by running:
cargo risczero --version
Now you're ready to develop and deploy applications using RISC Zero as your CP.