diff --git a/index.html b/index.html index 6460a65..568f148 100644 --- a/index.html +++ b/index.html @@ -53,9 +53,25 @@

Contents

Structure
Message format
+
Common schemas
createHistoryStream
+
+
Message Schemas
+
+
About
+
Blog
+
Contact
+
Post
+
Private
+
Pub
+
Vote
+
+
+ + +
Metafeeds
@@ -68,15 +84,15 @@

Contents

Network Identity
-
-
-
+ +
+
Following
@@ -89,8 +105,6 @@

Contents

Invites
-
-
Rooms
@@ -899,7 +913,7 @@
Implementations
key: authors_longterm_sk )

Base64 encode the signature and put .sig.ed25519 on the end. Finally, add the signature to the message itself. It must be the last entry in the dictionary:

-
{
+      
{
   "previous": "%XphMUkWQtomKjXQvFGfsGYpt69sgEY7Y4Vou9cEuJho=.sha256",
   "author": "@FCX/tsDLpubCPKKfIrw4gc+SQkHcaD17s7GI6i/ziWY=.ed25519",
   "sequence": 2,
@@ -921,13 +935,14 @@ 
Implementations
key: authors_longterm_pk )
-

Message ID

+

Message ID

A message ID is a hash of the message including signature. Messages can refer to other messages by their ID.

To compute a message’s ID, first format it as JSON using the formatting rules. Like with signatures, dictionary keys must appear in the same order that you received them. The signature key must appear last as shown above (but without wrapping the line).

The ID of the above message is:

%R7lJEkz27lNijPhYNDzYoPjM0Fp+bFWzwX0SmNJB/ZE=.sha256 where everything between % and .sha256 is the base64-encoding of the sha256 hash of the formatted message including signature

Currently all IDs are computed using sha256. However the protocol includes the name of the hash function in message IDs and the messages themselves to allow migrating to a different one if needed in the future.

+

createHistoryStream

Scuttlebutt clients maintain a set of feeds that they are interested in. These could be feeds that the user has followed, bookmarked or subscribed to. When peers connect, one of the first things they do is ask each other whether the feeds they are interested in have any new messages.

+ +

Message Schemas

+

Secure Scuttlebutt supports arbitary schema and it is up to each implimentation to determine which message types and schema are supported. There is no enforcement mechanism or verification of schemas. Most apps support a subset of these schema types.

+ +

about (profile update)

+

About messages are used to add additional information to another message, much like attaching post-it notes to some book page. You're _attaching information about_ something. Most use cases of about messages are to add names, images and descriptions to a user profile.

+ + + +

What does it look like?

+ +
{
+    "key": "%buRChtQMrk/WjZQsfsgsg17XHmSDnMMKfFEXv/bjL43lQ=.sha256",
+    "value": {
+    "previous": null,
+    "sequence": 1,
+    "author": "@G/zUdqlPsdgsgd8yXIfMjx1676ApAOghwgc=.ed25519",
+    "timestamp": 1560287825423,
+    "hash": "sha256",
+    "content": {
+        "type": "about",
+        "about": "@G/zUdqlPMsdgsdg8yXIfMjx1676ApAOghwgc=.ed25519",
+        "image": "&N3ectV2qM5gyH2Zrsdgsdgd+InCMkJBc/MaTbJ0=.sha256",
+        "name": "Hilo",
+        "description": "extrem klug"
+    },
+    "signature": "UMjf4aFsdgsgUY9zeDAqWdTZeymoQznicvfgATu0/kArvLnshqbkiG7ZIngXcnztMUc6SyI4GrDwkAA==.sig.ed25519"
+    },
+    "timestamp": 1560288248693,
+    "rts": 1560287825423
+}
+        
+ +

The message above is adding a name, an image> and a description to the user specified by the about field.

+ +

There is a lot more information about about online.

+ + + +

blog

+

Sometimes messages of type post are not enough for you to express what you need. All messages in Secure Scuttlebutt have a maximum size of 8k which is counting the metadata associated with the message and not just the content itself. For those occasions when you need to write longer messages you can use blog.

+

These messages are actually a small set of metadata, just enough so that clients can display a summary and an associated blob (this link explains them in depth) which holds the content.

+
+

About blobs: You can think of blobs like attachments to an email. Blobs are not downloaded automatically, they need to be requested. Patchfox will request images on its own so that you can see posts and images together but it will not request other blobs unless you initiate some action that needs them. In cases such as blog messages, the blobs are requested when you press the Read Blogpost button. If you don't press it, we don't download that post.

+
+

What do blog posts look like?

+
{
+    "key": "%x4+H95OSsvVgsPl6sggsfgsD0KPM8Y3eHQ9lj2oKNb4=.sha256",
+    "value": {
+    "previous": "%CwJcRGnZsdgsdg59NyL9gBokQzOzAoJJFjBE=.sha256",
+    "sequence": 176,
+    "author": "@aSo64imXSBLArsdgsdgidEUsvp2Lziiu3youY=.ed25519",
+    "timestamp": 1560521419974,
+    "hash": "sha256",
+    "content": {
+        "type": "blog",
+        "title": "Fridays for Future treffen Science Fiction: Was ist eigentlich Solarpunk?",
+        "summary": "Die Welt der Science Fiction ist bunt und vielfältig. Das zeigen 
+        Untergenres wie Cyberpunk und Steampunk – die mittlerweile weithin bekannt sind. 
+        Solarpunk ist hingegen nur wenigen ein Begriff. Dabei passt dieses Genre so gut in 
+        unsere Zeit wie kein anderes. Denn Solarpunk zeichnet eine Welt, in der wir unseren 
+        Planeten noch retten können.",
+        "thumbnail": "&EmYpby5uFsdgsdg81wwggzPT52zZLNpQSoZu8=.sha256",
+        "blog": "&DcG4eJNU65yuVMjwNIsdgsdgsdZfmTIfXQrTxOQ=.sha256",
+        "mentions": [
+        {
+            "link": "&pU8sdgsdgsSIs3z5kw25OPoqmDbwLoNPIJE6XI=.sha256",
+            "type": "image/jpeg",
+            "size": 195993
+        }
+        ],
+        "channel": "solarpunk"
+    },
+    "signature": "51SNzLdPRDMWNVTdBjU0TplV9gbmyehpieNPUAaMnob9YFe4sH6nMjAA==.sig.ed25519"
+    }
+}
+ +

On the message above you can see some metadata to help create a summary card in fields summary, title, thumbnail. The content for the blogpost is a blob in field blog. Blobs start with an %. Patchfox will fetch that blob and display it if you ask it to. The blob is a markdown text file.

+ +

contact

+

Contact messages are used to follow or unfollow another user. This affects your social graph and gossiping. Once you follow a given user, you'll start replicating all of that user's feed and, depending on how your client is configured, their friends. Most clients will do two levels of replication, so you end up with all your friends' data and friends-of-friends' data, much like the physical world in which you receive gossip regarding your friends' friends.

+

What does it look like?

+
{
+    "key": "%JJW6l3PphHHNxkbe6q+gzsgsgOIgIEjqtnKVq5fo=.sha256",
+    "value": {
+    "previous": "%4UrrxMHmjgkw/tDZ40ztxwwrg2TQSzPVMw9efqj9E=.sha256",
+    "sequence": 1182,
+    "author": "@GLH9VPzvvU2KcnnUwgwgTUtzw+Rk6fd/Kb9Si0=.ed25519",
+    "timestamp": 1560279915710,
+    "hash": "sha256",
+    "content": {
+        "type": "contact",
+        "contact": "@S954DSMnCh8aBqwegwegVZSBtK9N49Wq5AHh3OwOjo=.ed25519",
+        "following": true
+    },
+    "signature": "laHTnqQkbem2rFxvfwegwegwI4B7l2egVZSBtK9N49M4i8uTCDg==.sig.ed25519"
+    },
+    "timestamp": 1560279930388,
+    "rts": 1560279915710
+}
+

In the message above, the author is following (specified by the following field) a user specified by the contact field. If the value of the following field was false, that would be an unfollow message.

+

You can learn more about this message if you want.

+ +

post

+

Post messages are text-based messages intended for a public or private audience. They are what you normally see on feeds from social networks and make most of the meaningful interaction in Scuttlebutt at the moment.

+ +

What does it look like?

+
{
+    "key": "%gZIjLirxZKxCMmcsoud/bC0pL68UeB+Yuz+4re67TNk=.sha256",
+    "value": {
+    "previous": "%X8PLQuBhdUA+WF5VANRfG5iAKMNAeBXxlAtd9SKDAtM=.sha256",
+    "sequence": 251,
+    "author": "@qv10rF4IsmxRZb7g5ekJ33EakYBpdrmV/vtP1ij5BS4=.ed25519",
+    "timestamp": 1560279840471,
+    "hash": "sha256",
+    "content": {
+        "type": "post",
+        "text": "YES WE CAN! :heart: :smiley_cat:",
+        "root": "%Yx6/snCfur1NHd9fov8H359DfqTyncxuh93uZKnLQI8=.sha256",
+        "branch": "%X8PLQuBhdUA+WF5VANRfG5iAKMNAeBXxlAtd9SKDAtM=.sha256",
+        "channel": "patchfox"
+    },
+    "signature": "nP2guRVtAJrvJpmcwG/K+mn4JgNW1TB1yszzZebDrk3j+UBBA==.sig.ed25519"
+    },
+    "timestamp": 1560279840471.001,
+    "rts": 1560279840471
+}
+        
+ +

These messages have a lot of fields. Lets go through the most important ones:

+
    +
  • text: This is a Markdown-based textual content that is the body of your message. The other users will see a rendered version of this content.
  • +
  • root: In case this message is part of a thread of messages. The root fields points at the topmost message.
  • +
  • branch: If this message is a reply to another message, then branch points at the message this message is replying to.
  • +
  • channel: The channel this message is being posted to. It works much like hashtags but don't need to be present in the content itself.
  • +
+

There are other fields such as recps- which holds the recipients for the messages and is used by private messages- and mentions- which is used to help link mentioned users and messages.

+

There is more information about posts online.

+ +

private

+

One of the cool things about Secure Scuttlebutt is that it takes privacy seriously. The cryptography techniques employed by the SSB stack allows a group of people to message each other using encrypted text that is only visible to the involved parties, everyone else will just see undecypherable text.

+

How does it looks like?

+
{
+  "key": "%OEZvP6IBUvadgsgCW16wN44TTMu0tntgS2YjOadCSLE=.sha256",
+  "value": {
+    "previous": "%YQJ+N13OCg14ixpsgsgdjrhe4t/lCI9+6P6oYPtZM=.sha256",
+    "author": "@zurF8X68ArfRM71sdgsgW0xDM8QmOnAS5bYOq8hA=.ed25519",
+    "sequence": 2529,
+    "timestamp": 1560619975563,
+    "hash": "sha256",
+    "content": "DHczz4HPS1sdgsdg2bTMVXUggdA7wLopexXlNgQA2JukhCH8WKFNAu81fLcu0euPM/lT
+BcAXoYIda6qKCGUwvxdgsgX6cCF3Ktu/BXIsYYk8TECYFM39gTfUTp0ORa18lussdgsdgZsCcOrHN4HJ7QF1
+dHIEgkWglJtMO4Q4NwufiQ1keDqgsxnE6h5qKLBcZjQ8duvhSEwhoyJ6oBFAMUn0NeF9UYWi2r0EKtMucdit
+ltqG1CsdgsdgasH2rGdt6GZkm89L7JahsYiZFtDPV1AQkQNhFp8cO5bHFmMQyhXFZBs0ABDqrq7l9skJlCKv
+w1ycDanwqhIoiAjU851JtZD4fWh81KwkKOWBVZeYqZnimNsm9jXAWlADGUe2GmS3yWRJfvcxgjGyGzzy5Sm7
+xU2XVol6WfKoMrLpedtl9CQ3uk7gR7WLmRUI78CkcJLHXDC3td4JSPWKPpCoh60pmdiG6e8e5aaYpMLKeHNz
+qecXpcNKAh3r4281Ddma7lqbU7zujf5xIMni1VmUklVk6+KZr1CIwZUw+esP5DDns/Nyb/w8X1JwuVpSWmlg
+sxqsQ==.box",
+    "signature": "G6YHYOsdgsdgsdgqrgb7kANjZyegf5ZWMSmW6GXezaR1UC70OymEvBBA==.sig.ed25519"
+  },
+  "timestamp": 1560619916779,
+  "rts": 1560619916779
+}
+
+

As you can see from the message above, the content is encrypted. Only the intended recipients for that message are able to decrypt it. All the other users will fail to decrypt it and ignore the message.

+ +

pub

+

pub messages are used for pub announcements. These are issued by pub servers so that clients discover them.

+

What they look like

+
{
+  "author": "@E5lOaTD+74yeVZhyGnPW9wSykpUGj6h8OjgVIoD4QdI=.ed25519",
+  "content": {
+      "address": {
+          "host": "188.166.252.233",
+          "key": "@uRECWB4KIeKoNMis2UYWyB2aQPvWmS3OePQvBj2zClg=.ed25519",
+          "port": 8008
+      },
+      "type": "pub"
+  },
+  "hash": "sha256",
+  "previous": "%c6bhBJfl1zWABSmV0sVWlTkklYTLxGHfSxt2LwA1ndM=.sha256",
+  "sequence": 6,
+  "signature": "4zTxKyyu8Gt24AGwTUrJnEy7x91657+dQrCwjLHrYuE156/dy9cTpvCA==.sig.ed25519",
+  "timestamp": 1459981972234
+}
+
+

They match a pub key with an accessible host. You can learn more about pub messages online.

+ +

vote

+

This message is akin to likes, hearts and stars in social networks. They represent an intention to support the message. Secure Scuttlebutt doesn't mandate a term to be used in this case and some clients will call it like while others call it dig, it doesn't matter, the message structure is the same.

+

What does it looks like?

+
{
+  "key": "%p3LT5yzsfb/bPizfsgsEruyCeCgtqBY=.sha256",
+  "value": {
+    "previous": "%isvGQ2h9qnRiilXNssbXbi9pI+lTa1V4rpXpbT0=.sha256",
+    "sequence": 549,
+    "author": "@MRiJ+CvDnD9ZjqunY1oy6sfbsbMDC4Q3tTC8riS3s=.ed25519",
+    "timestamp": 1560279862309,
+    "hash": "sha256",
+    "content": {
+      "type": "vote",
+      "channel": "patchfox",
+      "vote": {
+        "link": "%gZIjLirxZKxCMmczsbfsUeB+Yuz+4re67TNk=.sha256",
+        "value": 1,
+        "expression": "Like"
+      }
+    },
+    "signature": "eIXFCiv3znd3p7/gtWfxUqTaV2ikHkmzgYTpWc9xD39B12a2DQ==.sig.ed25519"
+  },
+  "timestamp": 1560279864098,
+  "rts": 1560279862309
+}
+

On the message above you can see that the author is doing a Like (as specified by the expression field) towards a message specified by the link field. The value 1 means a positive outcome, a value -1 means withdrawing your positive vote from the message.

+

There is more information about the vote message available online.

+ + +

Metafeeds