SSB private groups with ssb-db2

Overview

ssb-tribes2

TODO TODO

Installation

npm install ssb-tribes2

Usage in ssb-db2

  • Requires Node.js 12 or higher
  • Requires secret-stack@^6.2.0
  • Requires ssb-db2@>=5.0.0
  • TODO
 SecretStack({appKey: require('ssb-caps').shs})
   .use(require('ssb-master'))
+  .use(require('ssb-db2'))
   .use(require('ssb-conn'))
+  .use(require('ssb-tribes2'))
   .use(require('ssb-blobs'))
   .call(null, config)

TODO TODO

License

LGPL-3.0-only

Comments
  • add internal onCaughtUp API

    add internal onCaughtUp API

    Context

    This is an alternative to #20.

    Problem

    There is a race condition between the processing of messages in start() and the list() API. list() is supposed to have all the up-to-date information, but by just querying ssb-box2 (and ssb-keyring), it doesn't, because there may be a message from the live query in start() that still hasn't trickled down and made its way to ssb-box2 (and ssb-keyring).

    Solution

    We figured (pair programming with @Powersource) that we don't need to strictly solve the race condition in list() if we embrace eventual consistency in the apps, but in tests, we need to make strictly solve them, to make the correct assertions.

    This PR adds onCaughtUp(cb) as an internal API just for our tests. The way it works is a bit hacky, I wanted to use ssb.db.prepare() (which in turn is just a light wrapper for jitdb's prepare()) but the problem is that prepare() only syncs the bitvector indexes, it doesn't fetch the messages from the log (which is an asynchronous operation with the file system). That meant that the processing in start() is "slower" than jitdb prepare() which would meant that we are not yet caught up.

    That's why I added the comment:

    // This is a bit hacky, because it fixes the race condition with `start()`
    // by relying on ssb-db2 internals. This only works because the query in
    // `start()` was initiated before this one, and because ssb-db2 and jitdb
    // have an internal queue of queries that are executed in order.
    

    @arj03 Since you're good at race conditions, and since this is a hacky solution, I'd really appreciate your thoughts on this PR.

    opened by staltz 10
  • Use URIs instead of sigils

    Use URIs instead of sigils

    Fixes https://github.com/ssbc/ssb-tribes2/issues/13

    • [x] Maybe do https://github.com/ssbc/ssb-uri2/issues/18 before merging to make the code here cleaner
      • [x] If we do the above then uninstall ssb-ref again
    • [x] Should we update buildGroupId to not calculate on sigil keys? I guess? no. see comment below
      • [x] We might need to update the envelope spec? Depends on how encode works i guess? What's SLP? https://github.com/ssbc/envelope-spec/tree/master/cloaked_msg_id
    opened by Powersource 7
  • Cloaked links should be URIs not sigils

    Cloaked links should be URIs not sigils

    It's the future :sparkles:

    Made some related issues https://github.com/ssbc/private-group-spec/issues/17 https://github.com/ssbc/ssb-uri-spec/issues/15

    should 
    opened by Powersource 4
  • use ssb-meta-feeds according to group spec

    use ssb-meta-feeds according to group spec

    Spiritual successor to the meta-feeds branch.

    Implements the metafeeds group spec.

    Asking for a review from @Powersource.

    And for visibility, pinging @mixmix .

    opened by staltz 3
  • Run on buttwoo instead of classic

    Run on buttwoo instead of classic

    Based on https://github.com/ssbc/ssb-tribes2/pull/8

    Fixes https://github.com/ssbc/ssb-tribes2/issues/10

    Doing this for now since I think it'll cover our usecases, but in the future I guess we should do https://github.com/ssbc/ssb-tribes2/issues/9

    opened by Powersource 3
  • Add getGroupTangle

    Add getGroupTangle

    based on https://github.com/ssbc/ssb-tribes2/pull/2

    We need this to add correct group tangles to group messages

    • [x] probably combine addGroupTangle and create into a function with better dx, that we then probably expose in the top level api
    opened by Powersource 3
  • Detect too big group tangle previous array by failing to publish, and prune it

    Detect too big group tangle previous array by failing to publish, and prune it

    As an alternative to calculating the size https://github.com/ssbc/ssb-tribes2/pull/8

    • [x] Import needed code from other PR
    • [x] Remove unused code
    • [x] Add test with 5000 msgs and time it
    opened by Powersource 2
  • Require tangles.group.previous to be at least size 1

    Require tangles.group.previous to be at least size 1

    In the current tanglePrune code from tribes1 it is able to prune until the previous array is empty. Is that a good idea or likely to break tangle logic?

    https://github.com/ssbc/ssb-tribes2/blob/ff6905b7638220073f8c292cee648d8e99cc8a49/lib/tangle-prune.js#L23-L28

    opened by Powersource 2
  • Actually run it on buttwoo

    Actually run it on buttwoo

    related https://github.com/ssbc/ssb-tribes2/issues/9

    right now i'm adapting this pr https://github.com/ssbc/ssb-tribes2/pull/8 to assume we're publishing on buttwoo instead of classic (like old tribes1). i've swapped json.stringify for bipf size checking but the size is still limited to 8k. buttwoo supposedly has a limit of 16k which changes things.

    opened by Powersource 2
  • Make stuff work on feed encodings other than buttwoo

    Make stuff work on feed encodings other than buttwoo

    Working on https://github.com/ssbc/ssb-tribes2/pull/8 there's code in tanglePrune that assumed how the content of a msg is stringified. In tribes1 it assumed classic with json.stringify, now I'm thinking of assuming buttwoo with bipf. But it should probably be generalized or at least documented that it (or at least that feature) only supports 1 format.

    opened by Powersource 2
  • Match create and addMembers messages against spec

    Match create and addMembers messages against spec

    Fixes https://github.com/ssbc/ssb-tribes2/issues/18

    • [x] add for create
    • [x] add for addMembers
    • [x] include tests from tribes1
    • [x] see that tests actually pass once https://github.com/ssbc/ssb-tribes2/pull/20 is merged
    • [x] wait for https://github.com/ssbc/private-group-spec/pull/19 to be merged and published and update package.json here
    opened by Powersource 1
  • Re-add checking of add-member spec

    Re-add checking of add-member spec

    It's disabled for some reason

    https://github.com/ssbc/ssb-tribes2/blob/206138ecabb88f0f807e4d3e2218808d53db79ab/index.js#L21

    https://github.com/ssbc/ssb-tribes2/blob/206138ecabb88f0f807e4d3e2218808d53db79ab/index.js#L196-L198

    should 
    opened by Powersource 1
  • addMember + listInvites + acceptInvite

    addMember + listInvites + acceptInvite

    The addMember API should be renamed to "inviteMember".

    The start() listener should NOT add the keys to ssb-box2, should NOT perform reindexEncrypted.

    A new API listInvites that gives a pull-stream source of all the invites (group/add-member) you have received but haven't yet "accepted".

    A new inviteMember API that allows you to acknowledge a group/add-member, add the keys to ssb-box2, and begin reindexEncrypted.

    must 
    opened by staltz 7
  • Members tangle should init at some point

    Members tangle should init at some point

    We have this issue for making the member tangle work properly https://github.com/ssbc/ssb-tribes2/issues/28 which i imagine means setting the previous correctly. But until we do that we shouldn't break stuff for ourselves in the future. Currently when a member is added we make the member tangle point at the group root msg.

    https://github.com/ssbc/ssb-tribes2/blob/133fcefe9a2c910c0226f2b284f9c6688518a805/index.js#L135-L138

    But that doesn't really make sense since in that root message we don't init the member tangle

    https://github.com/ssbc/ssb-tribes2/blob/133fcefe9a2c910c0226f2b284f9c6688518a805/index.js#L49-L54

    Easiest way to fix this is to add

    members: { root: null, previous: null }
    

    after line 52. It would maybe make more sense to only init it once we need it (on first member add i.e. admin adding themselves) but that's slightly more complicated.

    should 
    opened by Powersource 2
Owner
Secure Scuttlebutt Consortium
A distributed and secure peer to peer social network
Secure Scuttlebutt Consortium
devDependency to test feed formats for ssb-db2

ssb-feed-format A tool that you install as a devDependency to check whether your feed format for SSB is correct and ready to be installed in ssb-db2.

Secure Scuttlebutt Consortium 3 Jun 18, 2022
A Tailwind plugin that allows to create multiple groups utilities such as group-card or group-1 and works with Tailwind 3 features and all variations.

Tailwind Labeled Groups A plugin that allows to create multiple groups utilities such as group-card or group-1 and works with Tailwind 3 features and

Max 18 Nov 21, 2022
Open-sourced version of Orbis groups.

Documentation: Orbis SDK This example is built using the Orbis SDK that developers can use to created decentralized and composable social applications

Orbis 23 Dec 24, 2022
The simplest implementation of Golang channels, selects and wait groups

TypeScript Channels The simplest implementation of Golang channels, selects and wait groups Installation You can use one of the following package mana

Dimitar Ruskov 9 Dec 8, 2022
This Photoshop script exports all top-level layers and groups to cropped PNG and JPEG files and creates a file usable in Tumult Hype 4 based on your Photoshop document.

Export To Hype (Photoshop Edition) This Photoshop script exports all top-level layers and groups to cropped PNG and JPEG files and creates a file usab

Max Ziebell 6 Nov 9, 2022
Please do not use this tracker to scam anyone! This is free and will be forever free. This tracking will never ask for seed phrases nor private keys. Keep safe!

CryptoBlades Tracker Related modules express - web application framework for node pug - template engine stylus - pre-processor CSS mongoose - nodejs o

null 355 Oct 13, 2022
A Custom Growtopia Private's Server's (GTPS) HTTP

your-http sources-code Features Previews Files-Editing Crashing Installations previews Explanations wl's will replaced to your servers name develop by

Freeeeeeeeenzy 1 Dec 24, 2021
Generate random ethereum wallets & private keys and then check if they match a wallet that contains some kind of balance, so that you can take it. In Node.js

Ethereum-Stealer Generate random ethereum wallets & private keys and then check if they match a wallet that contains some kind of balance, so that you

Michał 74 Dec 24, 2022
A fast Protocol 6 Agar.io client for private servers

Cigar3 A fast Protocol 6 Agar.io client for private servers Getting started. After installing nodejs, run npm install and npm run cigar3 in a terminal

Lenny 5 Mar 6, 2022
Preview Notion's private links in Slack

slack-notion-preview English | 日本語 Description A Slack App that shows a preview of a private Notion link posted to Slack. Features Notion article titl

Anycloud 30 Nov 16, 2022
Downloads & formats all of your Roblox private messages.

Roblox Message Downloader This tool was created due to the recent news sent out by Roblox. On April 22nd, 2022, all private messages sent by Roblox be

Raincoat Games 2 Apr 7, 2022
Framework for interacting with instagrams private api in a usable manner (forked from andre's work and improved and fixed)

node-ig-framework Framework for interacting with instagrams private api in a usable manner (forked from andre's work and improved and fixed) Installat

nine ecksen 3 Dec 31, 2022
Mag🔥Lit - A super fast and easy-to-use free and open source private encrypted Magnet/HTTP(s) Link Shortener

Mag ?? Lit Mag ?? Lit - A super fast and easy-to-use free and open source private encrypted Magnet/HTTP(s) Link Shortener https://maglit.ml Features ✅

null 280 Jan 8, 2023
A private chatroom for discussing secret stuff.

?? Socket.IO IRC A private chatroom for discussing secret stuff. The Problem Almost all chatapps nowadays aren't safe enough for private communication

Melvin Chia 6 Aug 16, 2022
📬 A quick comparison of private and / or secure email providers

?? Email Comparison A comparison table of private and / or secure email providers Live App The app can be accessed at: lissy93.github.io/email-compari

Alicia Sykes 47 Dec 15, 2022
This private repository generates the URL and requests to PACS for DICOMweb WADO-RS/URI.

CSY-DICOMweb-WADO-RS-URI This private repository generates the URL and requests to PACS for DICOMweb WADO-RS/URI. DICOM WADO DICOMweb WADO-RS https://

null 4 Aug 2, 2022
🍣 CLI to handle Private Git Submodules in your Vercel Project

vercel-submodules: The CLI to handle Private Git Submodules in your Vercel Project This project is community-driven and not affiliated with Vercel in

Juno 37 Jan 1, 2023
Onchain private messaging app with a significant encryption algorithm.

Hedwig DEMO We want to implement SSL technology to blockchain so decided to build onchain private messaging app. Diffie Hellman protocol was invented

İzzet Emre Demir 5 Nov 3, 2022
The original SSB feed format, for ssb-db2

ssb-classic This module is a plugin for ssb-db2 which implements the classic SSB feed format. You can use this module as an ssb-db2 plugin, or you can

Secure Scuttlebutt Consortium 3 Jun 18, 2022
devDependency to test feed formats for ssb-db2

ssb-feed-format A tool that you install as a devDependency to check whether your feed format for SSB is correct and ready to be installed in ssb-db2.

Secure Scuttlebutt Consortium 3 Jun 18, 2022