auditable

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message []byte

Message encapsulates a message for more readable code.

type SignedProof

type SignedProof []byte

SignedProof encapsulates a signed proof

type State

type State struct {
	SignedProof SignedProof
	Messages    []Message
}

State defines an array of messages.

type Store

type Store struct {
	LatestCommit []byte
	// contains filtered or unexported fields
}

Store defines a cryptographically secure & auditable transcript of messages sent from multiple unrelated clients to a server.

func (*Store) Add

func (as *Store) Add(message Message) SignedProof

Add adds a message to the auditable store

func (*Store) AppendState

func (as *Store) AppendState(state State) error

AppendState merges a given state onto our state, first verifying that the two transcripts align

func (*Store) Collapse

func (as *Store) Collapse()

Collapse constructs a verifiable proof stating that the server has collapsed the previous history into the current root = H(onion) L = H(Sign(LatestCommit))

func (*Store) GetMessagesAfter

func (as *Store) GetMessagesAfter(latestCommit []byte) []Message

GetMessagesAfter provides access to messages after the given commit.

func (*Store) GetState

func (as *Store) GetState() State

GetState returns the current auditable state

func (*Store) GetStateAfter

func (as *Store) GetStateAfter(commitment []byte) State

GetStateAfter returns the current auditable state after a given commitment

func (*Store) Init

func (as *Store) Init(identity primitives.Identity)

Init initializes an auditable store

func (*Store) LoadFromStorage

func (as *Store) LoadFromStorage(db persistence.Service)

LoadFromStorage initializes an auditable store from a DB

func (*Store) MergeState

func (as *Store) MergeState(state State) error

MergeState merges a given state onto our state, first verifying that the two transcripts align

func (*Store) VerifyFraudProof

func (as *Store) VerifyFraudProof(fraudCommit []byte, signedFraudProof SignedProof, key ed25519.PublicKey) (bool, error)

VerifyFraudProof - the main idea behind this is as follows:

Every update requires the server to sign, and thus commit to, a transcript Clients reconstruct the transcript via MergeState, as such clients can keep track of every commit. if a client can present a signed transcript commit from the server that other clients do not have, it is proof that either 1) they are out of sync with the server or 2) the server is presenting different transcripts to different people

If, after syncing, the FraudProof still validates, then the server must be malicious. the information revealed by publicizing a fraud proof is minimal it only reveals the inconsistent transcript commit and not the cause (which could be reordered messages, dropped messages, additional messages or any combination)

Jump to

Keyboard shortcuts

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