Brevis
Search
K

Slot Value Proof

The Brevis framework also provides a low-level API to enable zk verification of any EVM storage slot value from a connected remote chain. Please refer to this section to learn more about the slot value protocol. Here we introduce how to integrate an App contract with Brevis slot value proof.
App contracts need to interact with the SlotValueVerifier contract to get the verified slot information by using the following interface.
interface ISlotValueVerifier {
struct SlotInfo {
uint64 chainId;
bytes32 addrHash;
bytes32 blkHash;
bytes32 slotKeyHash;
bytes32 slotValue;
uint32 blkNum;
}
function verifySlotValue(
uint64 chainId,
bytes calldata proofData,
bytes calldata blkVerifyInfo
) external view returns (SlotInfo memory slotInfo);
}
The verifySlotValue function takes the following inputs generated by the proofing system:
  • chainId indicates the chain on which the proof data was generated.
  • proofData is the Groth16 ZK proof data and public inputs for the attested slot.
  • blkVerifyInfo is the auxiliary block verification info with necessary block Merkle proof data. It is passed to the BlockSyncer contract to validate that the block with the storage slot exists on the source chain.
The function returns the verified SlotInfo, of which data fields can be used by caller contracts (see examples in the following subsection).