logoalt Hacker News

TSON – A JSON superset with immutable, hash-pinned schemas

34 pointsby andrewjneumanntoday at 2:03 PM27 commentsview on HN

Comments

al_be_backtoday at 4:13 PM

>> Ordering, consensus, and mutability policy are application concerns outside this series. [1]

Of course, immutable means as-is, but since you're not dealing with ordering etc (that's pretty big), I might as well use existing tech (JSON with a schema) and a policy (simple/naive: hash and compare lowercased data).

[1] From their spec: 2.2.1 Identity and Content Addressing - https://tson.io/2026/32/tson-part1-data/#

kbolinotoday at 3:28 PM

Using the query string to carry the sha256 hash but then saying the "hash parameter is verification metadata, not identity" doesn't make much sense. The ?query part of a URL is supposed to be sent to the server. If you want to add client-side (meta)data, you should use the #fragment part of a URL. See RFC 3986, sections 3.4 and 3.5: https://datatracker.ietf.org/doc/html/rfc3986#section-3.4

show 1 reply
Retr0idtoday at 3:24 PM

What's the justification for being a superset of JSON? Being incompatible with most existing JSON tooling and interfaces is a big disadvantage, so there better be a tangible upside.

Also, I see mention of hashing, but no mention of canonicalization. Does fiddling with a schema's whitespace change its hash?

show 1 reply
lokartoday at 3:32 PM

Seem to different from JSON to be an easy drop in, while still having the problems of json. I’d rather use something further away like cue.

show 1 reply
minrawstoday at 2:55 PM

you can just add schema to json why add new syntax now, especially for json I dont think it makes sense I honestly believe the war is over there won't be a xml to json moment unless we move to a new platform other than browsers which seem rather unlikely, json honestly is fine for something that's somewhat human readable...

hmokiguesstoday at 2:55 PM

I think I'm gonna go back to XSLT

show 2 replies
robtotoday at 2:41 PM

Seems like it draws a lot of inspiration from EDN. Tagged literals, commas-as-whitespace (and optional), and anything-can-be-a-key are features I sorely miss when I have to go back to JSON.

Don't know how I feel about optional quotes around strings, that seems like a mistake. And having an immutable set literal would be nice as well.

show 1 reply
azatomtoday at 2:29 PM

when will be xson invented, with support of xpathson and xsdson but strictly leaving out other xml features.. for future improvement?

biggestloutoday at 4:10 PM

Sorry, but this tool is just never going to succeed being written in Java.

myshapeprotocoltoday at 2:20 PM

Hash-pinned schemas are definitely the right direction for ensuring verifiable provenance across distributed systems. Great concept!

show 1 reply
esafaktoday at 2:48 PM

If the author is here, the Github repo in https://litterat.io/ should be https://github.com/litterat

flanked-evergltoday at 2:26 PM

why can't you use hash pinned schemas with existing json? Why do you need a new format for it?

show 1 reply
tonygtoday at 2:49 PM

Absolute slop. Interesting that the end result, the place where Claude ended up, is similar to a (human-authored, windmill-tilting) project of mine, https://preserves.dev/ . Though with a much prettier website and far, far, far more words.

show 1 reply
ltbarcly3today at 3:11 PM

great another shitty JSON variant. now I'll have 9 different json-like libraries in every project that I can't get rid of.

thomasnowheretoday at 3:27 PM

[dead]