Skip to content

Commit

Permalink
Add link to on chain method
Browse files Browse the repository at this point in the history
Signed-off-by: litt3 <[email protected]>
  • Loading branch information
litt3 committed Dec 20, 2024
1 parent 26d68ca commit 6357d45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions verify/merkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import (
// NOTE: this method returning a nil error does NOT indicate that the proof is valid. Rather, it merely indicates that
// the proof was well-formed. The hash returned by this method must be compared to the claimed root hash, to
// determine if the proof is valid.
//
// This method is a reimplementation of the on-chain verification method [processInclusionProofKeccak]
// (https://github.com/Layr-Labs/eigenlayer-contracts/blob/dev/src/contracts/libraries/Merkle.sol#L49-L76)
func ProcessInclusionProof(proof []byte, leaf common.Hash, index uint64) (common.Hash, error) {
if len(proof)%32 != 0 {
return common.Hash{}, errors.New("proof length should be a multiple of 32 bytes or 256 bits")
Expand Down

0 comments on commit 6357d45

Please sign in to comment.