https://github.com/10d9e/fastmerkle
Golang Implementation of Streaming Merkle Root, Proof, and Verify (single leaf) from Luke Champine's paper
https://github.com/10d9e/fastmerkle
cryptography merkleproof merkletree
Last synced: 6 months ago
JSON representation
Golang Implementation of Streaming Merkle Root, Proof, and Verify (single leaf) from Luke Champine's paper
- Host: GitHub
- URL: https://github.com/10d9e/fastmerkle
- Owner: 10d9e
- License: mit
- Created: 2023-03-23T16:26:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-27T15:04:22.000Z (over 2 years ago)
- Last Synced: 2025-04-12T12:16:53.149Z (6 months ago)
- Topics: cryptography, merkleproof, merkletree
- Language: Go
- Homepage: https://eprint.iacr.org/2021/038.pdf
- Size: 25.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastmerkle
Golang Implementation of Streaming Merkle Root, Proof, and Verify (single leaf) from Luke Champine's paper: **Streaming Merkle Proofs within Binary Numeral Trees** @ https://eprint.iacr.org/2021/038.pdf
## Usage
```golang
import "github.com/jlogelin/fastmerkle"func main() {
blkstream := [][]byte{[]byte("a"), []byte("b"), []byte("c")}
root := MerkleRoot(blkstream)
fmt.Printf("Merkle root: %x\n", root)
}
```## Benchmark
The following root node calculation benchmark was run on an `Apple M1 Pro 32 GB`.
Parameters:
- 33554432 elements
- sha256 hash| Project | Execution Time |
| ------------- | ------------- |
| [fast-merkle](https://github.com/jlogelin/fastmerkle) | 8.320988875s |
| [cbergoon/merkletree](https://github.com/cbergoon/merkletree) | 26.294219875s |
| [wealdtech/go-merkletree](https://github.com/wealdtech/go-merkletree) | 30.399641917s |
| [txaty/go-merkletree](https://github.com/txaty/go-merkletree) | 2m 37s |