Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DID-based actor identifiers #1113

Closed
troyronda opened this issue Feb 8, 2022 · 4 comments · Fixed by #1423
Closed

Support DID-based actor identifiers #1113

troyronda opened this issue Feb 8, 2022 · 4 comments · Fixed by #1423
Assignees
Labels

Comments

@troyronda
Copy link
Contributor

troyronda commented Feb 8, 2022

Enable Orb to support DID-based actor identifiers (e.g., did:web:example).

Supporting DID-based actors allows the actor response to look like:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/activityanchors/v1"
  ],
  "id": "did:web:alice.example.com:services:anchor,
  "type": "Service",
  "inbox": "https://alice.example.com/services/anchor/inbox",
  "outbox": "https://alice.example.com/services/anchor/outbox",
  "followers": "https://alice.example.com/services/anchor/followers",
  "following": "https://alice.example.com/services/anchor/following",
  "witnesses": "https://alice.example.com/services/anchor/witnesses",
  "witnessing": "https://alice.example.com/services/anchor/witnessing",
  "likes": "https://alice.example.com/services/anchor/likes",
  "liked": "https://alice.example.com/services/anchor/liked",
  "shares": "https://alice.example.com/services/anchor/shares"
}

Supporting DID-based actors allows messages to look like:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/activityanchors/v1"
  ],
  "id": "did:web:sally.example.com:services:anchor/activities/bafkreiatkubvbkdidscmqynkyls3iqawdqvthi7e6mbky2amuw3inxsi3y",
  "type": "Create",
  "actor": "did:web:sally.example.com:services:anchor",
  "to": [
    "did:web:sally.example.com:services:anchor/followers",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "published": "2021-01-27T09:30:10Z",
  "object": {
    "type": "AnchorEvent",
    "attributedTo": "did:web:example.domain1.com:services:example",
    "index": "hl:uEiCF5Mr8n7NPsAGenkNIoY0tJtnqDUWMk_XdYpgOm5yNnA",
    "parent": "hl:uEiAL-T2TdNkqL5gRIX8BZvrXESPOzoIYy98YUBxc5xAG0w:uoQ-BeEJpcGZzOi8vYmFma3JlaWFsN2U2emc1Z3pmaXh6cWVqYnA0YXduNnd4Y2VyNDV0dWNkZGY1NmdjcWRyb29vZWFnMm0",
    "published": "2021-10-29T18:06:34.554883376Z",
    "url": "hl:uEiAyUitoMn-ujmlFC6DBW2AlWabxGfVpGw0b3ymcqwzSHQ:uoQ-BeEJpcGZzOi8vYmFma3JlaWJza2l2d3FtdDd2Mmhnc3JpbHVkYXZ3eWJmbGd0cGNncHZuZW5xMmc2N2Znb2t3ZGdzZHU",
    "attachment": [...]  
  }
}
@fqutishat fqutishat reopened this Jul 11, 2022
@fqutishat
Copy link
Contributor

#1335 duplicate

@bstasyszyn
Copy link
Contributor

bstasyszyn commented Aug 9, 2022

Adding new startup parameter:

--service-id:

The ID of the ActivityPub service. By default, the ID is composed of the external endpoint appended with /services/orb.
For example, if external-endpoint is set to https://alice.example.com then the service ID will
be https://alice.example.com/services/orb. The value may be set to a different path, e.g.
https://alice.example.com/services/anchor, or it can be set to a DID, e.g. did:web:alice.example.com:services:anchor.

If service-id is set to did:web:alice.example.com:services:anchor then the ActivityPub service (actor) looks like this:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1",
    "https://w3id.org/activityanchors/v1"
  ],
  "id": "did:web:alice.example.com:services:anchor",
  "publicKey": "did:web:alice.example.com:services:anchor#MrWUYMOS4ZGF7LCBVSr8njn98OvG70XaLV31EDFhBH0",
  "followers": "https://alice.example.com/services/anchor/followers",
  "following": "https://alice.example.com/services/anchor/following",
  "inbox": "https://alice.example.com/services/anchor/inbox",
  "liked": "https://alice.example.com/services/anchor/liked",
  "likes": "https://alice.example.com/services/anchor/likes",
  "outbox": "https://alice.example.com/services/anchor/outbox",
  "shares": "https://alice.example.com/services/anchor/shares",
  "type": "Service",
  "witnesses": "https://alice.example.com/services/anchor/witnesses",
  "witnessing": "https://alice.example.com/services/anchor/witnessing"
}

The service's DID document is resolved using a VDR (currently only did:web is supported so the document would be at https://alice.example.com/services/anchor/did.json):

