basin-dev / basin-node

🎟️ a prototype open source network that incentives appropriate data sharing
Apache License 2.0
2 stars 0 forks source link

UCANs #47

Open sestinj opened 2 years ago

sestinj commented 2 years ago

Permissions are highly necessary even for our first use case, so need to figure out whether we are going to use UCANs now, even with them being in development, or if we'll go with our original plan. And whether the original plan can continue into UCAN work without too much unused work.

My first thought is that we want to not be developing our own UCAN library. It's unlikely that we'd have the resources to do better than the UCAN team, and if they haven't built it yet, then it probably isn't ready. I do believe that their library could be sufficient for now, but if it wasn't, and we needed to wait: I think we would continue with the model of permissions being stored on the producer's node. Assuming you can embed the same type of JSON document inside a UCAN, or similar, it should be code that can be reused. But first, let's play around with the UCAN library.

TyDunn commented 2 years ago

@sestinj maybe look into how https://litprotocol.com/ does access control too?

sestinj commented 1 year ago

Determined that the go-ucan library can actually do what we want, despite its being in heavy beta. This is exciting! Planning to go ahead tomorrow and try to fully integrate this in place of our current permissions.

sestinj commented 1 year ago

Key points to work on:

sestinj commented 1 year ago

Notable: It's very easy to make UCANs work for basic stuff, but there's a lot to do in order to make things more efficient and bridge the gap to full IAM language. For example: if you send a subscription request for multiple resources, multiple actions with different expirations, what is the fewest number of UCAN tokens you can create to satisfy all capabilities? And how should the subscriber store and retrieve these quickly depending on what actions they wish to take? Also: if you're going to revoke some permission, how can this be done without revoking all permissions attached to the same token? For this reason, should a separate token be made for every user+resource+action combination? This is sad because it neglects some of the power of UCANs. But maybe users should be able to just request a new UCAN. This causes less worry around losing them, and makes it more natural to revoke and send new ones.