10d9e / fastmerkle

Golang Implementation of Streaming Merkle Root, Proof, and Verify (single leaf) from Luke Champine's paper

Home Page:https://eprint.iacr.org/2021/038.pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

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 8.320988875s
cbergoon/merkletree 26.294219875s
wealdtech/go-merkletree 30.399641917s
txaty/go-merkletree 2m 37s

About

Golang Implementation of Streaming Merkle Root, Proof, and Verify (single leaf) from Luke Champine's paper

https://eprint.iacr.org/2021/038.pdf

License:MIT License


Languages

Language:Go 100.0%