get http://localhost:3000/blocks//statements//merkle
Returns the merkle path for a receipt statement or resolution linked to a block.
The merkle path is the minimum number of nodes needed to calculate the merkle root.
Steps to calculate the merkle root:
- proofHash = hash (leaf).
- Concatenate proofHash with the first unprocessed item from the merklePath list as follows:
- a) If item.position == left -> proofHash = sha_256(item.hash + proofHash).
- b) If item.position == right -> proofHash = sha_256(proofHash+ item.hash).
- Repeat 2. for every item in the merklePath list.
- Compare if the calculated proofHash equals the one recorded in the
block header (block.receiptsHash) to verify if the statement was linked with the block.