IMessageVerification
Author: Matter Labs
Note: security-contact: security@matterlabs.dev
Functions
proveL2MessageInclusionShared
Prove that a specific arbitrary-length message was sent in a specific L2 batch/block number.
function proveL2MessageInclusionShared(
uint256 _chainId,
uint256 _blockOrBatchNumber,
uint256 _index,
L2Message calldata _message,
bytes32[] calldata _proof
) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
_chainId | uint256 | The chain id of the L2 where the message comes from. |
_blockOrBatchNumber | uint256 | The executed L2 batch/block number in which the message appeared. |
_index | uint256 | The position in the L2 logs Merkle tree of the l2Log that was sent with the message. |
_message | L2Message | Information about the sent message: sender address, the message itself, tx index in the L2 batch where the message was sent. |
_proof | bytes32[] | Merkle proof for inclusion of L2 log that was sent with the message. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Boolean specifying whether the proof is valid. |
proveL2LogInclusionShared
Prove that a specific L2 log was sent in a specific L2 batch.
function proveL2LogInclusionShared(
uint256 _chainId,
uint256 _blockOrBatchNumber,
uint256 _index,
L2Log calldata _log,
bytes32[] calldata _proof
) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
_chainId | uint256 | The chain id of the L2 where the log comes from. |
_blockOrBatchNumber | uint256 | The executed L2 batch/block number in which the log appeared. |
_index | uint256 | The position of the l2log in the L2 logs Merkle tree. |
_log | L2Log | Information about the sent log. |
_proof | bytes32[] | Merkle proof for inclusion of the L2 log. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Whether the proof is correct and L2 log is included in batch. |
proveL2LeafInclusionShared
Proves that a certain leaf was included as part of the log merkle tree.
Warning: this function does not enforce any additional checks on the structure
of the leaf. This means that it can accept intermediate nodes of the Merkle tree as a _leaf
as
well as the default "empty" leaves. It is the responsibility of the caller to ensure that the
_leaf
is a hash of a valid leaf.
function proveL2LeafInclusionShared(
uint256 _chainId,
uint256 _blockOrBatchNumber,
uint256 _leafProofMask,
bytes32 _leaf,
bytes32[] calldata _proof
) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
_chainId | uint256 | The chain id of the L2 where the leaf comes from. |
_blockOrBatchNumber | uint256 | The batch/block number of the leaf to be proven. |
_leafProofMask | uint256 | The leaf proof mask. |
_leaf | bytes32 | The leaf to be proven. |
_proof | bytes32[] | The proof. |