fmerg / pymerkle

Merkle-tree in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Checksum

KirylMoisa opened this issue · comments

How to get checksum for merkle proof?

commented

Given a Merkle-proof proof, and assuming you work with the current develop branch (2bb511f), do:

from pymerkle.hashing import HashEngine

offset = proof.body['offset']
path = proof.body['path']

engine = HashEngine(**proof.get_verification_params())

checksum = engine.multi_hash(path, offset)
commented

Update after 35a586b

Given a Merkle-proof proof, do

checksum = proof.compute_checksum()