silverpill:
-
silverpill:
Several solutions were proposed -
embeddedObjectsThis sounds a lot like JSON-LD
@included:{ "@context": "https://www.w3.org/ns/activitystreams", "id": "https://activity.example/", "actor": "https://actor.example/", "type": "Announce", "object": "https://object.example/", "@included": [ { "id": "https://actor.example/", "name": "Someone", "type": "Person" }, { "id": "https://object.example/", "type": "Article", "name": "Top 10 AS2 examples -- number 3 will surprise you!" } ]}If you ignore all the JSON-LD stuff, the "plain JSON" document is just this:
{ "id": "https://activity.example/", "actor": "https://actor.example/", "type": "Announce", "object": "https://object.example/",}If you flatten the first example or convert it to N-Quads, the
@includedblock goes away. The@includedblock is just a framing tool so that the "plain JSON" can match a specific schema (say one whereactorandobjectare required to be JSON strings). It's broadly similar to JSON:API's concept of "included", as JSON-LD 1.1 points out... except it keys off of@idonly (instead of bothtypeandid).A canonicalization scheme could define that included blocks are stripped before hashing and signing, and that therefore the information included in an included block is not trustworthy on its own without its own signatures. I guess you could profile JCS if you wanted to depend on the JSON serialization, or profile RDFC if you wanted to depend on the N-Quads dataset (minus the included statements).
silverpill:Claire:
how would you “make sure” the object is indeed a <
https://www.w3.org/ns/activitystreams#object> while keeping the object’s JSON representation intact? Off the top of my head, I see no way to do that safely.If I understand the question correctly, this problem also arises in client-to-server context. An object published by a client can be parsed differently by the originating and receiving servers due to JSON-LD/JSON differences. This could cause security issues, and I have lately come to the conclusion that JSON-LD and JSON cannot coexist in the same network.
The way you "make sure" that
objectis specifically is via one of the following mechanisms:- JSON-LD
@contextexpansion. A JSON-LD processor loads the declared contexts (modulo other document loader safety concerns) and normalizes everything to its full IRI reference. - IANA media type signaled via HTTP
Content-Typeheader isapplication/activity+jsonor equivalent. Per definition, that media type includes the semantics that theobjectkey is defined as . For JSON-LD compatibility, this is also achieved via "context injection", i.e. when you encounter this specific IANA media type, you can convert it to anapplication/ld+jsondocument by tacking on"https://www.w3.org/ns/activitystreams"as the end of the@contextarray in case it is missing.
The latter is the closed-world / centralized variant of the former. They clearly already co-exist in the same network. The issue arises when you use terms that aren't defined by
application/activity+jsonor its equivalent JSON-LD@context, but this isn't JSON-LD's fault -- the issue's real cause is that people can and will disagree on what terms mean, as with any other matters of language. You can't assume everyone always agrees with everything you do or say 100%. The point of having keys and terms be expandable to IRI references is that http(s): IRIs conveniently include an authority component, so you can workaround the lack of authority in the data model and disambiguate two different definitions of the same term. Having a way to detect that there is a conflict does not create the conflict; the conflict is still there even if you don't have a way of detecting it.tl;dr,
Claire:how one is expected to handle proofs of embedded objects
depends on canonicalization. Embedding an object from one document into another document should be done with the recognition that documents and objects are not the same thing, and that embedded information about an object is necessarily scoped to the current document in which that information is presented.
For example:
GET /foo HTTP/1.1Host: domain.exampleAccept: application/activity+jsonHTTP/1.1 200 OKContent-Type: application/activity+json{ "id": "https://domain.example/foo", "type": "Activity", "object": { "id": "https://domain.example/bar", "type": "Object" }}Here, the statement that /bar is an Object is a statement being made within /foo. You can GET /bar and obtain different information (e.g. that /bar is a Tombstone). That doesn't make the statement in /foo incorrect; it could be that statements in /foo and statements in /bar were made at different times.
When signing or verifying objects, it's crucial to consider what you're signing. As the author of /foo I can sign my own statement about /bar within /foo, and this is different than a signed statement about /bar from the author of /bar within /bar. If you don't distinguish or qualify statements by their source[^1], you will get confused.
[^1]: This is what quads are supposed to be in RDF -- they contextualize triples by the graph they came from. But you don't need to use quads, you just need to use some kind of contextualizing thing, like an HTTP resource; the statements in that resource can still be modeled as triples, while you reason about them as quads in order to explicitly consider who said something, or when they said it, or whether or how much you trust that statement.
I can't get too much into this further, since anything else depends heavily on what your trust model is. But for the purposes of signatures, you have to look to the current document (and possibly infer additional information from HTTP headers).
- JSON-LD
-
In the future, would it be possible to send activities using only Object Integrity Proofs and not rely on HTTP Signatures? Or are Object Integrity Proofs just a complement to HTTP Signatures?
hongminhee:In the future, would it be possible to send activities using only Object Integrity Proofs and not rely on HTTP Signatures? Or are Object Integrity Proofs just a complement to HTTP Signatures?
In theory, yes, but I'd agree with @bumblefudge that HTTP Signatures are here to stay. However, there are other uses for integrity proofs:
- Forwarding from inbox
- Efficient
Announcewith signed embedded object (recipients don't need to fetch it from origin) - Federated groups (for example, FEP-8b32 is used in Conversation Containers).
- Data portability.
-
Hello!
This is a discussion thread for the proposed FEP-8b32: Object Integrity Proofs.Please use this thread to discuss the proposed FEP and any potential problemsor improvements that can be addressed.
Summary
This proposal describes how ActivityPub servers and clients could create self-authenticating activities and objects.
HTTP signatures are often used for authentication during server-to-server interactions. However, this ties authentication to activity delivery, and limits the flexibility of the protocol.
Integrity proofs are sets of attributes that represent digital signatures and parameters required to verify them. These proofs can be added to any activity or object, allowing recipients to verify the identity of the actor and integrity of the data. That decouples authentication from the transport, and enables various protocol improvements such as activity relaying, embedded objects and client-side signing.
FEP-8b32 is being updated as well. I removed the controversial recommendation to re-define
object(will add it in a separate PR later), and added a paragraph about activities:The controller of the verification method MUST match the actor of activity, or be associated with that actor.
In FEP-ef61 proofs are signed by identity, not by actor, so it is not as simple as
controller == actor.Objects are even more complicated, so I'll leave them out for now.
-
I am trying to verify the proof on this object: https://bots.grilledcheese.social/ap/post/17u8fu93k5tq51kg4g15. It has
@context, but it doesn't match the top-level@context.eddsa-jcs-2022 has the following requirement:
If
proofOptions.@contextexists:Check that thesecuredDocument.@contextstarts with all values contained in theproofOptions.@contextin the same order. Otherwise, set verified tofalseand skip to the last step.Your object has
["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"]and its proof has["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v2"].(my implementation doesn't actually check the order, it simply compares contexts)
I see, so
"https://w3id.org/security/data-integrity/v2"should replace"https://w3id.org/security/v1"in the standard context block at the top? We should probably call that out explicitly in the next revision of the FEP. (I think most servers write the boilerplate template once and then ignore it.) -
Did you mean
verificationMethod?controlleris not listed among possible properties of an integrity proof: https://w3c.github.io/vc-data-integrity/#proofsWell no. I meant controller. My understanding of the mechanism is:
Signed Document -> (base document, proof, verificationMethod)verificationMethod-> (via lookup of the URI)(key material, controller)- If valid, the claim is "
controllerstatesbase documentis valid".
As it only makes sense for a
controllerto claim their own documents are valid, I would expectcontroller == actor.In the Fediverse context, I would expect the ActivityPub Actor to be the controller (in the sense of Data Integrity). On a side note: I somewhat prefer the term controller over actor, as actor has a different meaning in programming. Controller pretty much captures what the Actor does in AP. It asserts that the entity behind it controls the inbox, outbox, and corresponding keys.
-
Made several small modifications to the proposal and added a link to implementation (it's my own project Mitra):
Thanks, for this FEP being adopted.
Suggestions
[] Include test cases of activities that should be valid using various algorithm pairings. This would at least help me, if I wanted to implement this. [] Specify behavior if Authentication is missing, e.g.
A server MAY require Authentication. In this case a request lacking authentication MUST be answered with HTTP 401.
[] Discuss behavior for AP S2S 7.1.2 Forwarding from Inbox, e.g.
A forwarded activity MAY be used without further verification, i.e. no GET is necessary from the original host.
[] Discuss public key caching. This probably goes beyond the scope of this FEP. So, one might one want add something like This section is non-normative. to it.
-
Hello!
This is a discussion thread for the proposed FEP-8b32: Object Integrity Proofs.Please use this thread to discuss the proposed FEP and any potential problemsor improvements that can be addressed.
Summary
This proposal describes how ActivityPub servers and clients could create self-authenticating activities and objects.
HTTP signatures are often used for authentication during server-to-server interactions. However, this ties authentication to activity delivery, and limits the flexibility of the protocol.
Integrity proofs are sets of attributes that represent digital signatures and parameters required to verify them. These proofs can be added to any activity or object, allowing recipients to verify the identity of the actor and integrity of the data. That decouples authentication from the transport, and enables various protocol improvements such as activity relaying, embedded objects and client-side signing.
Proof generation and verification algorithms in
eddsa-jcs-2022are changing:https://github.com/w3c/vc-di-eddsa/pull/79
To ensure smooth transition, I propose the following plan:
- Implement new proof verification algorithm (section 3.3.2), specifically step 4.
- Give everyone some time to upgrade (a couple of months)
- Implement new proof generation algorithm (section 3.3.1), specifically step 6 where
@contextis being copied from the document to the proof.
-
After updating “json-eddsa-2022” to “jcs-eddsa-2022” my tests pass with the new feature. I just realized Gherkin might not be as well-known as I expected. Have you integrated something like cucumber-rs into Mitra to run this test? The essential point for me to use Gherkin is that the feature files can be shared across implementations. So in an ideal world, everybody runs the same tests [1]. This will lead to greater interoperability, simply by eliminating one of the points where applications c…I’ve never used Gherkin before, but I was able to read and edit your FEP-8b32 feature file without reading any docs. The syntax is intuitive and that makes Gherkin a useful tool for spec writers. My implementation tests for FEP-8b32/jcs-eddsa-2022 are not based on it though, as I try to avoid adding new dependencies. I simply copied inputs and outputs from the feature file.
-
robey:
But I had at least one successful verification!
Your implementation of FEP-521a appears to be correct (I was able to fetch lobsters actor you mentioned in readme; can't verify FEP-8b32 because my Follow activity is being rejected with
robey:FST_ERR_CTP_INVALID_MEDIA_TYPE).In my testing, base58 was awkward to implement and seemed to provide no meaningful benefit over base64 at these data sizes. I don’t want to pile on, but I agree with the others that an updated spec should recommend base64 and require both encodings to be understood.
The upstream specification needs to be changed first - base58 is required by
eddsa-jcs-2022cryptosuite (section 3.3.1).I am in favor of base58, anyway, because it is easier to read and because it is already used in many places - integrity proofs, multikeys, did:key, etc.
robey:Speaking of which, I noticed that the long-suffering HTTP signature RFC was finished. Is there a FEP describing how to use them (and especially: migrate to them)?
Not yet, but there's a detailed description in FEDERATION.md of tootik project: https://github.com/dimkr/tootik/blob/v0.20.6/FEDERATION.md#http-signatures
silverpill:Your implementation of FEP-521a appears to be correct (I was able to fetch lobsters actor you mentioned in readme; can’t verify FEP-8b32 because my Follow activity is being rejected with
FST_ERR_CTP_INVALID_MEDIA_TYPE).Thanks for checking it out! It looks like the follow requests were getting dropped by fastify because the content-type was “application/ld+json” instead of json or activity+json. I’ve just added that to the list of accepted content types.
-
Hello!
This is a discussion thread for the proposed FEP-8b32: Object Integrity Proofs.Please use this thread to discuss the proposed FEP and any potential problemsor improvements that can be addressed.
Summary
This proposal describes how ActivityPub servers and clients could create self-authenticating activities and objects.
HTTP signatures are often used for authentication during server-to-server interactions. However, this ties authentication to activity delivery, and limits the flexibility of the protocol.
Integrity proofs are sets of attributes that represent digital signatures and parameters required to verify them. These proofs can be added to any activity or object, allowing recipients to verify the identity of the actor and integrity of the data. That decouples authentication from the transport, and enables various protocol improvements such as activity relaying, embedded objects and client-side signing.
@robey Did you change the
proof.@context? I saw an activity from your test actor few days ago, and it still had wrong context. -
@helge Are you planning to move this file to fediverse-features? I want to add test vectors for FEP-8b32, but I am not sure how to do it. Gherkin syntax looks nice. It is human readable, and it is definitely better than plain JSON files. However, I think it would be better to put test vectors alongside the FEP, and not in a separate repo.My current plan is to locate all my Gherkin features in that repository. This includes both FEP and ones that test other aspects of the Fediverse. I have no idea if different repositories for features and docs are a good split. As having a features repository already means that I split code and tests, it doesn’t seem like a big deal to me. I probably won’t have a firm opinion on what a good structure looks like in the next few weeks.
-
helge:
I could suggest a few fixes for the situation now, e.g. versioning the AS
@context. The experience is just not there to know if what I suggest is good.Update:https://www.w3.org/wiki/Activity_Streams/Primer/Context_document_versioninghttps://github.com/w3c/activitystreams/issues/560#issuecomment-1908602094
Good-faith question because I too have mixed feelings about JSON-LD and its tooling/ecosystem support, but would recommending or requiring an RDFC step in signing FEPs (current or future) help the "bad LD" issue, or just further tax/annoy/bully the devs who don't use LD for anything? I was under the impression that RDFC is a lot more feature-complete and street-ready than it was a year ago, but that is more anecdotal/hearsay than based on personal experience.
bumblefudge:Good-faith question because I too have mixed feelings about JSON-LD and its tooling/ecosystem support, but would recommending or requiring an RDFC step in signing FEPs (current or future) help the “bad LD” issue,
My opinion is: No, it would not.
The entire JsonLD - RDF - LinkedData space has a list of known problems (In the sense, if you payed me a lot of money, I could write one down with examples). Replacing JCS with RDFC just makes some problems on the list better, and some other problems on the list worse.
-
Hello!
This is a discussion thread for the proposed FEP-8b32: Object Integrity Proofs.Please use this thread to discuss the proposed FEP and any potential problemsor improvements that can be addressed.
Summary
This proposal describes how ActivityPub servers and clients could create self-authenticating activities and objects.
HTTP signatures are often used for authentication during server-to-server interactions. However, this ties authentication to activity delivery, and limits the flexibility of the protocol.
Integrity proofs are sets of attributes that represent digital signatures and parameters required to verify them. These proofs can be added to any activity or object, allowing recipients to verify the identity of the actor and integrity of the data. That decouples authentication from the transport, and enables various protocol improvements such as activity relaying, embedded objects and client-side signing.
I opened a pull request that adds "Nested objects" section to this proposal: https://codeberg.org/fediverse/fep/pulls/287/files
-
Proof generation and verification algorithms in
eddsa-jcs-2022are changing:https://github.com/w3c/vc-di-eddsa/pull/79
To ensure smooth transition, I propose the following plan:
- Implement new proof verification algorithm (section 3.3.2), specifically step 4.
- Give everyone some time to upgrade (a couple of months)
- Implement new proof generation algorithm (section 3.3.1), specifically step 6 where
@contextis being copied from the document to the proof.
JCS context injection PR has been merged, test vectors have been updated as well. I will update my implementation in two stages, according to the plan:
silverpill:To ensure smooth transition, I propose the following plan:
- Implement new proof verification algorithm (section 3.3.2), specifically step 4.
- Give everyone some time to upgrade (a couple of months)
- Implement new proof generation algorithm (section 3.3.1), specifically step 6 where
@contextis being copied from the document to the proof.
Two remaining unresolved issues are context injection when object doesn't have
@contextand proving integrity of nested objects. -
Hello!
This is a discussion thread for the proposed FEP-8b32: Object Integrity Proofs.Please use this thread to discuss the proposed FEP and any potential problemsor improvements that can be addressed.
Summary
This proposal describes how ActivityPub servers and clients could create self-authenticating activities and objects.
HTTP signatures are often used for authentication during server-to-server interactions. However, this ties authentication to activity delivery, and limits the flexibility of the protocol.
Integrity proofs are sets of attributes that represent digital signatures and parameters required to verify them. These proofs can be added to any activity or object, allowing recipients to verify the identity of the actor and integrity of the data. That decouples authentication from the transport, and enables various protocol improvements such as activity relaying, embedded objects and client-side signing.
Removing warnings about nested objects from the FEP: https://codeberg.org/fediverse/fep/pulls/396.
Also, there was a sentence saying that
proof.verificationMethodcan be a DID. I think this is not correct because the fragment identifier of the verification method should be included as well, and that makes it a DID URL. -
As I haven't given up my hope of introducing Feature tests, this proposal with publicKeyMultibase would like shown in https://codeberg.org/helge/vc-di-eddsa-python/src/branch/main/features/fep-8b32.feature#L47 .
Note, I haven't updated my vc-di-eddsa implementation to the latest version of the draft yet.
@helge Are you planning to move this file to fediverse-features? I want to add test vectors for FEP-8b32, but I am not sure how to do it. Gherkin syntax looks nice. It is human readable, and it is definitely better than plain JSON files. However, I think it would be better to put test vectors alongside the FEP, and not in a separate repo. -
I'm having trouble reproducing the test vector for FEP-8b32. (Is it okay to ask this here?) Is the private key
z3u2en7t5LR2WtQH5PfFqMqwVHBeXouLzo6haApm8XHqvjxqin the test vector equivalent to the following JWK?{ "kty": "OKP", "crv": "Ed25519", "d": "yW756hDF5BTEcXI6_53nLDX6W3D66X6IMuysfS4rjtY", "x": "sA2Nk45_dz1RVlqtNqYj9TRPf10ZYPnPPo4SYg6igQ8"}I'm not familiar with JWKs, but according to RFC-8037 the "d" parameter is a base64url encoded private key. I tried to decode it, and the value I get is different from the multibase-encoded one.
-
Hello!
This is a discussion thread for the proposed FEP-8b32: Object Integrity Proofs.Please use this thread to discuss the proposed FEP and any potential problemsor improvements that can be addressed.
Summary
This proposal describes how ActivityPub servers and clients could create self-authenticating activities and objects.
HTTP signatures are often used for authentication during server-to-server interactions. However, this ties authentication to activity delivery, and limits the flexibility of the protocol.
Integrity proofs are sets of attributes that represent digital signatures and parameters required to verify them. These proofs can be added to any activity or object, allowing recipients to verify the identity of the actor and integrity of the data. That decouples authentication from the transport, and enables various protocol improvements such as activity relaying, embedded objects and client-side signing.
jcs-eddsa-2022 description was fixed a couple of days ago (PR). I proceeded with implementation of the algorithm and incorporated it into my software (here is the signing function). However, I'm not sure how to distribute EdDSA keys. The most logical place for them seems to be
publicKeyproperty, which can take the form of array where the first item represents RSA key and the second item represents EdDSA key. But servers may expectpublicKeyto be an object and fail to process an array, making gradual upgrade impossible. So we need to either use some new property (authentication?) or keep RSA as the recommended signature algorithm. -
Hello!
This is a discussion thread for the proposed FEP-8b32: Object Integrity Proofs.Please use this thread to discuss the proposed FEP and any potential problemsor improvements that can be addressed.
Summary
This proposal describes how ActivityPub servers and clients could create self-authenticating activities and objects.
HTTP signatures are often used for authentication during server-to-server interactions. However, this ties authentication to activity delivery, and limits the flexibility of the protocol.
Integrity proofs are sets of attributes that represent digital signatures and parameters required to verify them. These proofs can be added to any activity or object, allowing recipients to verify the identity of the actor and integrity of the data. That decouples authentication from the transport, and enables various protocol improvements such as activity relaying, embedded objects and client-side signing.
VC workgroup changed the name of cryptosuite from
jcs-eddsa-2022toeddsa-jcs-2022. The FEP has been updated accordingly. -
jcs-eddsa-2022 description was fixed a couple of days ago (PR). I proceeded with implementation of the algorithm and incorporated it into my software (here is the signing function). However, I'm not sure how to distribute EdDSA keys. The most logical place for them seems to be
publicKeyproperty, which can take the form of array where the first item represents RSA key and the second item represents EdDSA key. But servers may expectpublicKeyto be an object and fail to process an array, making gradual upgrade impossible. So we need to either use some new property (authentication?) or keep RSA as the recommended signature algorithm.silverpill:However, I’m not sure how to distribute EdDSA keys.
One option would be to use the mechanism from fep-4adb and just use a did-key as identity, i.e. have an actor of the form:
{ "@context": [ "https://www.w3.org/ns/activitystreams", { "xrd": "http://docs.oasis-open.org/ns/xri/xrd-1.0#", "aliases": { "@id": "xrd:Alias", "@type": "@id", "@container": "@list"}, } ], "id": "https://chatty.social/bnm789", "preferredUsername": "ben", "aliases": [ "acct:ben@chatty.social", "did:key:z6MkekwC6R9bj9ErToB7AiZJfyCSDhaZe1UxhDbCqJrhqpS5" ], ...}I don't see any disadvantages in this approach compared to using a "publicKey" property or similar. I see some advantages in this approach, that's why the above fep discusses it.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login