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

Under-specified format for revocation structure #112

Closed
Tracked by #132
cdata opened this issue Sep 30, 2022 · 4 comments
Closed
Tracked by #132

Under-specified format for revocation structure #112

cdata opened this issue Sep 30, 2022 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@cdata
Copy link
Member

cdata commented Sep 30, 2022

Regarding the section on revocation: https://github.com/ucan-wg/spec#66-revocation

A structure is prescribed to record a revocation:

{
  "iss": did,
  "revoke": ucanCid,
  "challenge": sign(did.privateKey, `REVOKE:${ucanCid}`)
}

The types of the fields in this structure are not specified. It seems reasonable to assume that did is a DID string.

But, what is the form of ucanCid? A base64-encoded CID string? Or some other form?

And what is the form of the challenge?

@matheus23
Copy link
Member

Agreed.

Given ucanCid is re-used in a string splice & it's all JSON, let's assume ucanCid is base-something encoded that fits into ASCII, so either base32, base64, base58, base16? (Or should we rather standardize on what it is, so basically require base32 as the standard for now?)

The result of sign should probably be encoded as base64url, similar to how signatures in JWTs are encoded.

Also, did.privateKey seems to indicate that did is not a string, which may be confusing. We could rework this to say didPrivateKey or privateKeyFor(did).

@expede
Copy link
Member

expede commented Oct 22, 2022

But, what is the form of ucanCid? A base64-encoded CID string?

Yeah, fair.

CIDs

I don't think that we can enforce a specific encoding of the CID without forcing a specific encoding of CIDs throughout the entire system. For purposes of caching revocations, the CID should be a normalized hash (likely to binary), rather than using the specifically text-encoded hash. This is the strategy in IPFS for caching, too. We could standardize on a specific hash function, since (e.g.) SHA2 and SHA3 will give a different hash for the same content.

Signatures

We probably need to add the algorithm type to the signature, especially now that there's systems that use e.g. EIP-191.

DIDs

The DID is a DID string, which is described in the relevant DID spec

@expede expede added the bug Something isn't working label Oct 22, 2022
@expede
Copy link
Member

expede commented Nov 27, 2022

Let's fix this on 0.10

@expede expede mentioned this issue Nov 27, 2022
15 tasks
@expede expede added this to the v0.10 milestone Nov 27, 2022
@expede expede removed the 📋 v0.10 label Nov 27, 2022
@expede
Copy link
Member

expede commented Jul 12, 2023

Closed by #132

@expede expede closed this as completed Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants