# scuttlebot

> network protocol layer for secure-scuttlebutt

Latest version **13.2.2** (published 2018-12-14) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install scuttlebot
pnpm add scuttlebot
yarn add scuttlebot
bun add scuttlebot
```

Provides the commands `sbot`, `scuttlebot`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 13.2.2 |
| Published | 2018-12-14 |
| First published | 2014-10-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 49 |
| Unpacked size | 177.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1705 |
| Author | Paul Frazee |
| Maintainers | ahdinosaur, andregarzia, arj03, cel, christianbundy, cryp7ix, dominictarr, happy0, kyphae, marak, mixmix, mmckegg, noffle, pfraze, pfrazee, pietgeursen, regular, staltz, substack, vtduncan |

## Links

- npm: https://www.npmjs.com/package/scuttlebot
- Repository: https://github.com/ssbc/scuttlebot
- Issues: https://github.com/ssbc/scuttlebot/issues
- npm.io page: https://npm.io/package/scuttlebot

## Dependencies (49)

- [ip](https://npm.io/package/ip.md) ^1.1.5
- [mv](https://npm.io/package/mv.md) ^2.1.1
- [obv](https://npm.io/package/obv.md) 0.0.1
- [cont](https://npm.io/package/cont.md) ~1.0.3
- [zerr](https://npm.io/package/zerr.md) ^1.0.0
- [osenv](https://npm.io/package/osenv.md) ^0.1.5
- [mkdirp](https://npm.io/package/mkdirp.md) ~0.5.0
- [rimraf](https://npm.io/package/rimraf.md) ^2.4.2
- [ssb-db](https://npm.io/package/ssb-db.md) ^18.6.1
- [ssb-ws](https://npm.io/package/ssb-ws.md) ^5.1.1
- [ssb-ebt](https://npm.io/package/ssb-ebt.md) ^5.1.4
- [ssb-ref](https://npm.io/package/ssb-ref.md) ^2.13.9
- [minimist](https://npm.io/package/minimist.md) ^1.1.3
- [muxrpcli](https://npm.io/package/muxrpcli.md) ^1.0.0
- [pull-cat](https://npm.io/package/pull-cat.md) ~1.1.5
- [ssb-keys](https://npm.io/package/ssb-keys.md) ^7.1.1
- [multiblob](https://npm.io/package/multiblob.md) ^1.13.0
- [on-wakeup](https://npm.io/package/on-wakeup.md) ^1.0.0
- [pull-file](https://npm.io/package/pull-file.md) ^1.0.0
- [pull-many](https://npm.io/package/pull-many.md) ~1.0.6
- [pull-next](https://npm.io/package/pull-next.md) ^1.0.0
- [pull-ping](https://npm.io/package/pull-ping.md) ^2.0.2
- [ssb-blobs](https://npm.io/package/ssb-blobs.md) ^1.1.4
- [ssb-links](https://npm.io/package/ssb-links.md) ^3.0.2
- [ssb-query](https://npm.io/package/ssb-query.md) ^2.1.0
- [bash-color](https://npm.io/package/bash-color.md) ~0.0.3
- [deep-equal](https://npm.io/package/deep-equal.md) ^1.0.1
- [mdmanifest](https://npm.io/package/mdmanifest.md) ^1.0.4
- [ssb-client](https://npm.io/package/ssb-client.md) ^4.5.7
- [ssb-config](https://npm.io/package/ssb-config.md) ^2.3.7
- [statistics](https://npm.io/package/statistics.md) ^3.0.0
- [atomic-file](https://npm.io/package/atomic-file.md) ^1.1.5
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^6.0.5
- [has-network](https://npm.io/package/has-network.md) 0.0.1
- [multiserver](https://npm.io/package/multiserver.md) ^3.0.2
- [pull-notify](https://npm.io/package/pull-notify.md) 0.1.1
- [pull-stream](https://npm.io/package/pull-stream.md) ^3.6.2
- [ssb-friends](https://npm.io/package/ssb-friends.md) ^3.1.3
- [pull-paramap](https://npm.io/package/pull-paramap.md) ~1.2.1
- [secret-stack](https://npm.io/package/secret-stack.md) ^5.0.0
- [explain-error](https://npm.io/package/explain-error.md) ^1.0.3
- [pull-pushable](https://npm.io/package/pull-pushable.md) ^2.2.0
- [pull-stringify](https://npm.io/package/pull-stringify.md) ^2.0.0
- [observ-debounce](https://npm.io/package/observ-debounce.md) ^1.1.1
- [broadcast-stream](https://npm.io/package/broadcast-stream.md) ^0.2.1
- [muxrpc-validation](https://npm.io/package/muxrpc-validation.md) ^2.0.0
- [on-change-network](https://npm.io/package/on-change-network.md) 0.0.2
- [multiserver-address](https://npm.io/package/multiserver-address.md) ^1.0.1
- [stream-to-pull-stream](https://npm.io/package/stream-to-pull-stream.md) ^1.6.10

## Recent versions

- 13.2.2 (latest) — 2018-12-14
- 11.3.5 (eleven-three) — 2019-04-29
- 12.2.4 (backport_12) — 2019-03-12
- 11.4.5 (backport_11) — 2019-03-12
- 11.3.4 — 2019-01-19
- 13.2.1 — 2018-11-28
- 13.2.0 — 2018-11-24
- 13.1.0 — 2018-11-16
- 13.0.3 — 2018-10-30
- 13.0.2 — 2018-10-29
- 13.0.1 — 2018-10-23
- 13.0.0 — 2018-10-14
- 12.2.3 — 2018-10-05
- 12.2.2 — 2018-10-03
- 12.2.1 — 2018-10-03
- … 185 more at https://npm.io/package/scuttlebot/versions

## README

# Scuttlebot

Scuttlebot is an open source **peer-to-peer log store** used as a database, identity provider, and messaging system.
It has:

 - Global replication
 - File-synchronization
 - End-to-end encryption

Scuttlebot behaves just like a [Kappa Architecture DB](http://www.kappa-architecture.com/).
In the background, it syncs with known peers.
Peers do not have to be trusted, and can share logs and files on behalf of other peers, as each log is an unforgeable append-only message feed.
This means Scuttlebots comprise a [global gossip-protocol mesh](https://en.wikipedia.org/wiki/Gossip_protocol) without any host dependencies.

**Join us in #scuttlebutt on freenode.**

[![build status](https://secure.travis-ci.org/ssbc/scuttlebot.png)](http://travis-ci.org/ssbc/scuttlebot)

## install

to get a known working shrinkwrapped version, install `scuttlebot-release`.
It is recommended to only use this repo for development.

```
npm install -g scuttlebot-release
```

`scuttlebot-release` uses an `npm-shrinkwrap.json` file,
so that it's possible to install it globally with known dependencies.
You can also use this to install old versions, with dependencies
that worked at that time.

## Applications

There are already several applications built on scuttlebot,
one of the best ways to learn about secure-scuttlebutt is to poke around in these applications.

* [patchwork](http://github.com/ssbc/patchwork) is a discussion platform that we use to anything and everything concerning ssb and decentralization.
* [patchbay](http://github.com/dominictarr/patchbay) is another take on patchwork - it's compatible, less polished, but more modular. The main goal of patchbay is to be very easy to add features to.
* [git-ssb](https://github.com/clehner/git-ssb) is git (& github!) on top of secure-scuttlebutt. Although we still keep our repos on github, primary development is via git-ssb.

it is recommended to get started with patchwork, and then look into git-ssb and patchbay.

## Example Usage
```bash
# In bash:

