All Projects → celestiaorg → smt

celestiaorg / smt

Licence: MIT License
A Go library that implements a Sparse Merkle tree for a key-value map.

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to smt

qed
The scalable, auditable and high-performance tamper-evident log project
Stars: ✭ 87 (+4.82%)
Mutual labels:  merkle-tree, sparse-merkle-tree
z3 tutorial
Jupyter notebooks for tutorial on the Z3 SMT solver
Stars: ✭ 117 (+40.96%)
Mutual labels:  smt
restricted-sparse-merkle-tree
An optimized sparse merkle tree.
Stars: ✭ 47 (-43.37%)
Mutual labels:  sparse-merkle-tree
gravity-sphincs
Signature scheme submitted to NIST's Post-Quantum Cryptography Project
Stars: ✭ 67 (-19.28%)
Mutual labels:  merkle-tree
py2many
Transpiler of Python to many other languages
Stars: ✭ 420 (+406.02%)
Mutual labels:  smt
vim-smt2
A VIM plugin that adds support for the SMT-LIB2 format (including Z3's extensions)
Stars: ✭ 35 (-57.83%)
Mutual labels:  smt
ent
No description or website provided.
Stars: ✭ 33 (-60.24%)
Mutual labels:  merkle-tree
kafka-connect-transform-kryptonite
Kryptonite for Kafka is a client-side 🔒 field level 🔓 crypto library for Apache Kafka® currently focused on Kafka Connect scenarios. It's an ! UNOFFICIAL ! community project
Stars: ✭ 30 (-63.86%)
Mutual labels:  smt
merkle sigs.rs
🎄🖋 A Rust implementation of Merkle signing
Stars: ✭ 13 (-84.34%)
Mutual labels:  merkle-tree
suslik
Synthesis of Heap-Manipulating Programs from Separation Logic
Stars: ✭ 107 (+28.92%)
Mutual labels:  smt
haskell-z3
Haskell bindings to Microsoft's Z3 API (unofficial).
Stars: ✭ 48 (-42.17%)
Mutual labels:  smt
clpsmt-miniKanren
CLP(SMT) on top of miniKanren
Stars: ✭ 31 (-62.65%)
Mutual labels:  smt
CTjs
CTjs is a full set of classes necessary to work with any kind of Certificate Transparency log (V1 as from RFC6962, or V2 as from RFC6962-bis). In CTjs you could find all necessary validation/verification functions for all related data shipped with full-featured examples showning how to validate/verify. Also in scope of CTjs I made code showing e…
Stars: ✭ 2 (-97.59%)
Mutual labels:  merkle-tree
bargad
A Data Integrity framework for building efficient blockchains, transparency logs, secure file systems and more.
Stars: ✭ 54 (-34.94%)
Mutual labels:  merkle-tree
BTCert
BTCert authenticates academic certificates by means of a digital credential that allows immediate verification by third parties. BTCerts uses blockchain and cryptographic techniques to create a certification infrastructure based on the standard Blockcerts
Stars: ✭ 21 (-74.7%)
Mutual labels:  merkle-tree
fts-tree
PoC implementation of follow-the-satoshi in a Merkle tree.
Stars: ✭ 17 (-79.52%)
Mutual labels:  merkle-tree
prune-horst
Signature scheme submitted to NIST's Post-Quantum Cryptography Project
Stars: ✭ 23 (-72.29%)
Mutual labels:  merkle-tree
gb merkle trees
General balanced binary Merkle trees for Erlang
Stars: ✭ 25 (-69.88%)
Mutual labels:  merkle-tree
merkletree
A Merkle Hash Trees implementation according to RFC 6962, written in Go.
Stars: ✭ 32 (-61.45%)
Mutual labels:  merkle-tree
archsat
A proof-producing SMT/McSat solver, handling polymorphic first-order logic, and using an SMT/McSat core extended using Tableaux, Superposition and Rewriting.
Stars: ✭ 20 (-75.9%)
Mutual labels:  smt

smt

A Go library that implements a Sparse Merkle tree for a key-value map. The tree implements the same optimisations specified in the Libra whitepaper, to reduce the number of hash operations required per tree operation to O(k) where k is the number of non-empty elements in the tree.

Tests codecov GoDoc

Example

package main

import (
	"crypto/sha256"
	"fmt"

	"github.com/celestiaorg/smt"
)

func main() {
	// Initialise two new key-value store to store the nodes and values of the tree
	nodeStore := smt.NewSimpleMap()
	valueStore := smt.NewSimpleMap()
	// Initialise the tree
	tree := smt.NewSparseMerkleTree(nodeStore, valueStore, sha256.New())

	// Update the key "foo" with the value "bar"
	_, _ = tree.Update([]byte("foo"), []byte("bar"))

	// Generate a Merkle proof for foo=bar
	proof, _ := tree.Prove([]byte("foo"))
	root := tree.Root() // We also need the current tree root for the proof

	// Verify the Merkle proof for foo=bar
	if smt.VerifyProof(proof, root, []byte("foo"), []byte("bar"), sha256.New()) {
		fmt.Println("Proof verification succeeded.")
	} else {
		fmt.Println("Proof verification failed.")
	}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].