Example

October 8, 2021 ยท View on GitHub

Suppose the client has the SSB ID @FlieaFef19uJ6jhHwv2CSkFrDLYKJd/SuIS71A5Y2as=.ed25519 and the server is hosted at scuttlebutt.eu. Then the invite user journey is:

  1. Invite code 39c0ac1850ec9af14f1bb73 was generated by the server
  2. The corresponding invite link is https://scuttlebutt.eu/join?invite=39c0ac1850ec9af14f1bb73
  3. When the client opens that link in a browser, it renders a link to the SSB URI ssb:experimental?action=claim-http-invite&invite=39c0ac1850ec9af14f1bb73&postTo=https%3A%2F%2Fscuttlebutt.eu%2Fclaiminvite
  4. The client's SSB app processes the SSB URI and makes a POST request to https://scuttlebutt.eu/claiminvite with body
    {
      "id": "@FlieaFef19uJ6jhHwv2CSkFrDLYKJd/SuIS71A5Y2as=.ed25519",
      "invite": "39c0ac1850ec9af14f1bb73"
    }
    
  5. The server accepts the POST request, and responds with the JSON body
    {
      "status": "successful",
      "multiserverAddress": "net:scuttlebutt.eu:8008~shs:zz+n7zuFc4wofIgKeEpXgB+/XQZB43Xj2rrWyD0QM2M="
    }
    
  6. The server now recognizes the client as an authorized member for any subsequent secret-handshake and muxrpc connections at the multiserver address net:scuttlebutt.eu:8008~shs:zz+n7zuFc4wofIgKeEpXgB+/XQZB43Xj2rrWyD0QM2M=

The JSON endpoint https://scuttlebutt.eu/join?invite=39c0ac1850ec9af14f1bb73&encoding=json is an alternative to the SSB URI, and would respond with the following JSON:

{
  "status": "successful",
  "invite": "39c0ac1850ec9af14f1bb73",
  "postTo": "https://scuttlebutt.eu/claiminvite"
}

After that, the same steps 4, 5, and 6 apply.