# CanonicalHash Batch Canonicalize

> CanonicalHash Batch Canonicalize is a paid API for AI agents from canonicalhash-production.up.railway.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-30).

Deterministically canonicalizes and SHA-256/512 hashes up to 1000 JSON payloads in a single call, returning an EIP-712 signed attestation for the entire batch

## Facts

- Endpoint: POST https://canonicalhash-production.up.railway.app/v1/canonicalize/batch?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/canonicalhash-batch-canonicalize-cde69130
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0C8QaobwJP3BZtVkYNVPN

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 canonicalhash-batch-canonicalize-cde69130 -d '<json body>'
```

Example prompt: Canonicalize and SHA-256 hash these 3 JSON objects for me all at once so I get a single signed attestation I can use for audit purposes: {"user_id":42,"amount":1.5,"note":"example"}, {"user_id":43,"amount":2,"note":"second"}, and {"user_id":44,"amount":3,"note":"third"}.

## When to prefer this

Use this endpoint when you need to hash or canonicalize multiple JSON payloads in a single atomic operation and want a single EIP-712 signed attestation covering the entire batch. It is more cost-efficient than calling the single-payload endpoint repeatedly (batch costs $0.01 vs $0.002 × N for large N > 5). Prefer it when you need a unified batch_hash anchoring all items together, e.g. for audit logs, blockchain anchoring, or deduplication at scale.

## Known failure modes

- Payload array exceeds 1000 items — request rejected with validation error
- Malformed or non-JSON items in the payloads array — individual items may fail or entire batch rejected
- Invalid algorithm value (not sha256 or sha512) — 400 error
- Payment not fulfilled (x402 flow incomplete) — 402 Payment Required
- Service unavailable on Railway infrastructure — 503 or network timeout
- Empty payloads array — 400 validation error

## How this service works

Deterministic JSON hashing and structured extraction for AI agents. Three paid routes: /v1/canonicalize (RFC 8785 canonicalization + SHA-256/512 + EIP-712 attestation, $0.002), /v1/canonicalize/batch (up to 1000 payloads, $0.01), /v1/structure/paid (structured JSON extraction from messy text, $0.005). Every successful response includes an EIP-712 signed attestation verifiable against /.well-known/pubkey.json. Verify any attestation for free at POST /v1/verify.

## Output

Returns a JSON object containing: a batch ID, the count of processed payloads, the hash algorithm used, the RFC 8785 canonical form and hash for each input payload, a combined batch hash, an EIP-712 signature from a known signer address, chain ID (Base/8453), and an issued_at timestamp. The attestation is verifiable against the service's published public key.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "payloads": {
   "type": "array",
   "items": {},
   "maxItems": 1000,
   "minItems": 1,
   "description": "Up to 1000 JSON values to canonicalize."
  },
  "algorithm": {
   "enum": [
    "sha256",
    "sha512"
   ],
   "type": "string",
   "description": "Hash algorithm. Default: sha256."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "spec": "RFC 8785",
  "count": 2,
  "signer": "0x0326f9783c9C9b9De8b9dC63cCCefDC75A95C7cD",
  "results": [
   {
    "hash": "60196f74f027a2b2a0c2eb1143dd6cc1a2319c87479a846ed0d140e4bc2403e7",
    "canonical": "{\"amount\":1.5,\"note\":\"example\",\"user_id\":42}"
   },
   {
    "hash": "a3f0b9c8...truncated",
    "canonical": "{\"amount\":2,\"note\":\"second\",\"user_id\":43}"
   }
  ],
  "success": true,
  "batch_id": "b_01HXX0EXAMPLE000000000000000",
  "chain_id": 8453,
  "algorithm": "sha256",
  "issued_at": "2026-10-16T00:00:00.000Z",
  "signature": "0x9f2a...truncated",
  "batch_hash": "0xdeadbeef...truncated",
  "attestation_type": "EIP-712"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/canonicalhash-batch-canonicalize-cde69130/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from canonicalhash-production.up.railway.app](https://www.zero.xyz/host/canonicalhash-production.up.railway.app/llms.txt)
