Skip to content

Where am I wrong in my understanding of Second Preimage Attack in Merkle Tree Implementation of merkle Airdrop #1931

Answered by ciaranightingale
a1111198 asked this question in Q&A
Discussion options

You must be logged in to vote

@a1111198 Firstly, thank you for the in-depth breakdown of your question!

  1. dmfxyz/murky was used in the script to generate the roots and the proofs as the repository was designed to be 100% Solidity rather than switching to JavaScript. In the Murky script, the leaves are also double-hashed to prevent second preimage attacks as they are in the OpenZeppelin JS library.
  2. The implementation is such that the account and amount are passed and the leaf node generated as opposed to an arbitrary leaf node bytes being able to be passed to prevent this vulnerability where someone could pass an intermediate leaf node and therefore pass the check. As the article you linked states: "If the contract does…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@EngrPips
Comment options

Answer selected by ciaranightingale
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants