client

package
v0.0.0-...-3a3cb9f Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

client contains a library for interacting with a Verifiable Index.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyLookupResponse

func VerifyLookupResponse(keyHash [sha256.Size]byte, resp api.LookupResponse, outV note.Verifier) ([]uint64, []byte, error)

Types

type InputLogClient

type InputLogClient struct {
	// contains filtered or unexported fields
}

InputLogClient is a client intended to be used by users of the VIndexClient that want to look up the original leaves from the Input Log.

func NewInputLogClient

func NewInputLogClient(inLogUrl string, origin string, inV note.Verifier, hc *http.Client) (*InputLogClient, error)

NewInputLogClient returns a client that allows pointers returned from the Verifiable Index to be dereferenced by looking up entries in the Input Log. All operations are verified by this client, which closes the loop.

func (*InputLogClient) Dereference

func (c *InputLogClient) Dereference(ctx context.Context, cpRaw []byte, pointers []uint64) iter.Seq2[InputLogLeaf, error]

Dereference takes pointers returned by the VIndexClient Lookup method, and fetches the original leaves from the Input Log. The inclusion of any leaves returned will be verified by constructing inclusion proofs to the checkpoint provided.

type InputLogLeaf

type InputLogLeaf struct {
	Index uint64
	Data  []byte
}

InputLogLeaf is an entry in the Input Log.

type VIndexClient

type VIndexClient struct {
	// contains filtered or unexported fields
}

VIndexClient allows verified lookups into a verifiable index.

func NewVIndexClient

func NewVIndexClient(vindexUrl string, outV note.Verifier) (*VIndexClient, error)

NewVIndexClient returns a client that can perform verified lookups into the index at the given base URL, using the supplied verifier to check checkpoint signatures on the output log.

func (VIndexClient) Lookup

func (c VIndexClient) Lookup(ctx context.Context, key string) ([]uint64, []byte, error)

Lookup returns all indices, in ascending order, where the given key appears in the Input Log. This will be verified before being returned from this method, so a caller can be assured that any results (including the empty slice, i.e. non-presence) were found in the verifiable index, and committed to by the output log. On success, this also returns the Checkpoint for the Input Log that was relied upon by the verifiable index. This may be used by the caller when constructing inclusion proofs when dereferencing any pointers returned.

Note that it is up to the caller to ensure that any leaves looked up in the Input Log are verified by an inclusion proof. The checkpoint returned by this method can be used. The easiest way to do this is to use the InputLogClient.

Jump to

Keyboard shortcuts

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