# Start the server with extra log detail
# Leave this running in its own terminal/window
sbot server --logging.level=info

# publish a message
sbot publish --type post --text "My First Post!"

# stream all messages in all feeds, ordered by publish time
sbot feed

# stream all messages in all feeds, ordered by receive time
sbot log

# stream all messages by one feed, ordered by sequence number
sbot hist --id $FEED_ID
```
```js
// In javascript:

var pull = require('pull-stream')
var ssbClient = require('ssb-client')

// create a scuttlebot client using default settings
// (server at localhost:8080, using key found at ~/.ssb/secret)
ssbClient(function (err, sbot) {
  if (err) throw err

  // publish a message
  sbot.publish({ type: 'post', text: 'My First Post!' }, function (err, msg) {
    // msg.key           == hash(msg.value)
    // msg.value.author  == your id
    // msg.value.content == { type: 'post', text: 'My First Post!' }
    // ...
  })

  // stream all messages in all feeds, ordered by publish time
  pull(
    sbot.createFeedStream(),
    pull.collect(function (err, msgs) {
      // msgs[0].key == hash(msgs[0].value)
      // msgs[0].value...
    })
  )

  // stream all messages in all feeds, ordered by receive time
  pull(
    sbot.createLogStream(),
    pull.collect(function (err, msgs) {
      // msgs[0].key == hash(msgs[0].value)
      // msgs[0].value...
    })
  )

  // stream all messages by one feed, ordered by sequence number
  pull(
    sbot.createHistoryStream({ id: < feedId > }),
    pull.collect(function (err, msgs) {
      // msgs[0].key == hash(msgs[0].value)
      // msgs[0].value...
    })
  )
})
```

## Use-cases

Scuttlebot's message-based data structure makes it ideal for mail and forum applications (see [Patchwork](https://ssbc.github.io/patchwork/)).
However, it is sufficiently general to be used to build:

 - Office tools (calendars, document-sharing, tasklists)
 - Wikis
 - Package managers

Because Scuttlebot doesn't depend on hosts, its users can synchronize over WiFi or any other connective medium, making it great for [Sneakernets](https://en.wikipedia.org/wiki/Sneakernet).

Scuttlebot is [eventually-consistent with peers](https://en.wikipedia.org/wiki/Eventual_consistency), and requires exterior coordination to create strictly-ordered transactions.
Therefore, by itself, it would probably make a poor choice for implementing a crypto-currency.
(We get asked that a lot.)

---

### Getting Started

- [Install](https://ssbc.github.io/docs/scuttlebot/install.html) - Setup instructions
- [Tutorial](https://ssbc.github.io/docs/scuttlebot/tutorial.html) - Primer on developing with Scuttlebot
- [API / CLI Reference](https://scuttlebot.io/apis/scuttlebot/ssb.html)

### Key Concepts

- [Secure Scuttlebutt](https://ssbc.github.io/scuttlebutt-protocol-guide/), Scuttlebot's global database protocol
- [Content Hash Linking](https://ssbc.github.io/docs/ssb/linking.html)
- [Secret Handshake](https://ssbc.github.io/docs/ssb/secret-handshake.html), Scuttlebot's transport-layer security protocol
- [Private Box](https://ssbc.github.io/docs/ssb/end-to-end-encryption.html), Scuttlebot's end-to-end security protocol
- [Frequently Asked Questions](https://ssbc.github.io/docs/ssb/faq.html)

### Further Reading

- [Design Challenge: Avoid Centralization and Singletons](https://ssbc.github.io/docs/articles/design-challenge-avoid-centralization-and-singletons.html)
- [Design Challenge: Sybil Attacks](https://ssbc.github.io/docs/articles/design-challenge-sybil-attack.html)
- [Using Trust in Open Networks](https://ssbc.github.io/docs/articles/using-trust-in-open-networks.html)


# License

MIT

---
_Source: https://npm.io/package/scuttlebot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
