Compute Provider Setup

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:

  1. Verifiable: Secured by cryptographic guarantees, produce outputs that are provable onchain.
  2. Oracle-Based: Secured by trusted attestations, consensus mechanisms, and/or economic games.

Select a CP that suits your needs. Options include:

Verifiable

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) with Boundless (opens in a new tab) as the CP.

Boundless provides a Foundry template (opens in a new tab) that can be used to run the Secure Process and create a ZK proof using RISC Zero's zkVM. 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 Boundless Foundry template (opens in a new tab) to setup RISC Zero with Boundless.

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 with Boundless as your CP.

Boundless Configuration

Boundless is a decentralized proving marketplace for RISC Zero programs. Instead of running proofs locally, you can submit them to Boundless for faster, distributed proving.

To use Boundless:

  1. Get access to an RPC endpoint (e.g., Infura, Alchemy) with funds
  2. Obtain a private key with sufficient ETH/tokens for proof generation
  3. (Optional) Get a Pinata JWT from pinata.cloud (opens in a new tab) for uploading programs to IPFS
  4. Configure your enclave.config.yaml as shown in the CRISP setup guide

For more details, see the Boundless documentation (opens in a new tab).