Closed
Description
Considering this quote:
"The merkle proof is validated against a merkle tree root that is maintained by the smart contract."
In a scenario where we have a network with thousands of participants executing high-frequency transactions with this token, will this solution create many reverted transactions?
Let's me explain:
Imagine that Alice is about to send a UTXO to Bob and, at the same time, Mark is about to send a UTXO to Rebecca. Let's consider this order of execution of actions:
- Alice obtains the
merkle tree root
, to generatezkp_proof(merkle tree root hash)
- Mark obtains the
merkle tree root
, to generatezkp_proof(merkle tree root hash)
- Mark computes transaction data, generating all the proofs
- Alice computes transaction data, generating all the proofs
- Mark sends the Ethereum transaction to his node, which is broadcasted to the network
- Alice sends the Ethereum transaction to her node, which is broadcasted to the network
In this scenario, step 6 will fail, right? Because Alice is sending a transaction with an invalid proof, as the merkle tree root was modified by Mark in step 5.