merkle tee with sha256?!
cryptonian-base opened this issue · 1 comments
cryptonian-base commented
I've been trying to make zkSNARK for merkle tree with sha256.
Merkle tree with mimc is given as an example in this repo but replacing mimc with sha256_full or sha256_many has been found not that easy task.
Anyone has tried the same thing? Any advice will be welcome :)
HarryR commented
For merkle-tree with SHA256, see an example at:
https://github.com/barryWhiteHat/miximus/blob/master/src/main.cpp#L84
This uses the two gadgets from libsnark:
- merkle_authentication_path_variable
- merkle_tree_check_read_gadget
These can be used in-conjunction with the SHA256 gadgets from Ethsnarks to make hashes which are compatible with Ethereum.
- https://github.com/HarryR/ethsnarks/blob/master/src/gadgets/sha256_many.cpp (takes arbitrary length input, does arbitrary padding)
- https://github.com/HarryR/ethsnarks/blob/master/src/gadgets/sha256_full.hpp (only accepts a 512bit input)
An Ethereum-compatible solidity library for doing merkle tree with SHA256 is: