artifact

package
v0.0.4-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package artifact defines the transport-neutral, versioned MALT artifacts shared by resolvers, provers, verifiers, gateways, daemons, and SDKs.

Index

Constants

View Source
const Profile = "malt.artifact/v0alpha2"

Profile identifies the artifact contract introduced by MALT v0.0.4. The Go package remains unversioned; the serialized envelope carries the profile.

Variables

This section is empty.

Functions

func Schema

func Schema(name string) ([]byte, error)

Schema returns a checked-in JSON Schema by stable filename.

func SchemaNames

func SchemaNames() []string

SchemaNames lists the schemas published by this artifact profile.

func Verify

func Verify(ctx context.Context, req VerifyRequest, verifier malt.ProofVerifier) error

Verify validates the request/artifact envelope and all cryptographic evidence. Resolution is existential: it proves the returned ordered arc chain, not that the execution engine selected a unique or longest chain.

Types

type Artifact

type Artifact struct {
	Profile       string              `json:"profile"`
	Operation     Operation           `json:"operation"`
	Root          string              `json:"root"`
	Query         Query               `json:"query"`
	Target        string              `json:"target"`
	RangeSegments []string            `json:"range_segments,omitempty"`
	ProofList     prooflist.ProofList `json:"prooflist"`
}

Artifact binds one request, target, and ProofList under an explicit profile. RangeSegments is populated only for measured-list range proofs.

func NewProveArtifact

func NewProveArtifact(req ProveRequest, result malt.ReadResult) (Artifact, error)

func NewResolveArtifact

func NewResolveArtifact(req ResolveRequest, target cid.Cid, pl prooflist.ProofList) (Artifact, error)

func (Artifact) Validate

func (a Artifact) Validate() error

type Operation

type Operation string
const (
	OperationResolve Operation = "resolve"
	OperationProve   Operation = "prove"
)

type ProveRequest

type ProveRequest struct {
	Profile string `json:"profile"`
	Root    string `json:"root"`
	Query   Query  `json:"query"`
}

ProveRequest asks for one primitive typed map/list proof.

func (ProveRequest) Validate

func (r ProveRequest) Validate() error

type Query

type Query struct {
	Kind     QueryKind `json:"kind"`
	Segments []string  `json:"segments,omitempty"`
	Index    *uint64   `json:"index,omitempty"`
	Start    *uint64   `json:"start,omitempty"`
	End      *uint64   `json:"end,omitempty"`
}

Query is the stable artifact projection of a MALT path or primitive typed query. Exactly the fields selected by Kind are meaningful.

func QueryFromCore

func QueryFromCore(query malt.Query) (Query, error)

func (Query) Core

func (q Query) Core() (malt.Query, error)

func (Query) Validate

func (q Query) Validate(allowPath bool) error

type QueryKind

type QueryKind string
const (
	QueryPath      QueryKind = "path"
	QueryMapKey    QueryKind = "map_key"
	QueryListIndex QueryKind = "list_index"
	QueryListRange QueryKind = "list_range"
)

type ResolveRequest

type ResolveRequest struct {
	Profile  string   `json:"profile"`
	Root     string   `json:"root"`
	Segments []string `json:"segments"`
}

ResolveRequest asks an execution engine for one authenticated derivation of a caller-supplied segment path. Candidate selection is not part of the proof contract; the reference engine currently prefers the longest prefix.

func (ResolveRequest) Validate

func (r ResolveRequest) Validate() error

type VerifyRequest

type VerifyRequest struct {
	Profile  string   `json:"profile"`
	Artifact Artifact `json:"artifact"`
}

VerifyRequest asks a verifier to validate all artifact bindings and proof evidence without trusting the resolver or gateway that produced it.

func (VerifyRequest) Validate

func (r VerifyRequest) Validate() error

type VerifyResult

type VerifyResult struct {
	Profile string `json:"profile"`
	Valid   bool   `json:"valid"`
}

Jump to

Keyboard shortcuts

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