You are reading content from Scuttlebutt
@mix.exe %CYCXlGf/lXA19pDzYbxOG+9/6subQXnit6+8yhFKTx0=.sha256
Re: %4tVnMOLDb

here's the more accessible intro to ssb-tribes use + behaviour for those interested


Example Usage

const SecretStack = require('secret-stack')
const config = require('ssb-config')
const caps = require('ssb-caps')

const stack = SecretStack({ caps })
  .use(require('ssb-db'))        // << required
  .use(require('ssb-backlinks')) // << required index
  .use(require('ssb-query'))     // << required index
  .use(require('ssb-tribes'))
  .use(require('ssb-private1'))  // if you want to support old encryption
                                 // *order matters*, load tribes first
  .use(...)

const ssb = stack(config)
ssb.tribes.create({}, (err, info) => {
  const { groupId } = info

  const content = {
    type: 'post',
    test: 'kia ora, e te whānau',
    recps: [groupId] // <<< you can now put a groupId in the recps
  }
  ssb.publish(content, (err, msg) => {
    // tada msg is encrypted to group!

    const keks = '@YXkE3TikkY4GFMX3lzXUllRkNTbj5E+604AkaO1xbz8=.ed25519'
    const staltz = '@QlCTpvY7p9ty2yOFrv1WU1AE88aoQc4Y7wYal7PFc+w=.ed25519'

    ssb.tribes.invite(groupId, [keks, statlz], {}, (err, invite) => {
      // two friends have been sent an invite which includes the decryption key for the group
      // they can now read the message I just published, and publish their own messages to the group

    })
  })
})

Behaviour

This plugin provides functions for creating groups and administering things about them, but it also provides a bunch of "automatic" behviour.

  1. When you publish a message with recps it will auto-encrypt the content when:
    • there are 1-16 FeedIds (direct mesaaging)
    • there is 1 GroupId (private group messaging)
    • there is 1 GroupId followed by 1-15 FeedId
      • NOTE this is currently only recommended for group invite messages as it's easy to leak group info
  2. When you receive an encrypted message with suffix .box2 it will attempt to auto-decrypt the content:
    • on success this value will then be accessible in all database queries/ indexes
    • if it fails because it didn't have the key, the message gets passed to the next auto-decrypter to attempt
    • if it fails because something is clearly horribly wrong in the encyprtion and it should have worked, it throws an error (check this)
  3. When you receive an invite to a new group, you will auto-decrypt all messages
    • we re-index your whole database, which will reveal new messages you can decrypt
      • in the future we will only re-index messages you previously could not decrypt
    • keys for groups are stored in a off-chain key-store
  4. If you've been given the readKey for a particular message, you can use that
    • e.g. ssb.get({ id, private: true, key: readKey }, cb)
User has not chosen to be hosted publicly
@Anders %lCv6QS9T08qj707NGTMVrzKLj5jjir2klXh6CxoTi+k=.sha256

@gmarcos87 https://github.com/mixmix/ssb-tribes/issues/29

User has not chosen to be hosted publicly
Join Scuttlebutt now