Skip to main content

zks_getL2ToL1MsgProof RPC Method

Returns the proof for a message sent via the L1Messenger system contract, given a block, sender, message, and an optional message log index containing the L1->L2 message.

Updated on
Nov 2, 2023

zks_getL2ToL1MsgProof RPC Method

Please note that this JSON-RPC method will be deprecated in favor of zks_getL2ToL1LogProof.

Parameters

block
integer
REQUIRED
The number of the block where the message was emitted
sender
string
REQUIRED
The sender of the message
msg
string
REQUIRED
The keccak256 hash of the sent message
l2_log_position
string
The index in the block of the event that was emitted by the L1Messenger when submitting this message

Returns

id
The position of the leaf in the Merkle tree of L2->L1 messages for the block
proof
The Merkle proof for the message
root
The root hash representing the Merkle tree root at the time the L2 to L1 log was generated
Request
1
curl https://docs-demo.zksync-mainnet.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{"method":"zks_getL2ToL1MsgProof","params":[5187, "0x87869cb87c4Fa78ca278dF358E890FF73B42a39E", "0x22de7debaa98758afdaee89f447ff43bab5da3de6acca7528b281cc2f1be2ee9" ],"id":1,"jsonrpc":"2.0"}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free