Skip to content

Quick Start

The Boundless Foundry Template is the best way to get started. It provides a starter application which has the following components:

  • A zkVM guest program, is-even
  • A smart contract, EvenNumber.sol
  • An example starter application which:
    • uploads the zkVM guest to IPFS (optional)
    • submits a request to the market for a proof that "4" is an even number
    • waits for the request to be fulfilled and receives the proof from the Boundless market
    • submits the received proof to the EvenNumber contract for verification.

Setup the app locally

Install RISC Zero

Terminal
curl -L https://risczero.com/install | bash
rzup install

See more about installation on the RISC Zero docs.

Clone the repository

You can either clone the repo using git, but we recommend using forge init (you'll need to install Foundry):

Terminal
forge init --template https://github.com/boundless-xyz/boundless-foundry-template boundless-foundry-template && cd boundless-foundry-template

Using git

Terminal
git clone https://github.com/boundless-xyz/boundless-foundry-template
cd boundless-foundry-template
git submodule update --init --recursive

Set up your environment variables

Export your Sepolia wallet private key as an environment variable (making sure it has enough funds), and export a valid RPC URL (you can use the public one provided):

export RPC_URL="https://ethereum-sepolia-rpc.publicnode.com"
export PRIVATE_KEY="YOUR_PRIVATE_KEY"

You'll also need a deployment of the EvenNumber contract. You can use a predeployed contract on Sepolia:

export EVEN_NUMBER_ADDRESS="0xE819474E78ad6e1C720a21250b9986e1f6A866A3"

Run the example app

The example app will submit a request to the market for a proof that "4" is an even number, wait for the request to be fulfilled, and then submit that proof to the EvenNumber contract, setting the public number variable to "4".

To run the example using the pre-uploaded zkVM guest:

Terminal
RUST_LOG=info cargo run --bin app -- --number 4 --program-url https://plum-accurate-weasel-904.mypinata.cloud/ipfs/QmU7eqsYWguHCYGQzcg42faQQkgRfWScig7BcsdM1sJciw

The output will look something like:

Terminal
2025-07-01T10:37:08.148174Z  INFO app: Number to publish: 4
2025-07-01T10:37:10.167132Z  INFO risc0_zkvm::host::server::exec::executor: execution time: 5.667791ms
2025-07-01T10:37:26.144716Z  INFO app: Waiting for request 2008ac70b2920c9a345ea7fff1ded1fd4302bdf06516a20c to be fulfilled

and the app will query the status of the proof request until it is fulfilled. Once it fulfilled, you'll see output confirming the receipt of the proof, and confirmation of the transaction sent onchain calling the set function with the proof as calldata:

Terminal
2025-07-01T10:39:30.164558Z  INFO app: Request 2008ac70b2920c9a345ea7fff1ded1fd4302bdf06516a20c fulfilled
2025-07-01T10:39:30.164634Z  INFO app: Calling EvenNumber set function
2025-07-01T10:39:30.682193Z  INFO app: Broadcasting tx 0x067794fbb80a4d67eee593904dc9e6109875efd455b8eedc67609b9d547d5c0d
2025-07-01T10:39:42.529922Z  INFO app: Tx 0x067794fbb80a4d67eee593904dc9e6109875efd455b8eedc67609b9d547d5c0d confirmed
2025-07-01T10:39:42.902820Z  INFO app: The number variable for contract at address: 0xe819474e78ad6e1c720a21250b9986e1f6a866a3 is set to 4

You've now requested your first proof from Boundless, received that proof and sent that proof onchain for verification. Effectively, you've offloaded computation offchain with the same trust model as onchain, all thanks to the power of ZK. This is the true power of verifiable compute.

To learn more about each individual step, please refer to Build A Program. If you want to do some further development on your local fork of the Boundless Foundry Template, please read the Development section on the README.