Documentation ¶
Index ¶
- type Message
- type SignedProof
- type State
- type Store
- func (as *Store) Add(message Message) SignedProof
- func (as *Store) AppendState(state State) error
- func (as *Store) Collapse()
- func (as *Store) GetMessagesAfter(latestCommit []byte) []Message
- func (as *Store) GetState() State
- func (as *Store) GetStateAfter(commitment []byte) State
- func (as *Store) Init(identity primitives.Identity)
- func (as *Store) LoadFromStorage(db persistence.Service)
- func (as *Store) MergeState(state State) error
- func (as *Store) VerifyFraudProof(fraudCommit []byte, signedFraudProof SignedProof, key ed25519.PublicKey) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ¶
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 ¶
GetMessagesAfter provides access to messages after the given commit.
func (*Store) GetState ¶
GetState returns the current auditable state
func (*Store) GetStateAfter ¶
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 ¶
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)