---
name: uor-hasher
description: Serialization-invariant content addressing — the same logical content always gets the same UOR address, regardless of byte layout.
version: "1.0"
author: Maura Clark (Kessai / UOR Foundation)
---

# UOR Hasher — Serialization-Invariant Content Addressing

**Skill name:** uor-hasher
**Author:** Maura Clark (Kessai / UOR Foundation)
**Base URL:** `https://sever-trust.onrender.com`  <!-- templated at serve time — always fetch this file live from GET /hasher/skill.md -->
**Auth:** None.
**Version:** 1.0

---

## What this skill does

Gives any agent one guarantee: **the same logical content always gets the same
address, regardless of how its bytes are laid out.** Reorder JSON keys, change
whitespace, swap `1.0` for `1` — the UOR-ADDR is identical. Change the structure
at all — the address changes. A plain checksum can't do this; UOR-ADDR is
computed over a canonical, type-tagged, injective encoding of the *structure*.

Use it to deduplicate artifacts, detect tampering, or bind a name to content
that survives re-serialization.

---

## Endpoints

| Method | Path | Purpose |
|---|---|---|
| POST | `/hasher/address` | Compute the UOR-ADDR of any JSON value |
| POST | `/hasher/compare` | Check whether two values share one address |

### `POST /hasher/address`

Request:
```json
{ "content": { "b": 2, "a": 1 } }
```
Response:
```json
{
  "address": "uor:sha256:9f2c...",
  "digest": "9f2c...",
  "scheme": "UOR-ADDR/sha256",
  "serialization_invariant": true
}
```

### `POST /hasher/compare`

Request:
```json
{ "a": { "a": 1, "b": 2 }, "b": { "b": 2.0, "a": 1 } }
```
Response:
```json
{ "a_address": "uor:sha256:9f2c...", "b_address": "uor:sha256:9f2c...", "equal": true }
```

---

## Judge test (2 tasks, runnable from this file alone)

1. **Address:** POST any JSON object to `/hasher/address`; confirm you get a
   `uor:sha256:...` address.
2. **Invariance:** POST two structurally-equal but byte-different values to
   `/hasher/compare` (reorder keys, use `2` vs `2.0`); confirm `"equal": true`.
   Then change one value's structure and confirm `"equal": false`.

---

## Why this is different

UOR-ADDR is the same addressing scheme Sever uses to bind attestations to
artifacts. Addresses are stable across serialization, so they're safe to use as
persistent names — a checksum over raw bytes is not.
