No description
Find a file
2022-01-03 10:15:45 +01:00
db full refactor 2021-03-22 17:20:28 +01:00
smt apply golang-ci suggestions 2021-03-26 19:47:07 +01:00
asmt.go Rm dvote/censustree interface dependency (which nolonger exists) 2022-01-03 10:15:45 +01:00
asmt_test.go rename 2021-03-27 18:30:07 +01:00
go.mod Rm dvote/censustree interface dependency (which nolonger exists) 2022-01-03 10:15:45 +01:00
go.sum Rm dvote/censustree interface dependency (which nolonger exists) 2022-01-03 10:15:45 +01:00
LICENSE Add readme and license file 2021-03-27 18:29:06 +01:00
README.md Add readme and license file 2021-03-27 18:29:06 +01:00

asmt

asmt is a GoLang sparse merkle tree.

A forked of Aergo SMT with minor style code modifications and some new methods: Walk() WalkWithRoot() and GetWithRoot().

This module includes an abstraction layer to make the SMT more developer friendly with a very easy to use API:

  • Init(name, dataDir string) error
  • LastAccess() (timestamp int64)
  • Add(key, value []byte) error
  • AddBatch(keys, values [][]byte) (failedIndexes []int, err error)
  • GenProof(key, value []byte) (mproof []byte, err error)
  • CheckProof(key, value, root, mproof []byte) (included bool, err error)
  • Root() []byte
  • HashExists(hash []byte) (bool, error)
  • Dump(root []byte) (data []byte, err error) // Dump must return a format compatible with ImportDump
  • DumpPlain(root []byte) (keys [][]byte, values [][]byte, err error)
  • ImportDump(data []byte) error
  • Size(root []byte) (int64, error)
  • Snapshot(root []byte) (Tree, error) // Snapshot is a frozen trie on a specific Root hash that cannot be modified