{"uid":"cap_Omtr94LWatrWI0CBNV14r","slug":"json-canonicalization-rfc-8785-jcs-eab52cc0","name":"JSON Canonicalization (RFC 8785 JCS)","description":"JSON canonicalization — canonicalize structured data with RFC 8785 JCS; return canonical JSON text, UTF-8 byte length and SHA-256 hash for integrity checks, signature preparation and deduplication. Uses binary64 rounding and strict Unicode/duplicate-key checks; rejects negative zero, overflow and nonzero underflow.","url":"https://data-tools.use.x402atlas.com/json-canonicalize?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":null,"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KtuHp5P9T4rUVvvJhThc6","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Canonicalizes a JSON document using RFC 8785 JCS and returns the canonical text, its UTF-8 byte length, and a SHA-256 hash for integrity verification, signature preparation, and deduplication.","exampleAgentPrompt":"Canonicalize this JSON payload using RFC 8785 JCS and give me the canonical text, its UTF-8 byte length, and the SHA-256 hash so I can use it for a digital signature: {\"amount\":100,\"currency\":\"USD\",\"recipient\":\"alice\"}","exampleUseCases":[{"title":"Digital signature payload preparation","prompt":"I need to sign a JSON invoice before sending it — can you canonicalize this JSON with RFC 8785 JCS and give me the SHA-256 hash I should sign? Here's the payload: {\"invoiceId\":\"INV-2024-001\",\"amount\":250.00,\"vendor\":\"Acme Corp\",\"dueDate\":\"2024-12-31\"}"},{"title":"Deduplication of JSON records","prompt":"I'm ingesting JSON records from multiple sources and need to deduplicate them — can you canonicalize each of these JSON objects and give me their SHA-256 hashes so I can detect exact duplicates? Start with: {\"orderId\":\"ORD-99\",\"sku\":\"ABC123\",\"qty\":5}"},{"title":"Integrity check before storage","prompt":"Before I store this configuration JSON in the database, I want to record its canonical form and SHA-256 fingerprint for later integrity auditing — please canonicalize it using JCS: {\"env\":\"production\",\"maxRetries\":3,\"timeout\":30,\"debug\":false}"}],"resultDescription":"Returns the RFC 8785 JCS canonical JSON text (deterministically ordered, whitespace-stripped), the UTF-8 byte length of that canonical representation, and a SHA-256 hash digest of the canonical bytes. Rejects inputs containing negative zero, numeric overflow, nonzero underflow, or duplicate object keys.","failureModes":["Input contains negative zero (-0) — rejected per RFC 8785 strict mode","Input contains a floating-point overflow or nonzero underflow value — rejected","Input JSON has duplicate keys — rejected with an error","Malformed or syntactically invalid JSON input — parse error returned","Input is not a JSON object or array (bare primitives) — may be rejected depending on service constraints"],"whenToPreferThis":"Choose this endpoint when you need a standards-compliant RFC 8785 JCS canonical form of a JSON document — especially for cryptographic signing workflows, integrity fingerprinting, or content-addressed deduplication where byte-exact determinism is required. Prefer it over ad-hoc JSON serializers that do not guarantee key ordering or binary64 float rounding compliance.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-17T18:30:35.521Z","isFirstParty":false,"canonicalSlug":"json-canonicalization-rfc-8785-jcs-eab52cc0"}