Skip to content

BoundlessMarketCallback

Inherits: IBoundlessMarketCallback

Contract for handling proofs delivered by the Boundless Market's callback mechanism.

This contract provides a framework for applications to safely handle proofs delivered by the Boundless Market for a specific image ID. The intention is for developers to inherit the contract and implement the internal _handleProof function.

We recommend a best practice of "trust but verify" whenever receiving proofs, so we verify the proof here even though the Boundless Market already verifies the proof as part of its fulfillment process. Proof verification in Boundless is cheap as it is just a merkle proof, so this adds minimal overhead.

State Variables

VERIFIER

IRiscZeroVerifier public immutable VERIFIER;

BOUNDLESS_MARKET

address public immutable BOUNDLESS_MARKET;

IMAGE_ID

bytes32 public immutable IMAGE_ID;

Functions

constructor

Initializes the callback contract with verifier and market addresses

constructor(IRiscZeroVerifier verifier, address boundlessMarket, bytes32 imageId);
Parameters
NameTypeDescription
verifierIRiscZeroVerifierThe RISC Zero verifier contract address
boundlessMarketaddressThe BoundlessMarket contract address
imageIdbytes32The image ID to accept proofs of.

handleProof

Handles submitting proofs with RISC Zero proof verification

If not called by BoundlessMarket, the function MUST verify the proof before proceeding.

function handleProof(bytes32 imageId, bytes calldata journal, bytes calldata seal) public;
Parameters
NameTypeDescription
imageIdbytes32The ID of the RISC Zero guest image that produced the proof
journalbytesThe output journal from the RISC Zero guest execution
sealbytesThe cryptographic seal proving correct execution

_handleProof

Internal function to be implemented by inheriting contracts

Override this function to implement custom proof handling logic

function _handleProof(bytes32 imageId, bytes calldata journal, bytes calldata seal) internal virtual;
Parameters
NameTypeDescription
imageIdbytes32The ID of the RISC Zero guest image that produced the proof
journalbytesThe output journal from the RISC Zero guest execution
sealbytesThe cryptographic seal proving correct execution