I should actually clarify something here. The so called hack’s purpose is for stuff to remain valid JSON-LD, not to break compatibility with JSON-LD processors as suggested above.
In particular:
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://www.w3.org/ns/credentials/v2"
],
"actor": "https://first.example/users/first",
"cc": [
"https://second.example/users/second",
"https://first.example/users/first/followers"
],
"id": "https://first.example/users/first/statuses/1097854/activity",
"object": {
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://www.w3.org/ns/credentials/v2"
],
"id": "https://second.example/users/second/statuses/109724234853",
"type": "Note",
"content": "Hello world",
"proof": {
"type": "DataIntegrityProof",
"cryptosuite": "eddsa-jcs-2022",
"verificationMethod": "https://second.example/users/alice#ed25519-key",
"proofPurpose": "assertionMethod",
"proofValue": "z3sXaxjKs4M3BRicwWA9peyNPJvJqxtGsDmpt1jjoHCjgeUf71TRFz56osPSfDErszyLp5Ks1EhYSgpDaNM977Rg2",
"created": "2023-02-24T23:36:38Z"
}
},
"published": "2023-01-31T19:11:46Z",
"to": ["https://www.w3.org/ns/activitystreams#Public"],
"type": "Announce",
"proof": {
"type": "DataIntegrityProof",
"cryptosuite": "eddsa-jcs-2022",
"verificationMethod": "https://first.example/users/first#ed25519-key",
"proofPurpose": "assertionMethod",
"proofValue": "fixme",
"created": "2023-02-24T23:36:38Z"
}
}
is an invalid json-ld documents. As we will want to sign objects containing signed objects. This is unacceptable.
Finally, by changing the enveloping context to
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://www.w3.org/ns/credentials/v2",
{
"object": {
"@id": "as:object",
"@type": "@json"
}
}
],
one can resolve this problem.