[General] How to Retrieve Proof Parameters for ETH Claim on L1 from zkSync Era? #812
-
Team or ProjectKelp DAO EnvironmentMainnet L2 block numberNo response Provide a brief description of the functionality you're trying to implement and the issue you are running into.We're implementing a functionality in our contracts to bridge ETH from zkSync Era (L2) to Ethereum Mainnet (L1). However, we're encountering challenges with the claim transaction on Mainnet. Specifically, we're unsure how to obtain the correct proof parameters required for the L1 Repo Link (Optional)No response Additional DetailsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
To retrieve the proof parameters required for the Here are the relevant endpoints you might find useful:
Please note that not all batches have proof inputs available, and batch data is only available for a finite amount of time (30 days from the time of writing). After this period, the data is deleted, and ZKsync cannot verify batches older than this timeframe. For more detailed information on setting up and using the Prover API, you can refer to the From Integration to Verification: Completing the First Steps in ZKsync documentation. For further discussions and support, you may also visit the ZKsync developers discussions on Github. Your feedback helps us serve you better. If this fully addresses your question, please give it a thumbs up. If it doesn't, please give it a thumbs down. This will inform the community and team so we can improve our support. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the post! Will check this out and get back to you |
Beta Was this translation helpful? Give feedback.
-
Hey @mihailo-maksa! Yes, there are APIs for that. Basically, what you need is to identify the log that corresponds to the withdrawal L2 -> L1 message on l2 and then retreive a proof for it. One caveat you should be aware of is that there might be multiple withdrawals in a single transaction (which is why |
Beta Was this translation helpful? Give feedback.
Hey @mihailo-maksa! Yes, there are APIs for that.
You can take a look at how fetching withdrawal parameters is implemented in zksync-ethers. Corresponding RPC method iszks_getL2ToL1LogProof.
Basically, what you need is to identify the log that corresponds to the withdrawal L2 -> L1 message on l2 and then retreive a proof for it.
One caveat you should be aware of is that there might be multiple withdrawals in a single transaction (which is why
index
needs to be passed in the function above).