Giter Site home page Giter Site logo

cloudpeers / tlfs Goto Github PK

View Code? Open in Web Editor NEW
60.0 60.0 3.0 1.98 MB

The Local-First SDK

Home Page: https://cloudpeers.co

License: MIT License

Rust 88.96% RenderScript 4.13% Dart 2.41% Shell 0.62% HTML 0.06% JavaScript 0.87% TypeScript 2.95%
local-first p2p

tlfs's People

Contributors

dvc94ch avatar rklaehn avatar wngr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tlfs's Issues

research mls

useful properties we care about

  • confidentiality
  • authenticity
  • forward secrecy
  • deniability
  • post compromise secrecy

make sure we are BEC

properties of BEC are:

  • self-update
  • eventual update (#53)
  • convergence
  • atomicity (#46)
  • authenticity
  • causal consistency
  • invariant preservation

authenticity

leaving this for after the mvp. we have a system of vouching that works well enough for the mvp

use signatures to perform acl checks is now possible. for this we need to take a bit more care to ensure convergence in the presence of revocations.

oplog

  • convergence root read permission / causally apply
  • convergence partial read permission
  • convergence revocation (replay) / key rotation
  • convergence accross different schemas
  • prune oplog and registry based on safe present
  • unjoin scheduling

Remove length prefix in path

For some types (most, see below), the length is always the same. For other types, having a length prefix messes with the sort order. So it would be good if we could get rid of the mandatory length prefix and suffix in paths.

Prepreq for fixing #72

pub enum Segment {
    /// Document identifier.
    Doc(DocId), // fixed size
    /// Peer identifier.
    Peer(PeerId), // fixed size
    /// Randomness used to ensure path uniqueness.
    Nonce(u64), // fixed size
    /// Boolean primitive.
    Bool(bool),  // fixed size
    /// Unsigned integer primitive.
    U64(u64),  // fixed size
    /// Signed integer primitive.
    I64(i64),  // fixed size
    /// Utf8 string primitive.
    Str(String), // variable size, length prefix?
    /// Policy statement.
    Policy(Policy),  // fixed size?
    /// Path identifier.
    Dot(Dot), // fixed size
    /// Positional identifier.
    Position(Fraction), // variable size, inline varint encoding
    /// Signature primitive.
    Sig(Signature), // fixed size
}

`Fraction` sorts incorrectly inside path

Fraction was created to insert at arbitrary points into an ORArray (#59). As the len is encoded inside the path segment prior to the bytes, this breaks the ordering inside the sled tree, which the ORArray implemention relies on.

Before the ORArray can really be used, this must be fixed.

mdns + invitation protocol

for the mvp we need some way of discovering local peers and adding them to the document. just giving them permission isn't enough without some mechanism to notify them?

text crdt

  • complete feature / add some tests
  • cursor api
  • note taking app demo

broadcast and unjoin scheduling

  • use libp2p-broadcast to send messages on apply/unjoin to all connected peers subscribed to a document
  • on connect and periodically, perform an unjoin with another connected peer

Make permission just a single value

The only situation where a set with more than 1 entry can happen is if somebody changes the value for a dot, which is an adversarial scenario.

I am quite confident that if somebody can edit the dot store he can cause all kinds of issues. So we don't consider this at this time and deal with it later in a more principled way.

related: #29

tlfs website

  • documentation
    • getting started (flutter/react todoapp)
    • api reference (dart/js/rust)
    • topic based guides

astro looks quite interesting

atomicity

support for atomic transactions (read committed transaction isolation)

mime blobs

  • build shopping list app with picture tasks

convergence

in a non byzantine setting we should always converge

related to #40, #35

Permissions as tree

When implementing join, I can do many things using very fast radix tree ops. E.g. removing expired from the store can be done with a single tree op instead of a loop.

E.g. this loop

        for buf in causal.store.iter() {
            let path = buf.as_path();
            if !self.expired.contains_prefix(path) && !causal.expired.contains_prefix(path) {
                if !self.can(peer, Permission::Write, path)? {
                    tracing::info!("join: peer is unauthorized to insert {}", path);
                    continue;
                }
                self.store.insert(&path);
            }
        }

can be turned into this:

        let mut store = causal.store.clone();
        store.tree_mut().remove_prefix_with(&self.expired.tree());
        store.tree_mut().remove_prefix_with(causal.expired.tree());
        for buf in store.iter() {
            let path = buf.as_path();
            if !self.can(peer, Permission::Write, path)? {
                tracing::info!("join: peer is unauthorized to insert {}", path);
                continue;
            }
            self.store.insert(&path);
        }

However, operations that involve permissions at present still involve querying permissions for every path.

It would be quite useful if we had a way to produce a tree for a permission and a peer, and then perform bulk operations for that tree. This would not change except when permissions are changed.

E.g.

let writeable = self.writeable(peer, Permission::Write);
store.tree_mut().retain_prefix_with(&writeable);

encrypted crdt

reduce trust in cloudpeer by storing and performing join/unjoin on an encrypted crdt. this requires a deterministic encryption scheme with the disadvantage of suceptibility to statistical analysis. This can be mitigated by mapping low entropy path segments to high entropy random path segments. A suitable cipher would a nonce reuse resistant cipher like aes-gcm-siv.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.