dynamic-merkle

command
v0.0.0-...-ee1bab5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 2 Imported by: 0

README

Treap-based dynamic Merkle tree

Proof of concept for dynamic Merkle tree. Treap as primary data structure used to achieve logarithmic inserting/removing.

Usage

package main

import (
	"math/rand"
	
	merkle "github.com/olegfomenko/crypto/dynamic-merkle"
)

func main() {
	tree := merkle.New()
	
	// Insert
	tree.Insert([]byte("hash"), rand.Uint64())
	
	// Merkle path
	path := tree.MerklePath([]byte("hash"))
	
	// Merkle Root
	root := tree.MerkleRoot()

	// Remove
	tree.Remove([]byte("hash"))
}

Treap description: "https://en.wikipedia.org/wiki/Treap"

Merkle tree description: "https://en.wikipedia.org/wiki/Merkle_tree"

Signing scheme

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL