git ssb

9+

mixmix / ssb-handbook



Commit 6c591ad213da63c1fc8d5396b439279bc03fe35e

copy from https://scuttlebot.io/more/protocols/secure-scuttlebutt.html

Michael Williams committed on 11/3/2016, 12:21:12 PM
Parent: f2ddbc9bb74bc33eda174f962215eefeb8dae202

Files changed

SUMMARY.mdchanged
assets/gossip-graph1.pngadded
assets/gossip-graph2.pngadded
concepts/blob.mdadded
concepts/feed.mdadded
concepts/gossip.mdadded
concepts/identity.mdadded
concepts/link.mdadded
concepts/local.mdadded
concepts/message.mdadded
concepts/private-message.mdadded
concepts/pub.mdadded
SUMMARY.mdView
@@ -1,8 +1,14 @@
11
22 * ![](assets/hermes.png)
33 * [Introduction](README.md)
44 * [Concepts](concepts/index.md)
5- - [Append only logs](concepts/append-only-log.md)
6- - [Content addressable storage](concepts/content-addressable-storage.md)
7- - [Key pairs](concepts/key-pairs.md)
5 + - [Identity](concepts/identity.md)
6 + - [Feed](concepts/feed.md)
7 + - [Message](concepts/message.md)
8 + - [Private Message](concepts/private-message.md)
9 + - [Link](concepts/link.md)
10 + - [Gossip](concepts/gossip.md)
11 + - [Local](concepts/local.md)
12 + - [Pub](concepts/pub.md)
13 + - [Blob](concepts/blob.md)
814
assets/gossip-graph1.png
assets/gossip-graph1.png
assets/gossip-graph2.png
assets/gossip-graph2.png
concepts/blob.mdView
@@ -1,0 +1,3 @@
1 +# Blob
2 +
3 +
concepts/feed.mdView
@@ -1,0 +1,5 @@
1 +# Feed
2 +
3 +A feed is a signed append-only sequence of messages. Each identity has exactly one feed.
4 +
5 +Note that append-only means you cannot delete an existing message, or change your history. This is enforced by a per-feed blockchain. This is to ensure the entire network converges on the same state.
concepts/gossip.mdView
@@ -1,0 +1,23 @@
1 +# Gossip
2 +
3 +## Following
4 +
5 +Users choose which feeds to synchronize by following them. Presently, Scuttlebot's replicate plugin, which is enabled by default, looks on the master user's feed for `type: contact` messages to know which users are currently followed.
6 +
7 +## Replication
8 +
9 +Since feeds are append-only, replication is simple: request all messages in the feed that are newer than the latest message you know about. Scuttlebot maintains a table of known peers, which it cycles through, asking for updates for all followed feeds.
10 +
11 +Since feeds are append-only, gossip is simple: request all messages in the feed that are newer than the latest message you know about. Scuttlebot maintains a table of known peers, which it cycles through, asking for updates for all followed feeds.
12 +
13 +## Network
14 +
15 +The protocol creates a [global gossip network](https://en.wikipedia.org/wiki/Gossip_protocol). This means that information is able to distribute across multiple machines, without requiring direct connections between them.
16 +
17 +![Gossip graph 1](../assets/gossip-graph1.png)
18 +
19 +Even though Alice and Dan lack a direct connection, they can still exchange feeds:
20 +
21 +![Gossip graph 2](../assets/gossip-graph2.png)
22 +
23 +This is because gossip creates "transitive" connections between computers. Dan's messages travel through Carla and the Pub to reach Alice, and visa-versa.
concepts/identity.mdView
@@ -1,0 +1,5 @@
1 +# Identity
2 +
3 +An identity is simply a [ed25519 key pair](http://ed25519.cr.yp.to/). The public key is used as the identifier.
4 +
5 +There is no worldwide store of identities. Users must exchange pubkeys, either by publishing them on their feeds, or out-of-band.
concepts/link.mdView
@@ -1,0 +1,35 @@
1 +# Link
2 +
3 +Messages can reference three types of Secure Scuttlebutt entities: messages, feeds, and blobs (i.e. files). Messages and blobs are referred to by their hashes, but a feed is referred to by its signing public key.
4 +
5 +To indicate the type of ID, a "sigil" is prepended to the string. They are:
6 +
7 +- `@` for feeds
8 +- `%` for messages
9 +- `&` for blobs
10 +
11 +Additionally, each ID has a "tag" appended to indicate the hash or key algorithm. Some example IDs:
12 +
13 +- A feed: `@LA9HYf5rnUJFHHTklKXLLRyrEytayjbFZRo76Aj/qKs=.ed25519`
14 +- A message: `%MPB9vxHO0pvi2ve2wh6Do05ZrV7P6ZjUQ+IEYnzLfTs=.sha256`
15 +- A blob: `&Pe5kTo/V/w4MToasp1IuyMrMcCkQwDOdyzbyD5fy4ac=.sha256`
16 +
17 +When IDs are found in the messages, they may be treated as links, with the keyname acting as a "relation" type. An example of this:
18 +
19 +```shell
20 +sbot publish --type post \
21 + --root "%MPB9vxHO0pvi2ve2wh6Do05ZrV7P6ZjUQ+IEYnzLfTs=.sha256" \
22 + --branch "%kRi8MzGDWw2iKNmZak5STshtzJ1D8G/sAj8pa4bVXLI=.sha256" \
23 + --text "this is a reply!"
24 +```
25 +
26 +```javascript
27 +sbot.publish({
28 + type: "post",
29 + root: "%MPB9vxHO0pvi2ve2wh6Do05ZrV7P6ZjUQ+IEYnzLfTs=.sha256",
30 + branch: "%kRi8MzGDWw2iKNmZak5STshtzJ1D8G/sAj8pa4bVXLI=.sha256",
31 + text: "this is a reply!"
32 +})
33 +```
34 +
35 +In this example, the root and branch keys are the relations. SSB automatically builds an index based on these links, to allow queries such as "all messages with a root link to this message."
concepts/local.mdView
@@ -1,0 +1,3 @@
1 +# local
2 +
3 +SSB is hostless: each computer installs the same copy of software and has equal rights in the network. Devices discover each other over the LAN with multicast UDP and sync automatically.
concepts/message.mdView
@@ -1,0 +1,30 @@
1 +# Message
2 +
3 +Each message contains:
4 +
5 +A signature
6 +The signing public key
7 +A content-hash of the previous message
8 +A sequence number
9 +A timestamp
10 +An identifier of the hashing algorithm in use (currently only "sha256" is supported)
11 +A content object
12 +Here's an example message:
13 +
14 +```
15 +{
16 + "previous": "%26AC+gU0t74jRGVeDY013cVghlZRc0nfUAnMnutGGHM=.sha256",
17 + "author": "@hxGxqPrplLjRG2vtjQL87abX4QKqeLgCwQpS730nNwE=.ed25519",
18 + "sequence": 216,
19 + "timestamp": 1442590513298,
20 + "hash": "sha256",
21 + "content": {
22 + "type": "vote",
23 + "vote": {
24 + "link": "%WbQ4dq0m/zu5jxll9zUbe0iGmDOajCx1ZkLKjZ80JvI=.sha256",
25 + "value": 1
26 + }
27 + },
28 + "signature": "Sjq1C3yiKdmi1TWvNqxIk1ZQBf4pPJYl0HHRDVf/xjm5tWJHBaW4kXo6mHPcUMbJYUtc03IvPwVqB+BMnBgmAQ==.sig.ed25519"
29 +}
30 +```
concepts/private-message.mdView
@@ -1,0 +1,5 @@
1 +# Private Message
2 +
3 +For private sharing, Scuttlebot uses [libsodium](http://doc.libsodium.org/) to encrypt confidential log-entries. Feed IDs are public keys, and so once two feeds are mutually following each other, they can exchange confidential data freely.
4 +
5 +Private-box is a format for encrypting a private message to many parties. It is designed according to the [audit-driven crypto design process](https://github.com/crypto-browserify/crypto-browserify/issues/128). You can find the repository on at [github:dominictarr/private-box](https://github.com/auditdrivencrypto/private-box)
concepts/pub.mdView
@@ -1,0 +1,3 @@
1 +# Pub
2 +
3 +To sync across the Internet, "Pub" nodes run at public IPs and follow users. They are essentially mail-bots which improve uptime and availability. Users generate invite-codes to command Pubs to follow their friends. The Scuttlebot community runs some Pubs, and anybody can create and introduce their own.

Built with git-ssb-web