Overview
At its core, Boundless allows app developers to receive zero-knowledge (ZK) proofs for their programs. Before requesting a proof, developers should have a program that compiles and executes successfully. If you want to read more about the zkVM, it is highly recommended to read the following pages on the zkVM dev docs: For some more intermediate and advanced reading on the zkVM, please refer to:Boundless Foundry Template
The Boundless Foundry Template builds on RISC Zero’s Foundry Template to incorporate Boundless with a simple example app. It consists of three main parts:- the zkVM program,
is-even - the application smart contract,
EvenNumber.sol - the application backend,
app
- Uploads the guest program and creates the proof request.
- Sends the proof request to Boundless.
- Retrieves the proof from Boundless.
- Sends the proof to the application contract.

is-even
EvenNumber.sol
The EvenNumber smart contract holds a uint256 variable called number. This number is guaranteed to be even,
however the smart contract itself never checks the number’s parity directly.
It verifies a ZK proof of a program that has checked if the number is even. This is done in the set function:
set function is called with two arguments, a number x, and the seal.
The number x is the number that the ZK proof has proven is even, and it is used to reconstruct the journal (the journal refers to the public outputs of the program).
The seal is the proof. In zkVM terminology, the seal usually refers to a zk-STARK or SNARK directly.
In Boundless, the seal is actually a Merkle inclusion proof that the program’s proof verification has been included in the Batch Verification Tree. See Proof Lifecycle to read more about this.
Proof Verification Using the VerifierRouter Contract
The main logic of this function is carried out withverifier.verify:
- Verifier
- The
verifiervariable points to the RISC Zero Verifier Router contract. This contract supports verification of seals that are either proofs returned from Boundless or zkSNARKs directly from the zkVM.
- The
- ImageID
- The image ID is a unique identifier for a program in the zkVM. It is checked during proof verification to ensure proof integrity. Concretely, by saving the image ID to an immutable variable in the smart contract on deployment, this makes sure that only proofs from the correct program (in this case,
is-even) are valid.
- The image ID is a unique identifier for a program in the zkVM. It is checked during proof verification to ensure proof integrity. Concretely, by saving the image ID to an immutable variable in the smart contract on deployment, this makes sure that only proofs from the correct program (in this case,
- Journal
- The journal refers to the public outputs of the program. Similar to the image ID, the journal ensures proof consistency by verifying that the journal in the receipt claim (the seal cryptographically attests to the receipt claim) matches the expected journal.
The
EvenNumber.sol smart contract has one main function: set. This function will update the state number if and only if a valid ZK proof is verified from the correct zkVM program (identified via the image ID).apps/src/main.rs
As an example of how to request and publish a proof an example app is provided.
It is a CLI that takes a --number argument, and does all the work required to set a new even number on the contract.
The example app executes the following steps:
- Uploads the guest program and creates the proof request.
- Sends the proof request to Boundless.
- Retrieves the proof from Boundless.
- Sends the proof to the application contract.