Default: Merkle Inclusion Proofs
By default, Boundless delivers proofs on-chain as merkle inclusion proofs:- Proofs are batched together are aggregated into a single Groth16 proof.
- The aggregated proof is verified once on-chain
- Individual proofs are verified through cheap merkle inclusion proofs into this root
Options: Requesting a Specific Proof Type
While Merkle inclusion proofs are efficient for on-chain verification, there may be cases where you need to access the underlying proof instead of a merkle inclusion proof. For example:- Cross-chain verification where you need to verify the proof on a different chain.
- Integration with other systems that expect a specific proof type.
- Custom verification logic that requires the full proof.
Request a Groth16 Proof
Boundless supports requesting a raw Groth16 proof instead of a merkle inclusion proof. You can specify this in your proof request by setting theproof_type to ProofType::Groth16:
Request a Blake3 Groth16 Proof
Blake3 Groth16 proofs are only supported with the
ClaimDigestMatch
predicate, meaning that you should only use this if you do not require the
journal to be delivered on-chain. Blake3 Groth16 proofs also require the
journal to be of size 32 bytes.proof_type to ProofType::Blake3Groth16:
Considerations
When choosing between proof types, consider:-
Gas Costs
- Merkle inclusion proofs are much cheaper to verify on-chain
- Raw Groth16 proofs require full SNARK verification each time. This will increase the price of the proof
-
Use Case Requirements
- If you only need on-chain verification, use the default merkle inclusion proof
- If you need cross-chain verification or raw proof data, use Groth16
- If you need to compose the proof by verifying it within another zkVM guest program, use Groth16
- If you don’t need the journal on-chain, consider using
ClaimDigestMatchto save gas (see Journal Delivery) - If your journal size exceeds 10KB, use
ClaimDigestMatchand design your application to store journals off-chain (see Journal Size Limits)
Journal Delivery Onchain
When a proof request is fulfilled, the journal can optionally be delivered on-chain. This is controlled by the predicate type you specify in yourRequirement:
DigestMatch/PrefixMatchrequire the journal to be delivered on-chain when the request is fulfilled.ClaimDigestMatchdoes not require journal delivery. Only the claim digest is verified on-chain.
ClaimDigestMatch can lead to lower prices since provers won’t need to submit potentially large journal data.
Journal Size Limits
To prevent griefing attacks where requestors force provers to post expensive amounts of calldata on-chain, there is a 10KB limit on journal size for on-chain delivery. Provers will ignore requests that require journals larger than 10KB to be posted on-chain. If your journal exceeds 10KB, useClaimDigestMatch and design your application to store journals off-chain (e.g. via IPFS, a blob storage service, or your own backend).
Example: Proof Composition using Proof Types
In the Proof Composition example, we demonstrate how to compose a proof from multiple proofs. Composing a proof requires us to verify a previously generated Groth16 proof within the zkVM guest program. This requires us to request a raw Groth16 proof from the Boundless Market. In the composition example, we first request a raw Groth16 proof from the Boundless Market using theECHO guest program.
IDENTITY zkVM guest program, and verify the proof.