# Canonical JSON and Digest

> Canonical JSON and Digest is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-01).

Converts a JSON object into its canonical (deterministic) form and returns its digest, with a signed payment receipt

## Facts

- Endpoint: POST https://twin.unykorn.org/json-canonical?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/canonical-json-and-digest-af1a2ec2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xTRWzwhMGQhXkZV_TwimY

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability canonical-json-and-digest-af1a2ec2 -d '<json body>'
```

Example prompt: Can you canonicalize this JSON object and give me its digest? Here's the payload: {"b":2,"a":1,"c":{"z":26,"y":25}}

## When to prefer this

Choose this endpoint when you need a deterministic, canonical representation of a JSON object (e.g., for signing, hashing, or cross-system comparison) and want a signed payment receipt as proof of processing. It is particularly useful in blockchain, smart contract, or cryptographic workflows where JSON key ordering and formatting must be standardized before signing or committing data.

## Known failure modes

- Invalid or malformed JSON input returns an error
- Missing 'params.json' field causes bad request
- Payment failure or insufficient funds prevents call
- Network timeout on the operator endpoint
- Extremely large JSON objects may be rejected or time out

## How this service works

Canonical JSON and its digest — Genesis402 / UnyKorn Operator Network

## Output

Returns the canonical (deterministic, normalized) form of the submitted JSON object along with its digest, a confirmation flag, the response type label 'json-canonical', a blockchain transaction hash, a USD amount, and a unique receipt ID with an ISO 8601 timestamp.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "json": {}
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "json-canonical",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.002,
   "receipt_id": "g402-<16hex>"
  },
  "generated_at": "<iso8601>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/canonical-json-and-digest-af1a2ec2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
