Skip to content

Instantly share code, notes, and snippets.

@oed
Last active July 27, 2023 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oed/24207b2de1fb63e05867f1cf45776df8 to your computer and use it in GitHub Desktop.
Save oed/24207b2de1fb63e05867f1cf45776df8 to your computer and use it in GitHub Desktop.

Exploreing the differences between how capabilities are represetned between UCAN and ReCap.

Comparison

UCAN ReCap
$RESOURSE Needs to be a URI Any String
$ABILITY One ability per resource ref Any nymber of abilities per resource ref
$EXTENSION Additional caveats for a specific resource Additional information, relevant for all resources
All resources Not possible In def property
OCAP delegation In prf property (not within capability) Possibly in ext property
namespace Defined as part of $ABILITY Defined, top level globally.

UCAN capability format

[
  {
    "with": $RESOURCE,
    "can": $ABILITY,
    "nb": $EXTENSION
  },
  ...
]

In a UCAN capabilites are stored as an array of objects as defined above. These are stored in the att property of the UCAN.

  • $RESOURSE - A string, needs to be a URI
  • $ABILITY - A string verb representing allowed actions
  • $EXTENSION - Any data, verifiers must know how to interpret or reject

ReCap capability format

{
   "def":[ $ABILITY, ... ],
   "tar":{
      $RESOURCE:[ $ABILITY, ... ],
      $RESOURCE:[ $ABILITY, ... ],
      $RESOURCE:[ $ABILITY, ... ]
   },
   "ext": $EXTENSION
}
  • $RESOURSE - Any string
  • $ABILITY - A string verb representing allowed actions
  • $EXTENSION - Any data, verifiers do what they want with it

Open questions

  • Does ReCap need global def?
  • Why does ReCap need namespace

Suggestions

  • Remove namespace from ReCap
  • Remove ext from ReCap
  • Add prf to ReCap for delegation in the same way UCAN does
  • Force ReCap to use URIs for $RESOURSE
  • Add nb field per $RESOURCE

This should make ReCap roughly equivalent to UCAN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment