api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Overview

api contains the API definitions for the prototype VIndex API.

Index

Constants

View Source
const (
	// PathLookup defines the path from the vindex base URL where the lookup
	// operation will be served. This should be constructed by appending a
	// hex encoded hash to look up, and the server returns a marshalled
	// LookupResponse.
	PathLookup = "/lookup/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexNode

type IndexNode struct {
	LabelBitLen uint32            `json:"label_bit_len"`
	LabelPath   []byte            `json:"label_path"`
	Hash        [sha256.Size]byte `json:"hash"`
}

IndexNode is a node in the Verifiable Index.

type LookupResponse

type LookupResponse struct {
	// These values represent the proof that the state of the index is committed
	// to in the output log. These fields are a checkpoint, the encoded leaf in
	// this log (which can be parsed as an OutputLogLeaf), and a proof that the leaf
	// is committeed to by the checkpoint.
	//
	// TODO(mhutchinson): Revisit these fields when implementing the output log.
	// A more modern approach is to return only an index into the output log, and then
	// have the client look up the latest checkpoint, leaf value, and inclusion proof.
	// This puts more work on the client, but saves work for the server and provides
	// more flexibility.
	OutputLogCP    []byte              `json:"output_log_cp"`
	OutputLogLeaf  []byte              `json:"output_log_leaf"`
	OutputLogProof [][sha256.Size]byte `json:"output_log_proof"`

	// These values represent the lookup operation in the index at the root hash
	// committed to by OutputLogLeaf. The values contain all indices for the given
	// key, and the proof binds these values at this key at the index root hash.
	IndexValue []uint64    `json:"index_value"`
	IndexProof []IndexNode `json:"index_proof"`
}

LookupResponse describes the result from a lookup operation.

Jump to

Keyboard shortcuts

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