Skip to main content
AlgoVoi-published npm packages predating VCX PR #2544 (committed 2026-06-02 17:46 UTC) alongside the corresponding VCX constructs. All AlgoVoi source is Apache 2.0. Confidence labels: A = exact match, B = renamed/adapted, C = same pattern different form, D = shared infrastructure. See also: Substrate Authorship and Provenance — full attribution exhibit with prior art anchors and Apache 2.0 position.

Tier 1 — Confirmed function-level overlap

T1-1 — canonicalizeBytescanonicalJsonBytes (Confidence B)

AlgoVoi · @algovoi/substrate 0.3.0 · typescript/src/canonicalize.ts · npm 2026-05-23
export function canonicalizeBytes(obj: unknown): Uint8Array {
  return new TextEncoder().encode(canonicalize(obj));
}
VCX PR #2544 · typescript/packages/extensions/src/vcx/envelope/canonicalize.ts · committed 2026-06-02
export function canonicalJsonBytes(value: unknown): Uint8Array {
  const json = canonicalize(value);
  if (typeof json !== "string") {
    throw new Error("JCS canonicalization returned non-string");
  }
  return new TextEncoder().encode(json);
}
Verdict (B): Renamed verbatim — canonicalizeBytescanonicalJsonBytes, objvalue. Identical new TextEncoder().encode(...) body. The added typeof json !== "string" guard is equivalent to AlgoVoi’s if (out === undefined) guard one call up.

T1-2 — sha256JcsjcsSha256 + "sha256:" prefix convention (Confidence A/B)

AlgoVoi · @algovoi/substrate 0.3.0 · typescript/src/canonicalize.ts · npm 2026-05-23
export function sha256Jcs(obj: unknown): string {
  return createHash('sha256').update(canonicalize(obj)).digest('hex');
}
VCX PR #2544 · typescript/packages/extensions/src/vcx/envelope/canonicalize.ts · committed 2026-06-02
export function jcsSha256(value: unknown): string {
  const bytes = canonicalJsonBytes(value);
  return "sha256:" + createHash("sha256").update(bytes).digest("hex");
}
VCX also enforces the "sha256:" prefix as a format validator in credential/trustlist.ts:
if (!/^sha256:[0-9a-f]{64}$/.test(obj.didDocumentHash)) {
  throw new Error(`Trust-list entry didDocumentHash MUST be "sha256:<lowercase-hex>"`);
}
Verdict (B/A): Function name letters transposed — sha256JcsjcsSha256. Identical createHash('sha256')...digest('hex') pipeline. VCX absorbs AlgoVoi’s application-layer "sha256:" prefix convention into the primitive and validates it as a format requirement in the trustlist verifier.

T1-3 — content_hash audit-chain pattern → envelopeDigest + verifyDidDocumentHash (Confidence B)

AlgoVoi · @algovoi/substrate 0.3.0 · typescript/src/audit-chain.ts · npm 2026-05-23
// Build: content-address each audit row
content_hash: sha256Jcs(payload),
prev_hash: prevHash,

// Verify: recompute and compare
const recomputed = sha256Jcs(row.payload);
if (row.content_hash !== recomputed) { /* throw AuditChainError */ }
VCX PR #2544 · typescript/packages/extensions/src/vcx/envelope/canonicalize.ts + credential/trustlist.ts · committed 2026-06-02
// canonicalize.ts — content-address an envelope
export function envelopeDigest(envelope: IdentityEnvelope): string {
  return jcsSha256(envelope);
}

// trustlist.ts — same build-then-compare pattern for DID documents
const computed = jcsSha256(result.didDocument);
if (computed !== opts.expectedHash) {
  return { ok: false, reason: `didDocumentHash mismatch...` };
}
Verdict (B): Same JCS+SHA-256 content-addressing pattern — build a per-object digest, then compare against an expected value. content_hash = sha256Jcs(payload)envelopeDigest = jcsSha256(envelope). prev_hash chain linkage deferred to VCX §16.1 companion PR (see Tier 3).

T1-4 — settled_payment_ref field name (Confidence A)

AlgoVoi · @algovoi/settlement-attestation 0.1.0 · typescript/src/settlement-attestation.ts · npm 2026-05-25
export interface SettlementAttestation {
  settled_payment_ref: string;   // "sha256:<hex>" content-addressed ref
  settlement_result: SettlementResult;
  settlement_timestamp_ms: number;
  // ...
}
VCX PR #2544 · specs/extensions/vcx.md §16.1 · committed 2026-06-02
{
  "settled_payment_ref": "...",
  "vcx": {
    "envelopeDigest": "sha256:<lowercase-hex>",
    "issuerDid": "did:web:paypal.com"
  }
}
Verdict (A): Exact field name. AlgoVoi published 8 days before VCX PR commit.

Tier 2 — Structural inference

T2-1 — Pre-canonicalisation type guard (Confidence C)

AlgoVoi · @algovoi/substrate 0.3.0 · typescript/src/canonicalize.ts · npm 2026-05-23
function validateTypes(obj: unknown, path = '$'): void {
  // walks the object tree; throws CanonicalizationError on non-canonicalisable type
}

