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);
Name | Type | Description |
---|---|---|
verifier | IRiscZeroVerifier | The RISC Zero verifier contract address |
boundlessMarket | address | The BoundlessMarket contract address |
imageId | bytes32 | The 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;
Name | Type | Description |
---|---|---|
imageId | bytes32 | The ID of the RISC Zero guest image that produced the proof |
journal | bytes | The output journal from the RISC Zero guest execution |
seal | bytes | The 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;
Name | Type | Description |
---|---|---|
imageId | bytes32 | The ID of the RISC Zero guest image that produced the proof |
journal | bytes | The output journal from the RISC Zero guest execution |
seal | bytes | The cryptographic seal proving correct execution |