This is the monorepo for the TypeScript version of Hyper Hyper Space, version 3.0 (roadmap).
Hyper Hyper Space is a data sync engine focused on Authority Decentralization. It enables applications to run locally with full autonomy, and to sync their state securely over the open Internet even in the presence of malfunctioning or adversarial peers. Furthermore, it provides support for sophisticated behavioral rules, intended to enable applications that foster cooperative and productive interactions.
This new version has three main goals:
- Greater modularization. Previous versions of Hyper Hyper Space were bundled as a monolithic JavaScript app for usage in web browsers. While we still see the browser as a possible target, we're now trying to build a collection of modules that can be re-used on any platform. See below for the modules that have been ported to v3 so far.
- A new data model. We've developed a new formalism for coordination-free replication, Monotone View Types, in which observations are monotonic but explicitly version-scoped, allowing historical views to be refined as additional information becomes available. MVTs are a powerful monotonic transformation mechanism, that helps application developers create coordination-free approximations for applications in any domain. Learn more in the **mvt** module.
- Database integration. HHSv3 can be used as a secure, self-verifying bi-directional database replication protocol through the Rdb co-transactional database engine and its projection mechanism, with adapters for SQLite and IndexedDb.
The core sync engine is complete: the dag storage layer, mvt (Monotone View Types), replica, sync (synchronizer), and mesh (networking, plus transports and tracker) layers are all implemented and working together to enable live peer-to-peer state synchronization. A formal protocol specification covers the full architecture — from authenticated mesh channels through DAG exchange to type-level validation. Standard replicable types (RSet and RCap, with permissioned RSet composition) are available in the std_types module. The Causal/Relational database modules rdb, rdb_lang, rdb_runtime, rdb_repl, and rdb_tools are implemented (causal relational MVT model, C-SQL, browser-safe runtime, portable REPL tooling, and Node CLI). rdb_repl_web is an ephemeral browser REPL; try the live Causal DB demo. The rdb_adapter family (rdb_adapter, rdb_adapter_sqlite, rdb_adapter_idb, rdb_adapter_test, rdb_adapter_test_gen, and rdb_projection) projects an RDb into a regular relational database (SQLite, IndexedDB, or in-memory) and ingests local edits back, with rdb_projection supervising replica-wide, reactive bidirectional sync and mounting catalog FILES members as folders through rdb_files_node (local filesystem) and rdb_files_web (OPFS or a picked folder). rpack turns a catalog repository into signed release files (a catalog release and its past) that install and verify offline. rhost runs an app's databases on a device, one host per database, each with its own key and network settings: it installs those releases, deploys, syncs, and projects. It is browser-safe; rhost_node is the Node platform, rhost_client is the dependency-free client interface, and rhost_client_node reaches a running host over rhost.sock and its projected database. The rdb, rpack, rhost, and rkeys commands are the rdb_tools CLIs. Please see the individual module specs / README files for details.
This monorepo is organized as a collection of modules. This is of course WIP.
Data
- modules/mvt Monotone-View Types: DAG-based replicable object type system with nesting support
- modules/replica A replica that orchestrates Monotone View Type instances for synchronization
- modules/dag A DAG-based append-only log with fast fork/merge & covering operations
- modules/dag_sql SQL-backed storage for DAG entries and indices, using an abstract SQL connection interface
- modules/dag_sqlite SQLite bindings for the SQL DAG storage layer
- modules/dag_idb IndexedDB storage backend for DAG entries and indices
- modules/dag_test Shared test suites (backend parity, DAG creation helpers) reusable across DAG storage backends
- modules/std_types Standard replicable types (RSet, RCap, and permissioned RSet) built on the MVT framework
Causal/Relational database
- modules/rdb Causal/Relational database engine MVTs: RSchema, RTableGroup, RTable, RDb, and the RBlobStore and RFileMap behind catalog FILES
- modules/rpack Catalog releases: planned from a catalog repository's source and signed, as release files (a signed catalog release and its past) that install and verify offline
- modules/rhost Runs an app's databases on a device, one host each: installs releases, deploys, syncs and projects (browser-safe)
- modules/rhost_node The Node platform for rhost: app and host folders, SQLite stores, the user's keystore, node mesh,
run/rhost.sock - modules/rhost_client The client interface of an rhost host and its wire protocol, with no dependencies
- modules/rhost_client_node Reaches an rhost host from a Node app, over
run/rhost.sockand its projected database - modules/rdb_lang C-SQL: SQL-like language to parse, bind, compile, execute, and reverse-render RDb operations
- modules/rdb_runtime Browser-safe runtime: workspace, session, and C-SQL execution
- modules/rdb_repl Portable presentation and command tooling for RDb
- modules/rdb_tools Node REPL and CLIs (
rdb,rpack,rhost,rkeys), script runner - modules/rdb_repl_web Ephemeral browser REPL (live demo)
- modules/rdb_adapter Engine-agnostic projection/ingestion core (Rdb ⇄ relational database)
- modules/rdb_adapter_sqlite SQLite
MaterializationTargetfor rdb_adapter - modules/rdb_adapter_idb IndexedDB
MaterializationTargetfor rdb_adapter - modules/rdb_adapter_test Backend-agnostic conformance suites + fixtures for rdb_adapter targets
- modules/rdb_adapter_test_gen Shared pseudo-random RDb history generator for adapter fuzzers
- modules/rdb_projection Reactive supervisor for replica-wide, bidirectional projection of an RDb, and file mounts of its FILES members
- modules/rdb_files_node A file mount's folder on the local filesystem (
NodeDirectory) - modules/rdb_files_web A file mount's folder in the browser, over OPFS or a picked folder (
HandleDirectory)
Synchronization
- modules/sync Synchronizer for the replica module, using the mesh
Networking
- modules/mesh Peer discovery, authentication, connection pooling, topic multiplexing, swarm management, incoming connection handling with topic negotiation, and per-swarm authorization
- modules/mesh_ws WebSocket transport implementation for the mesh module
- modules/mesh_ws_browser Outbound-only browser WebSocket transport for the mesh module
- modules/mesh_bc BroadcastChannel transport and peer discovery for cross-tab mesh
- modules/mesh_folder_discovery Node-only peer discovery via presence files in a shared directory
- modules/mesh_tracker_client Tracker-based peer discovery client (PeerDiscovery implementation)
- modules/mesh_tracker Tracker server for peer discovery with identity management
- modules/mesh_node Node mesh factory (WebSocket, folder discovery, optional tracker)
- modules/mesh_browser Browser mesh factory (dial-only WebSocket, BroadcastChannel, optional tracker)
Libraries
- modules/crypto Cryptographic primitives: hashing, signing, KEM, AEAD, KDF with classical, hybrid and post-quantum suites
- modules/json JSON module for content-based addressing data structures
- modules/file_watch Kernel-driven file change watcher (
fs.watchwith rearm) - modules/util Collection of helper utilities used across HHS v3.0
To build the system, run
npm install
npm run build
The latest LTS versions of Node (v24.20.0) and NPM (11.13.0) are supported.
To run all the test suites, run
npm run test
This automatically excludes the large tests cases from the DAG module, that take a significant amount of time / memory to run (but it does run the same tests on smaller instances).