export function canonicalize(obj: unknown): string {
  validateTypes(obj);
  const out = canonicalizeLib(obj);
  if (out === undefined) {
    throw new CanonicalizationError('object is not JCS-canonicalisable');
  }
  return out;
}
VCX PR #2544 · typescript/packages/extensions/src/vcx/envelope/canonicalize.ts · committed 2026-06-02
export function canonicalJsonBytes(value: unknown): Uint8Array {
  const json = canonicalize(value);
  if (typeof json !== "string") {
    throw new Error("JCS canonicalization returned non-string");
  }
  return new TextEncoder().encode(json);
}
Verdict (C): Same defensive discipline — guard the return value of the canonicalize call before acting on it. AlgoVoi validates upstream via validateTypes + undefined check; VCX checks the return type in the immediate caller. Different placement, same intent.

T2-2 — import canonicalize from "canonicalize" (Confidence D)

AlgoVoi · typescript/src/canonicalize.ts · npm 2026-05-23
import canonicalizeLib from 'canonicalize';
VCX PR #2544 · typescript/packages/extensions/src/vcx/envelope/canonicalize.ts · committed 2026-06-02
import canonicalize from "canonicalize";
Verdict (D): Same npm package (Samuel Erdtman, RFC 8785 reference implementation, MIT). Weak standalone; listed as shared infrastructure contextualising the Tier 1 function matches.

T2-3 — ComplianceReceipt structure → VCX identity layer (Confidence C)

AlgoVoi · @algovoi/substrate 0.3.0 · typescript/src/compliance-receipt.ts · npm 2026-05-23
export interface ComplianceReceipt {
  payer_ref: string;              // "sha256:<hex>" content-addressed identity
  screen_provider_did: string;   // DID URI of compliance provider
  jurisdiction_flags: string[];  // ordered array — ["UK","EU"] ≠ ["EU","UK"]
  canon_version: string;         // in-band discipline pin
  screen_result: ScreenResult;   // closed enum: ALLOW / REFER / DENY
  screen_timestamp_ms: number;   // integer epoch-ms
}
VCX PR #2544 · typescript/packages/extensions/src/vcx/types.ts · committed 2026-06-02
export interface PaymentSourceLayer {
  accountId: string;
  sourceId: string;   // content-addressed identity reference
  network: string;
  asset?: string;
}
export interface PrincipalLayer {
  did: string;        // DID URI of identity provider
  credentialJwt: string;
  // ...
}
export interface AgentLayer {
  did: string;        // DID URI of agent
  // ...
}
Verdict (C): Same structural pattern — content-addressed identity reference + DID field for provider + ordered collection for scope. payer_refsourceId; screen_provider_didprincipal.did; jurisdiction_flags ordered array → allowedNetworks / allowedAssets arrays. Different layer names, same design intent.

Tier 3 — Pre-absorption (companion PR scope)

AlgoVoi patterns already published before VCX PR. VCX §16.1 explicitly defers the full settlement receipt shape to a “companion PR” — these constructs are the likely content of that companion PR.

T3-1 — SETTLEMENT_RESULTS three-state enum

AlgoVoi · @algovoi/settlement-attestation 0.1.0 · typescript/src/settlement-attestation.ts · npm 2026-05-25
export const SETTLEMENT_RESULTS = [
  'SETTLED',
  'PENDING_FINALITY',
  'REVERSED',
] as const;
export type SettlementResult = (typeof SETTLEMENT_RESULTS)[number];
VCX PR #2544 · specs/extensions/vcx.md §16.1 · committed 2026-06-02
“full settlement receipt shape is out of scope for VCX v1.0 and will be addressed in a companion PR”
Status: Published 8 days before VCX PR commit. Named in AlgoVoi’s attribution comments on PR #2544. Companion PR not yet filed.

T3-2 — AuditChainRow { prev_hash } linkage

AlgoVoi · @algovoi/substrate 0.3.0 · typescript/src/audit-chain.ts · npm 2026-05-23
export interface AuditChainRow {
  chain_position: number;
  content_hash: string;       // SHA-256(JCS(payload))
  prev_hash: string | null;   // null at head; links to previous content_hash
  payload: unknown;
}
VCX PR #2544: envelopeDigest present in §6.4; full prev_hash chain linkage deferred to companion PR per §16.1. Status: Published 10 days before VCX PR commit. prev_hash is the forward-chaining audit property absent in VCX v1.0.

T3-3 — CANON_VERSION = 'jcs-rfc8785-v1' in-band pin

AlgoVoi · @algovoi/substrate 0.3.0 · typescript/src/canonicalize.ts · npm 2026-05-23
export const CANON_VERSION = 'jcs-rfc8785-v1' as const;
// emitted as canon_version field in every AlgoVoi receipt format
VCX PR #2544: No canon_version field present in the current VCX envelope schema. Status: Published 10 days before VCX PR commit. The jcs-rfc8785-v1 identifier is registered in draft-hopley-x402-canonicalisation-jcs-v1 §10.1 (AlgoVoi, IETF 2026-05-24). A companion PR adopting AlgoVoi’s receipt lifecycle model will require this pin.
Apache 2.0 except where individual package LICENCE files specify otherwise.