Skip to content
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

[CAIP-196] UCANs with header entries #234

Open
chunningham opened this issue Jul 4, 2023 · 3 comments
Open

[CAIP-196] UCANs with header entries #234

chunningham opened this issue Jul 4, 2023 · 3 comments

Comments

@chunningham
Copy link

CAIP-196 defines a straightforward way of transforming back to UCAN serialisation which works almost all the time, however it does not account for header entries apart from alg and typ. While UCAN headers MUST contain these fields, they may also contain any other JWT-specified or unspecified headers (at least, there's nothing in the UCAN spec proscribing this). In principle it seems like they could not be stored in the fct field, as a UCAN can have any fcts and they can conflict. How could a non-alg or typ header field be stored in a CACAO? Should CACAO restrict the set of headers acceptable in UCANs (similar to requiring the UCAN be signed in canonical form in order to be verifiable)?

@oed
Copy link
Collaborator

oed commented Jul 5, 2023

My thought here is that there might be a need for a JWT varsig encoding that stores all additional headers in the varsig bytes. However, this wouldn't work for UCAN because there's a ucv field in the header that should go into the version field of the CACAO. This means that UCAN likely need a custom varsig encoding anyway.

@chunningham
Copy link
Author

makes sense, every header except ucv, alg and typ encoded together as dag-json or dag-cbor? An adjacent question about varsig, if we're encoding a self-describing/framed data structure, is it necessary to prefix with length?

@oed
Copy link
Collaborator

oed commented Jul 6, 2023

if we're encoding a self-describing/framed data structure, is it necessary to prefix with length

I don't think we need to add a length prefix if we can tell when the data ends in other ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants