Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/olegfomenko/go-treap-merkle

Proof of concept for dynamic Merkle tree
https://github.com/olegfomenko/go-treap-merkle

merkle-tree treap

Last synced: 9 days ago
JSON representation

Proof of concept for dynamic Merkle tree

Awesome Lists containing this project

README

        

# Treap-based dynamic Merkle tree

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

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

## Usage
```go
package main

import (
"math/rand"

merkle "github.com/olegfomenko/go-treap-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"))
}
```

## Related docs

Treap description: ""

Merkle tree description: ""

Signing scheme