After several attempts with ActivityPub, I think ActivityPub needs more layers— and I’d love some discussion. For now, I nicknamed it Layered ActivityPub, or LAP, but it’s not meant to replace ActivityPub but rather act as its backend; Traditional AP interfaces can be implementable on top of it.
This is by no means an exact spec but rather a concept.
Note, I’m marking layers with a
in case we’ll decide to add/remove some, for future reference.
Layer 7.1a, Activity Transport Layer
Basic Terms—
- Peer, any involved group.
- Server, the peer receiving a request.
- Client, the peer signing and sending it.
This layer does not care about profiles, domains, accounts, anything. Its only concepts are Messages, which are opaque binary blobs plus some basic headers.
How it works is simple: you sign, using RFC 9421, all your requests. A request’s body, content type, and some additional headers, are a Message. To create a message, you POST it, including your public key (which is part of the message, and thus signed as well) in a header. The server will reply linking to where it stored the message.
To read a Message, one must send a signed GET request, which the recipient is free to refuse based on the key’s permissions (to its best knowledge).
It is also possible to request a server to DELETE a Message using the same contract.
Now, here’s the catch: these GETs and DELETEs are also messages. The server could store them, but it is not at all required to.
Keys can additionally request a server to DELETE themselves, thus removing all messages only signed by them if any. For messages signed by multiple client, a server is expected to DELETE on an &&
basis.
Discovery
Via webfinger.
Open questions
- How to globally reference a message in URI form?
- Should a
DELETE
reply with the deleted message, with where theDELETE
messages itself was stored if any, or? - Webfinger discovery specifics
Layer 7.2a, Activity Access Layer
At this layer, we use the previous one to define access to to Messages. Here we define the concept of an Actor, that is, an arbitrary URI of the scheme web+lap:aupro:resource
, where provider is an Authentication Protocol (Aupro).
An example Actor can be a Key: web+lap:client:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK
.
Servers implementing AAL MUST advertise their supported Aupros. Aupros specify who an Actor is and how they authenticate.
Message owners may POST messages giving other actors access and permissions to their message. Servers are required to maintain a log of such messages, perhaps requiring a client to sign all their permission-changing messages into one to combine them and thus save space. Permission messages are required to be at least as public as the effects of their changes.
An additional Aupro can be one of groups, allowing an Actor to give multiple other Actors permissions at once instead of listing them individually.
These groups will also be reusable by other protocols that further distribute messages say on explicit mentions, follows, etc.
Open Questions
- How to advertise AAL Aupro support?
- Can groups create/delete/manage permissions collectively instead of delegating this right to each individual member actor? See also FEP 541d (or whatever it’s called): Federated Democracy
I hope the picture I laid is clear enough:
- Layer 7.1a only cares about transporting Messages from Clients (Keys) to Servers, and does not care about their contents save for the header in which the public key is transferred.
- Layer 7.2a defines how Servers should manage permissions, Actors, the entities given said permissions, and Aupros, who define Actors.
- The built-in
client
Aupro defines Keys to he Actors. - The also-built-in
group
Aupro defines Groups (perhaps “collections”, “circles”? Idk) that delegate their permissions to all member Actors, and uses the same permission system to manage group members. - Potential Federated Democracy Aupro could define a complementary to Groups, where to exercise permissions, all a certain percentage of/etc member Actors must agree.
- The built-in
- Layer 7.3a will define Profiles, who will take part in negotiating how to send Messages from Profile A to Profile B, where profiles are assigned 0..1:1 to Actors.
- Layer 7.4a will define Follows, Followed, Blocks groups etc. and thus there we have the core of ActivityPub implemented.
Would love to hear your thoughts. Sorry this is so disorganized.
Cc @aschrijver @silverpill because I know you and to start a discussion.