Skip to main content

Module json

Module json 

Source
Expand description

uor_addr::json — the JSON realization of UOR-ADDR (ARCHITECTURE.md “Format-specific realizations” § uor-addr-json).

JSON typed-input content-addressing under JCS-RFC8785 §3 + Unicode NFC, with the σ-projection bound to prism::crypto::Sha256Hasher.

§Authoritative sources

§End-to-end through prism’s typed-iso surface (ADR-060)

  1. canonicalize parses raw JSON and emits the JCS-RFC8785 + Unicode-NFC canonical-form bytes into an alloc buffer at the host boundary (object members sorted by key; no width / count caps).
  2. address wraps those bytes in the borrowed JsonCarrier and runs AddressModel’s forward(): the ψ-chain verb address_inference threads the carrier through the shared AddressResolverTuple (ADR-036), and ψ₉ folds the canonical bytes through Sha256Hasher in one σ-projection to derive the κ-label.
  3. address returns the crate::AddressOutcome carrying the crate::AddressLabel κ-label + replayable TC-05 witness — well-formed JSON always yields exactly one label.

§Why this module exists

Per ARCHITECTURE.md, UOR-ADDR is a body of PrismModel declarations specialized to typed content-addressing across formats with bounded recursive structural typing. Each format ships its concrete specialization (this module for JSON; crate::sexp for S-expressions; future modules per the demand-driven clause of ADR-031). The common surface (crate::common) names the shared trait, output shape, and cost-model commitment; each format declares its own concrete prism_model!, verb!, and resolver! invocations because the SDK macros emit per-declaration types.

Re-exports§

pub use model::AddressModel;
pub use model::AddressModelBlake3;
pub use model::AddressModelKeccak256;
pub use model::AddressModelSha3_256;
pub use model::AddressModelSha512;
pub use model::AddressRoute;
pub use pipeline::address;
pub use pipeline::address_blake3;
pub use pipeline::address_keccak256;
pub use pipeline::address_sha3_256;
pub use pipeline::address_sha512;
pub use pipeline::AddressFailure;
pub use pipeline::AddressOutcome;
pub use pipeline::AddressWitness;
pub use pipeline::VerifyError;
pub use shapes::MAX_JSON_DEPTH;
pub use value::JsonCarrier;
pub use value::canonicalize;
pub use value::ArrayIter;
pub use value::JsonValue;
pub use value::JsonValueRef;
pub use value::ObjectIter;
pub use verbs::address_inference;
pub use verbs::VERB_TERMS_ADDRESS_INFERENCE;
pub use crate::bounds::AddrBounds;
pub use crate::resolvers::AddressResolverTuple;

Modules§

model
json::AddressModel* — the JSON realization’s PrismModel declarations, one per admissible σ-axis (crate::hash). Each binds the shared AddressResolverTuple ψ-tower and the axis’s capacity profile (AddrBounds for the 32-byte axes, AddrBounds64 for sha512); the input is the ADR-060 borrowed-carrier handle JsonCarrier. AddressModel (sha256) is the default.
pipeline
json::address* — the JSON realization’s public entry points, one per admissible σ-axis (crate::hash).
shapes
Substitution-axis selections.
value
JSON typed input (ADR-023 amended by ADR-060) with JCS-RFC8785 + Unicode NFC canonical-form byte output.
verbs
uor-addr’s ψ-chain content-address derivation verbs (wiki ADR-024, ADR-035, ADR-036) — one per admissible σ-axis.

Structs§

Sha256Hasher
Canonical Hasher<32> selection for the address-derivation pipeline. Re-exported from the Prism standard library; see wiki ADR-031. FIPS-180-4 SHA-256 hasher. 32-byte digest.