{
  "@context": [
    "https://w3id.org/did/v1",
    "https://identity.foundation/.well-known/did-configuration/v1"
  ],
  "id": "did:web:alice.example.com:services:anchor",
  "verificationMethod": [
    {
      "controller": "did:web:alice.example.com:services:anchor",
      "id": "did:web:alice.example.com:services:anchor#MrWUYMOS4ZGF7LCBVSr8njn98OvG70XaLV31EDFhBH0",
      "publicKeyMultibase": "z7a7SJkF8LTqGACTxB8r86i2btE7y8qrPnGuCe3M9vk8f",
      "type": "Ed25519VerificationKey2020"
    }
  ],
  "service": [
    {
      "id": "did:web:alice.example.com:services:anchor#activity-pub",
      "serviceEndpoint": "https://alice.example.com",
      "type": "LinkedDomains"
    }
  ]
}

An activity would look like this:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "actor": "did:web:alice.example.com:services:anchor",
  "id": "https://alice.example.com/services/anchor/activities/3dd6c5bf-dc7c-4743-87b2-12d303f0ecaf",
  "object": {
    "@context": "https://w3id.org/activityanchors/v1",
    "object": {
      "linkset": [
        {
          "anchor": "hl:uEiAsmhY5seUU6LNsy30iJEjM-urZ4g_EPylBeXUTlzK33A",
          "author": "did:web:alice.example.com:services:anchor",
          "original": [
            {
              "href": "data:application/json,%7B%22linkset%22%3A%5B%7B%22anchor%22%3A%22hl%3AuEiDRfrx2UAy6wydaXceJL9hlpFQwTTuP_RIS5zm7J9sr2Q%22%2C%22author%22%3A%22did%3Aweb%3Aalice.example.com%3Aservices%3Aanchor%22%2C%22item%22%3A%5B%7B%22href%22%3A%22did%3Aorb%3AuAAA%3AEiDvfNx40DmnAE9tKw6eWue8OiWPh5668PvnyfcHQtr5sQ%22%7D%2C%7B%22href%22%3A%22did%3Aorb%3AuAAA%3AEiCgK6K4eVoW2vYINhGDYyUsaFQh0Xq2GeQQ6No7sXrezg%22%7D%2C%7B%22href%22%3A%22did%3Aorb%3AuAAA%3AEiAI60PiHNKAX7zGRe10UOPIfl5vabGYAkzOSF8KLgzmmg%22%7D%2C%7B%22href%22%3A%22did%3Aorb%3AuAAA%3AEiCgNvbqlq5yxQGrM6ipv6iMDLhwYmlDBZO1f60mfTnLaA%22%7D%2C%7B%22href%22%3A%22did%3Aorb%3AuAAA%3AEiBCHij5TOiT_D1COIdMGbBbIAJJ7PSt_aCWqv7BXFGpxQ%22%7D%2C%7B%22href%22%3A%22did%3Aorb%3AuAAA%3AEiBkfnunulwm2oj9_PZXtrBxWFclC6Z64Ou2rX5sGM-D_A%22%7D%2C%7B%22href%22%3A%22did%3Aorb%3AuAAA%3AEiBxxIu6yc1aFlCvV5rbjSbJ-qFWLLwxKPBstDyLMrhlNA%22%7D%2C%7B%22href%22%3A%22did%3Aorb%3AuAAA%3AEiCUipZOgwqREWpmRtln44hWDQhENOOPzX5ByukeYV5eLQ%22%7D%2C%7B%22href%22%3A%22did%3Aorb%3AuAAA%3AEiDk4OAYEyC3iQEqJcNxu6ljG7o5PayR-vugrtB27e_0KA%22%7D%2C%7B%22href%22%3A%22did%3Aorb%3AuAAA%3AEiDY8i8w9v7yFb6VmcKvoxNZ7X_VjWfGuSN-QLH6crHnWg%22%7D%5D%2C%22profile%22%3A%22https%3A%2F%2Fw3id.org%2Forb%23v0%22%7D%5D%7D",
              "type": "application/linkset+json"
            }
          ],
          "profile": "https://w3id.org/orb#v0",
          "related": [
            {
              "href": "data:application/json,%7B%22linkset%22%3A%5B%7B%22anchor%22%3A%22hl%3AuEiAsmhY5seUU6LNsy30iJEjM-urZ4g_EPylBeXUTlzK33A%22%2C%22profile%22%3A%22https%3A%2F%2Fw3id.org%2Forb%23v0%22%2C%22via%22%3A%5B%7B%22href%22%3A%22hl%3AuEiDRfrx2UAy6wydaXceJL9hlpFQwTTuP_RIS5zm7J9sr2Q%3AuoQ-BeEtodHRwczovL29yYi5kb21haW4yLmNvbS9jYXMvdUVpRFJmcngyVUF5Nnd5ZGFYY2VKTDlobHBGUXdUVHVQX1JJUzV6bTdKOXNyMlE%22%7D%5D%7D%5D%7D",
              "type": "application/linkset+json"
            }
          ],
          "replies": [
            {
              "href": "data:application/json,%7B%22%40context%22%3A%5B%22https%3A%2F%2Fwww.w3.org%2F2018%2Fcredentials%2Fv1%22%2C%22https%3A%2F%2Fw3id.org%2Factivityanchors%2Fv1%22%2C%22https%3A%2F%2Fw3id.org%2Fsecurity%2Fsuites%2Fjws-2020%2Fv1%22%2C%22https%3A%2F%2Fw3id.org%2Fsecurity%2Fsuites%2Fed25519-2020%2Fv1%22%5D%2C%22credentialSubject%22%3A%7B%22anchor%22%3A%22hl%3AuEiDRfrx2UAy6wydaXceJL9hlpFQwTTuP_RIS5zm7J9sr2Q%22%2C%22id%22%3A%22hl%3AuEiAsmhY5seUU6LNsy30iJEjM-urZ4g_EPylBeXUTlzK33A%22%2C%22profile%22%3A%22https%3A%2F%2Fw3id.org%2Forb%23v0%22%7D%2C%22id%22%3A%22https%3A%2F%2Falice.example.com%2Fvc%2F63384454-28f5-4dd9-9833-b7f79d9087a9%22%2C%22issuanceDate%22%3A%222022-08-09T14%3A16%3A17.653656394Z%22%2C%22issuer%22%3A%22https%3A%2F%2Falice.example.com%22%2C%22proof%22%3A%5B%7B%22created%22%3A%222022-08-09T14%3A16%3A17.656966342Z%22%2C%22domain%22%3A%22https%3A%2F%2Falice.example.com%22%2C%22proofPurpose%22%3A%22assertionMethod%22%2C%22proofValue%22%3A%22z4H9r9tgoSDVczeC5WSig5Mp4ASojXuzQJ9JTqm78GXKKpKUx2ETQSf1TUXLYU84Uq36Y6SaPzon4AstwqxyYRFRv%22%2C%22type%22%3A%22Ed25519Signature2020%22%2C%22verificationMethod%22%3A%22did%3Aweb%3Aalice.example.com%23m0lkGe6apkR_uzrcBHsttLf-cMgCS-Z4_27Qt5kyRG0%22%7D%2C%7B%22created%22%3A%222022-08-09T14%3A16%3A17.824Z%22%2C%22domain%22%3A%22http%3A%2F%2Forb.vct%3A8077%2Fmaple2020%22%2C%22proofPurpose%22%3A%22assertionMethod%22%2C%22proofValue%22%3A%22z5fBV9Dwac2c3rgg5adjpvWpWM57QuK5zh5FQXsn2Jr3bZyTd3G5ACwN23hiBUHFunJC73F28wg9AdYmXfzdHVjcJ%22%2C%22type%22%3A%22Ed25519Signature2020%22%2C%22verificationMethod%22%3A%22did%3Aweb%3Aorb.domain1.com%23ipyFbnxMIbWJME8K1uvIp-UdrdVpyuQ9QjCCgnHHjFg%22%7D%5D%2C%22type%22%3A%5B%22VerifiableCredential%22%2C%22AnchorCredential%22%5D%7D",
              "type": "application/ld+json"
            }
          ]
        }
      ]
    },
    "type": "AnchorEvent",
    "url": "hl:uEiCP980v2AZbTgRmebFolD48LhE4u-yXzOoISRUJkUjToQ:uoQ-BeEtodHRwczovL29yYi5kb21haW4yLmNvbS9jYXMvdUVpQ1A5ODB2MkFaYlRnUm1lYkZvbEQ0OExoRTR1LXlYek9vSVNSVUprVWpUb1E"
  },
  "published": "2022-08-09T14:16:18.013015949Z",
  "to": [
    "https://alice.example.com/services/anchor/followers",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "type": "Create"
}

@troyronda
Copy link
Contributor Author

FYI @talltree @brentzundel ^^^

@talltree
Copy link

@troyronda Looks good. What are our plans (if any) to support did:orb DIDs?

bstasyszyn added a commit to bstasyszyn/orb that referenced this issue Aug 12, 2022
A service ID may be configured as a DID and the public key (used for HTTP signature verifications) may be configured as a key ID referencing a public key within the service's DID document.

closes trustbloc#1113

Signed-off-by: Bob Stasyszyn <[email protected]>
bstasyszyn added a commit to bstasyszyn/orb that referenced this issue Aug 12, 2022
A service ID may be configured as a DID and the public key (used for HTTP signature verifications) may be configured as a key ID referencing a public key within the service's DID document.

closes trustbloc#1113

Signed-off-by: Bob Stasyszyn <[email protected]>
bstasyszyn added a commit to bstasyszyn/orb that referenced this issue Aug 12, 2022
A service ID may be configured as a DID and the public key (used for HTTP signature verifications) may be configured as a key ID referencing a public key within the service's DID document.

closes trustbloc#1113

Signed-off-by: Bob Stasyszyn <[email protected]>
Repository owner moved this from In Progress to Done in TrustBloc Orb Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants