exported

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeMerkle string = "merkle"
)

string representation of the commitment types

Variables

This section is empty.

Functions

This section is empty.

Types

type Path

type Path interface {
	GetCommitmentType() Type
	String() string
	IsEmpty() bool
}

Path implements spec:CommitmentPath. A path is the additional information provided to the verification function.

type Prefix

type Prefix interface {
	GetCommitmentType() Type
	Bytes() []byte
	IsEmpty() bool
}

Prefix implements spec:CommitmentPrefix. Prefix represents the common "prefix" that a set of keys shares.

type Proof

type Proof interface {
	GetCommitmentType() Type
	VerifyMembership(Root, Path, []byte) error
	VerifyNonMembership(Root, Path) error
	IsEmpty() bool

	ValidateBasic() error
}

Proof implements spec:CommitmentProof. Proof can prove whether the key-value pair is a part of the Root or not. Each proof has designated key-value pair it is able to prove. Proofs includes key but value is provided dynamically at the verification time.

type Root

type Root interface {
	GetCommitmentType() Type
	GetHash() []byte
	IsEmpty() bool
}

Root implements spec:CommitmentRoot. A root is constructed from a set of key-value pairs, and the inclusion or non-inclusion of an arbitrary key-value pair can be proven with the proof.

type Type

type Type byte

Type defines the type of the commitment

const (
	Merkle Type = iota + 1 // 1
)

Registered commitment types

func (Type) String

func (ct Type) String() string

String implements the Stringer interface

Jump to

Keyboard shortcuts

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