Files
go-dvote/tree
p4u b8dccadfaa Fix getRoot
Signed-off-by: p4u <p4u@dabax.net>
2019-02-11 20:03:49 +01:00
..
2019-01-22 16:41:46 +01:00
2019-02-11 20:03:49 +01:00

dvote Tree

Implementation of dvote tree structure. Currently based on iden3 merkle tree.

Example of usage:

  T := tree.Tree
  if T.Init() != nil { fmt.Println("Cannot create tree database") }
  err := T.AddClaim([]byte("Hello you!"))
  if err != nil {
    fmt.Println("Claim already exist")
  }
  mpHex, err := T.GenProof([]byte("Hello you!"))
  fmt.Println(mpHex)
  fmt.Println(T.CheckProof([]byte("Hello you!"), mpHex))
  T.Close()

To-Do

Avoid duplicates on dump/snapshot