All Projects → hyperhyperspace → hyperhyperspace-core

hyperhyperspace / hyperhyperspace-core

Licence: MIT License
A library to create p2p applications, using the browser as a full peer.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to hyperhyperspace-core

Torrent Discovery
Discover BitTorrent and WebTorrent peers
Stars: ✭ 177 (+58.04%)
Mutual labels:  p2p, peer
mute-structs
MUTE-structs is a Typescript library that provides an implementation of the LogootSplit CRDT algorithm.
Stars: ✭ 14 (-87.5%)
Mutual labels:  p2p, crdt
Unstoppable Wallet Ios
A secure and decentralized Bitcoin and other cryptocurrency wallet for iPhone. Supports Bitcoin, Ethereum, EOS, Binance Chain, Bitcoin Cash, DASH, ...
Stars: ✭ 180 (+60.71%)
Mutual labels:  p2p, dapps
Hive
Fast. Scalable. Powerful. The Blockchain for Web 3.0
Stars: ✭ 142 (+26.79%)
Mutual labels:  p2p, dapps
P2p Graph
Real-time P2P network visualization with D3
Stars: ✭ 245 (+118.75%)
Mutual labels:  p2p, peer
Crdts
A library of Conflict-Free Replicated Data Types for JavaScript
Stars: ✭ 143 (+27.68%)
Mutual labels:  p2p, crdt
Appnet.link
Secure P2P HTTP Gateway as Tunnel Protocol
Stars: ✭ 203 (+81.25%)
Mutual labels:  p2p, peer
Android P2p Engine
Let your viewers become your unlimitedly scalable CDN.
Stars: ✭ 70 (-37.5%)
Mutual labels:  p2p, peer
peerchan
Fully decentralized p2p IRC for your terminal
Stars: ✭ 15 (-86.61%)
Mutual labels:  p2p, peer
Ipfs Pubsub Room
IPFS Pubsub room
Stars: ✭ 229 (+104.46%)
Mutual labels:  p2p, peer
Libcrtc
WebRTC C++ library built on top of chromium webrtc.
Stars: ✭ 89 (-20.54%)
Mutual labels:  p2p, peer
rdoc
Conflict-free replicated JSON implementation in native Go
Stars: ✭ 76 (-32.14%)
Mutual labels:  p2p, crdt
P2p Internet Workshop
Building the Peer-to-Peer Internet workshop series
Stars: ✭ 88 (-21.43%)
Mutual labels:  p2p, peer
P2p Cdn Sdk Javascript
Free p2p cdn github javascript sdk to reduce video streaming costs of live and on demand video using webrtc by upto 90% and improve scalability by 6x - 🚀 Vadootv 🚀
Stars: ✭ 158 (+41.07%)
Mutual labels:  p2p, peer
Cause
An EDN-like CRDT (Causal Tree) for Clojure & ClojureScript that automatically tracks history and resolves conflicts.
Stars: ✭ 68 (-39.29%)
Mutual labels:  p2p, crdt
Gun
An open source cybersecurity protocol for syncing decentralized graph data.
Stars: ✭ 15,172 (+13446.43%)
Mutual labels:  p2p, crdt
Y Ipfs Connector
Y.js connector over IPFS
Stars: ✭ 49 (-56.25%)
Mutual labels:  p2p, crdt
Discovery Swarm Webrtc
discovery-swarm for WebRTC
Stars: ✭ 56 (-50%)
Mutual labels:  p2p, peer
Redwood
A highly-configurable, distributed, realtime database that manages a state tree shared among many peers.
Stars: ✭ 218 (+94.64%)
Mutual labels:  p2p, crdt
Decentra-Network
This is an open source decentralized application network. In this network, you can develop and publish decentralized applications.
Stars: ✭ 58 (-48.21%)
Mutual labels:  p2p, dapps

Hyper Hyper Space

An offline-first shared data library for creating p2p apps that work in the browser (and now also NodeJs).

tldr;

This library helps you create distributed data structures, mostly for p2p applications. It works like an object store, where objects have to follow some conventions to enable secure remote sync. You can see an example here. More info (including how to run the example) below.

Intro

In the same way in which the Internet bridges networks together, the Hyper Hyper Space attempts to create a cryptographically secure append-only distributed data layer that makes information universally accessible. We follow two guiding principles:

  • Make all data local: always read and modify data locally
  • Communicate only through data sync: do not use APIs or any form of remoting

You can read our White Paper to find out more about how this works.

This project is experimental. All APIs may change, bugs exist and the crypto has not been audited.

Playground

You can play with the library, using it to synchronize a plain javascript object from your browser's console, in this playground page.

Examples

To create datatypes that can be shared using HHS, you need to extend the HashedObject and MutableObject classes. You can learn more on the Data Model section below, or jump to a few examples in this repo.

To run the example chat app, clone the examples repo and do

yarn build

yarn start

If you're using windows, replace start by winstart above.

Objectives

Enable the creation of p2p apps that work in-browser, without requiring any infrastructure, and that are as practical and functional as centralized apps. Find abstractions and algorithms that make creating and reasoning about these apps intuitive and predictable. Explore new models for online collaboration platforms that follow the p2p model yet are frictionless to use for the general public, and are

  • respectful of everyone's privacy and data ownership rights
  • transparent in their handling of information

by default.

Data model

HHS uses an immutable typed-objects local storage model. Objects are both retreived and cross-referenced using a structural hash of their contents as their id (a form of content-based addressing).

Mutability is implemented using CRDTs. Identities and data authentication are cryptographic.

Objects and their references form an immutable DAG, a fact that is used for data replication in HHS p2p mesh.

You can read more about HHS data model, including code samples, here.

Mesh network

A peer in the HHS mesh network is a pair containing an identity (i.e. a typed identity object per the data model above) and an endpoint (URL). The in-browser networking used by HHS is based on WebRTC. While this allows direct browser-to-browser data streams, WebRTC connection establishment needs the two parties to exchange a few messages out-of-band, using a signalling server. We have developed a tiny service (77 lines of python at the moment). While everyone can run their own, we are providing a public instance running at the URL wss://mypeer.net:443. To listen for peer connections, the browser will form an endpoint using the signalling server URL and some arbitrary information (usually involving its identity hash, but that is determined by the app), and connect to the signalling server over a websocket. To connect to another peer, the browser will open a websocket to the other peer's signalling server. Two peers don't need to use the same signalling server to be able to connect.

Peer groups use simple randomized algorithms to choose how peers interconnect to each other within the group, epidemic gossip to discover any new state, and cryptographically secured deltas to send missing operations back and forth.

Apps will configure groups of peers, and the HHS mesh provides primitives for effortlessly synchronizing objects within each peer group (this boils down to syncrhonizing their sets of CRDT operations for each shared object).

Spaces

A space is a data unit that can be shared and discovered easily. It has root object that can be used to bootstrap and synchronize the space.

Project status

There is a demo of a simple fully in-browser p2p chat app running here. However, the library has been fully rewritten since that demo was created.

Re-wiring the demo to use the current version of the library is currently WIP. Check out the Account library in the next section.

Using outside the browser

If you need to use this library directly in NodeJs, outside of a web browser, you need to import @hyper-hyper-space/node-env.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].