noa-receipt
Version:
NOA Agent Action Receipt — open, offline-verifiable provenance for AI-agent actions. The governance/receipt organ only; the NOA brain is separate and proprietary.
49 lines (48 loc) • 1.55 kB
TypeScript
export declare const ANCHOR_SIG_DOMAIN = "NOA-Federation-Anchor-v0.1-sig";
export interface AnchorSig {
alg: "ed25519";
kid: string;
value: string;
}
export interface Anchor {
chain: string;
highestSeq: number;
headHash: string;
ts: string;
sig: AnchorSig;
}
export interface PinnedWitness {
kid: string;
pubkey: string;
}
export interface TrustSet {
witnesses: PinnedWitness[];
quorum: number;
}
export interface ChainHead {
chain: string;
seq: number;
hash: string;
}
export interface FreshnessPolicy {
now: number;
maxAgeMs: number;
skewMs?: number;
}
export interface CompletenessOptions {
freshness?: FreshnessPolicy;
}
export type AcceptanceClassification = "QUORUM_CONFIRMED" | "NOT_ESTABLISHED" | "TRUNCATED" | "FORK" | "STALE" | "INVALID_INPUT";
export interface CompletenessResult {
complete: boolean;
scope: "snapshot";
classification: AcceptanceClassification;
note: string;
reason: string;
confirmations: number;
stale: number;
freshnessEnforced: boolean;
}
export declare function anchorSigningInput(a: Pick<Anchor, "chain" | "highestSeq" | "headHash" | "ts">): Buffer;
export declare function verifyCompleteness(headBytes: Uint8Array | string, anchorsBytes: Uint8Array | string, trustSetBytes: Uint8Array | string, opts?: CompletenessOptions): CompletenessResult;
export declare function verifyCompletenessParsed(head: ChainHead, anchors: readonly Anchor[], trustSet: TrustSet, opts?: CompletenessOptions): CompletenessResult;