1

Let's say Alice transferred 100 USDC to Bob on an L2 (e.g. Arbitrum One or Optimism) in a Transaction T of Block B.

I would like to prove in a Solidity Smart-Contract on the underlying L1 (Ethereum Mainnet) that

  • (1) The transaction effectively happened on the L2
  • (2) The transaction includes a transfer of 100 USDC (ERC20) to Bob

I believe we can achieve this without a custom bridge but rely only on the Rollup mechanism using proofs (Merkle or ZK?)

For (1)

  • Retrieve the latest root-hash of the Layer2 in the Rollup Contract
  • Generate a Merkle proof to prove inclusion of the transaction hash
  • Submit the transaction hash and proofs on the contract

For (2)

  • Can I do something similar with the transaction receipt Merkle tree?

If anyone can point me to some snippet to achieve (1) and (2) with raw code on some tools that could help me with this problem?

Thanks

1 Answer 1

1

There are two types of MPT proofs that can do this:

  1. Using StorageRoot and Proof to prove the existence of transactions where L2 contract storage is changed: op-stack's L2ToL1MessagePasser contract, and L2OutputOracle contract, and OptimismPortal.sol:
  1. Using ReceiptRoot and Proof to prove the existence of transactions where L2 receipt logs are emitted: LayerZero MPTValidator01.sol: https://github.com/LayerZero-Labs/LayerZero-v1/blob/main/contracts/proof/MPTValidator01.sol

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.