{"uid":"cap_xTRWzwhMGQhXkZV_TwimY","slug":"canonical-json-and-digest-af1a2ec2","name":"Canonical JSON and Digest","description":"Canonical JSON and its digest — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/json-canonical?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"json":{}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"json-canonical","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.002,"receipt_id":"g402-<16hex>"},"generated_at":"<iso8601>"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_nyeeRGxg8zGexhnw6Mk9y","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a JSON object into its canonical (deterministic) form and returns its digest, with a signed payment receipt","exampleAgentPrompt":"Can you canonicalize this JSON object and give me its digest? Here's the payload: {\"b\":2,\"a\":1,\"c\":{\"z\":26,\"y\":25}}","exampleUseCases":[{"title":"Deterministic hash before signing","prompt":"I need to canonicalize this JSON before I sign it — can you convert {\"amount\":100,\"currency\":\"USD\",\"recipient\":\"alice\"} into canonical form and give me the digest?"},{"title":"Verifying JSON integrity across systems","prompt":"Two systems gave me slightly different JSON representations of the same data object. Can you canonicalize {\"id\":\"abc123\",\"status\":\"active\",\"score\":9.5} and return its digest so I can compare them deterministically?"},{"title":"Preparing JSON for blockchain submission","prompt":"Before I submit this payload to the smart contract, I need it in canonical JSON form with a digest — please process {\"txType\":\"transfer\",\"from\":\"0xAAA\",\"to\":\"0xBBB\",\"value\":500} for me."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T18:55:55.696Z","isFirstParty":false,"canonicalSlug":"canonical-json-and-digest-af1a2ec2"}