This isn’t going to be perfect, and won’t take everything into account, but here’s an attempt to think through a scenario with UCANs.
I’m going to probably iterate on this a lot, and this is very draft quality thinking out loud, but might be worth sharing.
This is just to get the thoughts out. I will probably do a proper writeup later and think about more scenarios after I refine my thoughts a bit.
Groups
So starting with groups.
- Let’s imagine that groups are made out of “normal” ATProto accounts with extra functionality layered on top.
- That means that they have a DID, an ATProto repo, and a signing key.
- Groups also have an internal member list.
- I could imagine this being public or private. If it’s public, maybe it’s saved in in the ATProto repo.
- Access to manage the group is controlled with UCANs.
- When the group is intiially created, a UCAN is signed by the group’s private key granting full access to the group for the account that created it.
- That UCAN can be used to invoke XRPC endpoints for adding or removing members from the group.
- The admin can also delegate subsets of XRPC endpoints, potentially with restricted parameters, specified by the UCAN policy.
- For example, if Bob creates a group, he could delegate permission to add members to the group to Alice, without allowing her to remove members.
- Note: Since the group also has normal ATProto repo, you could possibly delegate permissions to create Bluesky posts under the group’s account or things like that.
Communities
Communities could be things like Discord guilds, public forums, etc.
- Let’s say the community is also a “normal” ATProto account.
- It works basically similar to a group where it delegates admin access to the creator when it is created.
- We need to think about read access, but to scope the conversation lets think about write access.
- The idea is that we want users to be able to create certain kinds of content in the community repo, possibly with certain restrictions.
- Lets say that we hypothetically want an
admingroup that can create, delete, and edit all posts, and ausergroup that can create posts and edit their own posts. - We can create those two groups, and then delegate the permissions that the community grants each group to the group account.
- Now we can add whatever members we want to those
adminandusergroups. - But becuase of the way UCAN works, that doesn’t automatically grant the members of the group any capability to take action inside the community.
Group Community Delegation
- So if Charlie is in the
usergroup, and he wants to post in the community, he has to make an XRPC request to the group, asking for a UCAN that delgates the permission the group to the community, to Charlie.- The group will check it’s members list, make sure that charlie is in there, and if it he is, then it will create and sign a new UCAN for charlie delegating the access it has to the community space.
- If the group is granted any new permissions in the space, then Charlie will have to request a new UCAN that includes the newly granted permissions.