![](https://cdn.nodeguardians.io/backend-production/solidity_bg_fc76a87eed/solidity_bg_fc76a87eed.webp)
Standalone
Merkle Proofs
![](https://cdn.nodeguardians.io/backend-production/Merkl_Tree_Sappling_1200px_5218dab025/Merkl_Tree_Sappling_1200px_5218dab025.webp)
Part II
Verifying Merkle Proofs
Now that you have figured out how to get a Merkle root, you need to implement on-chain verification.
In other words, there must be a way for the smart contract to validate a proof, and confirm that a given address is indeed a member of the Merkle Tree.
Your Task
Implement verify(address trustee, bytes32[] proof)
in your SacredTree contract.
address
: The address to verifyproof
: The merkle proof needed to verifytrustee
's membership in the merkle tree, as an array of hashes in a bottom-up order
For example, consider the following Merkle Tree.
![merkle_proofs_02.webp](https://cdn.nodeguardians.io/backend-production/merkle_proofs_02_7018411fda/merkle_proofs_02_7018411fda.webp)
To verify addressA
, we can make the following function call:
verify(
addressA,
[hashB, hashF]
)
Run tests in Questplay
Submit work in Questplay
![](https://cdn.nodeguardians.io/backend-production/Merkl_Tree_Sappling_1200px_5218dab025/Merkl_Tree_Sappling_1200px_5218dab025.webp)
As the new Merk’l tree takes root, you watch as the monks begin to re-engrave their history upon it, including their elusive list of trusted allies.