-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement UCAN-IPLD-coherent serialization/deserialization #20
Comments
This is good timing, as I need these qualities to exist this very week. On it! |
@cdata we're also going to split out the canonicalization spec into its own spec, so there's no actual dependency on Out of curiosity, what's the use case for later this week? |
I'm adding multi-device support (including revocations) and need canonical IPLD representations for UCANs that are stored in our DAG. It's probably easiest for us to do it all in one go, but I'll take the allowance to constrain the scope under advisement 🙏 While I've got you: There seems to be some nuance (or perhaps ambiguity) between how Are a capability's |
Ah interesting! You don't want to store them as raw bytes for granular deduplication reasons?
Ah, indeed that could be clearer in the core spec 💯
|
The reasoning is that since |
Maybe I do? Tell me more about how raw bytes gets me more granularity!
Just to be especially clear: does arbitrarily shaped in this case mean 1) any type for key and/or value (but all keys have the same type and all values have the same type), or 2) it is a structure of any shape (e.g., keys are fields and each field may have a different type as its value)? |
Does this have the potential to foul-up the canonical representation? Don't all the things in |
To start: there's nothing wrong with encoding to IPLD. I'm just curious how much you need that level of structure. Instead of encoding it to IPLD, you could treat a UCAN as a blob of bytes, same as an image or a text document. You still get content addressing etc, but not the ability to re-encode the same UCAN to (e.g.) CBOR and back. Canonicalization is extremely rigid in key ordering, whitespace, and capitalization to make this possible. |
They have to follow
2! Any JSON object. |
Thank you, DAG-JSON was the clarification I was hoping for! Once we have canonical (de)serialization in place, it opens the door to storing UCANs in many different representations without thinking too hard about it. We will approach the opportunity with an experimental mindset and discover what works best 🧫🔬 |
IMO (feel free to disagree), following Postel's Law, UCAN libraries should be rigid in what they produce, and liberal in what they accept. To this end, it would be amazing if this library produced canonicalized UCANs compatible with ucan-ipld.
This gets us a few things:
We will still need to read in arbitrary JWTs, but the more canonicalized UCANs that exist, the better a world we live in 😉
The text was updated successfully, but these errors were encountered: