Skip to content
UOR-FoundationPublic

About

Reference implementation of UOR-ADDR — chain-agnostic canonical content addressing for agent-produced content.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

0 watching

Forks

UOR-ADDR provisional banner: deterministic content addressing, placeholder not approved

Illustrative placeholder artwork, pending UOR Foundation brand review.

uor-addr

Give equivalent digital data a consistent address, even when formatting differs.

CI crates.io API docs Apache-2.0

Why uor-addr exists

Two programs can hold the same information but store it in different ways. For example, one JSON file may list a person's first name before their last name, while another lists the keys in the opposite order. Comparing the files byte for byte would say they are different, even though the JSON objects represent the same data.

uor-addr makes supported data easier to recognize across systems. It follows published rules to put a value into a consistent form, then gives that form a content-based identifier. This helps programs compare, reference, and exchange data without relying on a file name or storage location.

These rules are format-specific. uor-addr does not decide that any two arbitrary files have the same meaning, and a content address alone does not prove that the underlying information is true or trustworthy.

Contents

What it does

For supported formats, uor-addr turns a data value into an identifier based on its normalized content. For example, two JSON objects with the same keys and values in a different key order can produce the same address. A changed value produces a different normalized input and will normally produce a different hash.

The library supports several data formats and offers Rust, C, WebAssembly, and other language bindings. The quickstart shows the first address you can create yourself.

Technical details

The library uses published rules to put supported formats into a consistent representation, then hashes the resulting bytes. These rules include JCS for JSON, Rivest's canonical S-expressions, XML-C14N 1.1, and DER for ASN.1. Schema-pinned wrappers (schema.org/Photograph, schema.org/Article, in-toto Statement v1) add admission predicates without changing the label.

The library is no_std-compatible, but its default Cargo features include std. Disable default features for an embedded/no-allocator build; the ψ-pipeline itself is designed not to touch an allocator: a value's canonical form flows through it as a source-polymorphic carrier (inline, borrowed, or streamed) with no input size cap. The realizations whose canonical form needs no heap — ring, sexp, asn1, codemodule — are fully no_alloc and build clean with --no-default-features; the ones that materialize a canonical form (json, xml, the schema::* descendants, gguf, onnx) gate address() behind the alloc feature. The std feature is an ergonomic on-top wrapper.

Quickstart

Add the library to a Rust application

You need Rust and Cargo. In an existing Cargo project, install the published Rust package:

cargo add uor-addr

Use the library in src/main.rs:

use uor_addr::json::address;

fn main() {
    let outcome = address(br#"{"foo": "bar"}"#).expect("valid JSON input");
    println!("{}", outcome.address);
}

Run cargo run. The observable result is an address formatted as blake3:<64 hexadecimal characters>. Its exact value depends on the canonical input and chosen axis. The sample illustrates JSON addressing; for further representation guarantees, run the dedicated conformance suite. Crate installation and standalone consumer execution were not rerun as part of this README-only change.

Run the maintained source examples

git clone https://github.com/UOR-Foundation/uor-addr.git
cd uor-addr
cargo run -p uor-addr --example address_value
just examples

The first command runs the repository's checked-in address_value example. just examples runs the repository's example recipe, which includes multiple format realizations. Commands are backed by source files; this README edit itself does not constitute an independent execution test.

For constrained targets, consult the feature manifest and verification guide. Defaults include std, gguf, onnx, and safetensors; the no_std path requires --no-default-features.

Install (per ecosystem)

Language Install Source
Rust cargo add uor-addr crates.io/crates/uor-addr
JS / TS (npm) npm install @uor-foundation/uor-addr npmjs.com/package/@uor-foundation/uor-addr
Python pip install uor-addr pypi.org/project/uor-addr
C / embedded link uor-addr-c (extern "C" + uor_addr.h) crates.io/crates/uor-addr-c
Other (Go / .NET / Ruby / Java / Deno) consume the WASM Component Model via wasmtime crates.io/crates/uor-addr-wasm

Every binding produces the same 71-byte ASCII blake3:<64hex> κ-label byte-for-byte by default; sha256:<64hex> is one explicit axis selection away. See RELEASING.md for the polyglot release surface.

Which realization fits my data?

Format / standard Module Imported spec
JSON (RFC 8259 + RFC 8785 JCS) uor_addr::json RFC 8785
S-expressions uor_addr::sexp Rivest 1997
XML uor_addr::xml W3C XML-C14N 1.1 (subset)
ASN.1 uor_addr::asn1 ITU-T X.690 DER
Ring elements uor_addr::ring UOR Amendment 43 §2
Code-module AST uor_addr::codemodule CCMAS (UOR-native)
Photo metadata uor_addr::schema::photo schema.org/Photograph
Document / article uor_addr::schema::document schema.org/Article
Signed-software attestation uor_addr::schema::codemodule_signed in-toto Statement v1
Storage-tier cost model uor_addr::variant::storage ADR-048 + QS-06
Signature cost model uor_addr::variant::signed ADR-048 + ADR-049

See docs/realizations.md for guidance on picking the right realization for your data.

Distribution

Crate Target Consumed by
uor-addr crates.io Rust applications (host + embedded)
uor-addr-c C ABI (extern "C" + cbindgen header) Embedded C/C++, Python cffi, Go cgo, Ruby FFI, .NET P/Invoke
uor-addr-wasm WASM Component Model (wit-bindgen) JS/TS (via jco), Python (wasmtime-py), Go (wasmtime-go), .NET, Ruby, Java

All three paths produce the same 71-byte κ-label byte-for-byte for the same input. The ψ-pipeline is allocator-free; only the FFI marshalling layers allocate when their target ABI requires it (e.g. WIT Component Model list<u8> → Vec<u8>).

Documentation

Read If you want to
docs/getting-started.md Mint your first κ-label end-to-end
docs/realizations.md Pick the right realization for your data
ARCHITECTURE.md Understand how UOR-ADDR fits the UOR-Framework
STANDARDS.md Cite the imported specs
CONFORMANCE.md Reference an invariant ID in a PR or test
VERIFICATION.md Reproduce the V&V acceptance gate (just vv)
ANALYSIS.md Read the empirical-analysis derivation

Project status

  • 361 tests pass across 22 test binaries; every realization has a published-spec conformance suite, plus 19,074 vectors × 5 identities from UCD 15.1.0 NormalizationTest.txt exercising the in-crate NFC normalizer.
  • 20 runnable examples (just examples), including content-addressed GGUF/ONNX model registry + provenance and κ-label composition.
  • #![forbid(unsafe_code)] for the core crate; no_std by default, with the ring/sexp/asn1/codemodule realizations no_alloc (verified by cargo build --no-default-features --target thumbv7em-none-eabihf).
  • C ABI bindings + WASM Component Model bindings ship under crates/uor-addr-c and crates/uor-addr-wasm.
  • Apache-2.0 licensed.

Contributing

The conformance contract in CONFORMANCE.md is the normative surface. Any PR that changes observable behavior must either update the contract (declaring an explicit change) or fix the code. The just vv gate must pass.

About

Reference implementation of UOR-ADDR — chain-agnostic canonical content addressing for agent-produced content.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages