Replies: 2 comments 2 replies
-
What would be the value of this option though ? It seems to me that it could invalidate otherwise valid UCAN. One one hand it such option would let parser in dag-ucan know which representation it can parse into, but on the other hand I think it would probably still make sense for parser to validate that and if so I'm not sure there's really a benefit after all.
dag-ucan does not lower case URIs just values of |
Beta Was this translation helpful? Give feedback.
-
The way I understand it, originally the idea was to support a deterministic encoding, which would make implementations easier to implement & less error prone. Something else that I heard thrown around was a more compact encoding for UCANs, possibly based on CBOR. |
Beta Was this translation helpful? Give feedback.
-
Initial source: ucan-wg/ts-ucan#73 (comment)
I'm not yet sure if this is a good idea or not, but on first glance it seems harmless at worst and useful for libraries at best.
I would of course check if there's already something like this in the JWT spec that we could plug into, but we already have added additional fields (UCAN version) to the header. @Gozala's dag-ucan can represent two encodings of a UCAN: one that's directly stringified as normal, and a second that can be optionally round-trip re-serialized by a library.
With this flag set, we could specify a tighter serialization order. Libraries that care about this can opt-in by using the flag to detect that this is in a sorted format. Importantly: libraries that don't opt-in can continue to use these tokens as normal by handling them in the bit-for-bit fully stringified format internally.
It would look something like this:
(Encoded as an enum for future extension.)
I'm not sure this would interact with also downcasing, since some URIs may be case sensitive 🤔
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions