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

Amplification accidentally attenuates time bounds #171

Open
andrewzhurov opened this issue Sep 7, 2023 · 3 comments
Open

Amplification accidentally attenuates time bounds #171

andrewzhurov opened this issue Sep 7, 2023 · 3 comments

Comments

@andrewzhurov
Copy link

andrewzhurov commented Sep 7, 2023

When two UCANs get bundled into an amplification UCAN, its time bounds must be within the intersection of the bundled UCAN time bounds, as per the spec.

The time bounds MUST also be equal to or contained inside the time bounds of the proof's time bounds.

This accidentally attenuates time bounds, could we avoid it?

E.g., by allowing time bounds to be derived from the proof chain, preserving original time bounds of each bundled capability.
The concept @Gozala introduced, being discussed here.

E.g., to have time bounds at the capability level, perhaps in Caveats.

E.g., to represent amplification as a collection of UCANs
Pro: preserves granularity of capabilities, allowing to manage them separately, e.g., revoking only some.
Con: these UCANs would need to be individually authorized. Something that attenuation as a bundled UCAN spares us from.
Con: and individually revoked later on, if one wishes.

@matheus23
Copy link
Member

Ideally one keeps the amount of capabilities per UCAN to a minimum: When delegating, you'd delegate multiple UCANs for separate capabilities. And when invoking a UCAN, you'd only collect them up in a single UCAN that refers to all the delegations in the prfs.
The reason we batch together capabilities in UCANs at all is mostly an optimization: We save space referring to DIDs and we only need to sign a thing "as a package" once.
If you didn't have to worry about these things, it'd have been nice to restrict UCANs to single capabilities. It makes attenuation verification logic somewhat easier, and makes the "best practice" of single-capability-per-ucan the only option.

Anyways, just chipping in with some of the things I remember from discussions in the past.

In theory multiple-capabilities-per-ucan allows you to make revocations "atomic". I.e. "revoke everything or revoke nothing", but I don't think that's a use case for anyone. Just noting.

@Gozala
Copy link
Contributor

Gozala commented Sep 26, 2023

Not taking sides here, but I do want to point out that we found a way in UCAN invocation spec to authorize multiple invocations using single cryptographic signature by signing set of CIDs been authorized. That is to say in theory we could do something similar with UCANs and authorize multiple delegations with one signature. That said it will still incur overhead of iss and aud field, which we can also pull into auth field, but then if we try to optimize exp away as well we kind of end up back where we started 🤷‍♂️

It is also worth mentioning that we have been discussing idea around dropping prf fields in #130 which would allow principal to provide a bag of UCANs and let the validator find a valid path, which allow forwarding capabilities without having to recreate delegation chains.

@expede
Copy link
Member

expede commented Oct 16, 2023

Responded here: ucan-wg/invocation#21 (comment)

As Irakli cited above, amplification has been removed from Delegation since we can now express those cases in Invocations

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

4 participants