Pear Runtime: Zero-Infrastructure, P2P High-Scale Applications

Introducing a combined Peer-to-Peer Runtime, Development & Deployment tool named Pear. Build, share & extend unstoppable, zero-infrastructure P2P applications. Welcome to the Internet of Peers. See docs.pears.com.

Rate this content
Bookmark
Video Summary and Transcription
Pear Runtime is a fully peer-to-peer platform designed for high-scale applications that operate on user devices without any reliance on cloud infrastructure. It is open source and can be installed using the MPX Pair command. Developers can use the Pair CLI to run applications such as the Keet messaging app, which is available on both the App Store and Google Play Store, ensuring no data collection. The platform supports building terminal, desktop, and mobile applications, offering inherent data security by preventing data leaks and manipulation. Pear P2P utilizes a hole-punching algorithm to bypass NAT restrictions, making peer connections seamless. The platform is built on a JavaScript runtime called Bear, which supports P2P primitives and the execution of native modules. Developers can find documentation and resources at docs.pairs.com to aid in creating applications with Pair Runtime.

This talk has been presented at JSNation 2024, check out the latest edition of this JavaScript Conference.

FAQ

Documentation and resources for Pair Runtime can be found at docs.pairs.com. The site includes tools, helpers, building blocks, how-tos, and videos to help you get started.

Yes, Pair Runtime is fully open source. You can review the code to verify its peer-to-peer architecture and ensure that no data is being harvested.

If you have Node installed, you can bootstrap Pair Runtime immediately with the command 'MPX Pair'. This installs a small Node script that bootstraps Pair from the peers.

Unlike blockchain, which uses a global state and federated system, Pair Runtime is fully peer-to-peer, with data living only on user devices. There is no central repository or cloud involved.

The 'pair run' command in the Pair CLI is used to run Pair applications. You can run both local folders and keys from the Distributed Hash Table (DHT) using this command.

You can build terminal applications, desktop applications, and mobile applications using Pair Runtime. It supports a variety of development and deployment commands to facilitate this.

Yes, Pair Runtime can run native modules. It supports writing and seeding C code that can be run by other peers.

Pair Runtime is a peer-to-peer runtime platform that allows for the creation and deployment of zero infrastructure, high-scale applications. It operates entirely on user devices without relying on cloud services.

Keet is a messaging application built on Pair Runtime. It runs on both desktop and mobile and has been verified by Apple and Google to collect no data.

The Distributed Hash Table (DHT) in Pair Runtime allows peers to discover each other and connect directly. It is used for seeding P2P state and running applications from seeds.

1. Introduction to Pair Runtime#

Short description:

Pair Runtime is a fully peer-to-peer runtime that operates on user devices, with no data stored in the cloud. It is open source and can be installed using MPX Pair. The CLI allows running applications built on Pair, such as the Keet messaging app, which is available on the App Store and Google Play Store and collects no data.

My name is David, and I'm the creator, along with my team, of Pair Runtime. This is about zero infrastructure, high-scale applications, but it's also an appeal to humanity in a way.

Let me ask this. What is the net total output of, like systemically speaking, of all of our human activities? Where is it taking us?

Pair is a peer-to-peer runtime. By peer-to-peer, I mean fully peer-to-peer. Local state, not like blockchain which is global state and federated, but literally peer-to-peer. The data lives on user devices and only on user devices. No cloud. Nothing. Just the peers. To show that it is what we say it is, Pair is open source. It's been open source since February. You can look through all of the code and verify that it is, in fact, peer-to-peer, and that no data is being harvested because it cannot actually be. It can't be.

If you have Node installed, you can bootstrap Pair immediately with MPX Pair. This installs a small Node script which bootstraps Pair from the peers. Pair is not Node. It's its own thing. You can use MPX Pair to install Pair from the peers at any time you like. As I say, it's fully open source, so feel free to look through before you do so.

It's a runtime. It installs a CLI. The CLI has a run command, pair run, the Pair protocol, and then a key. That key is a topic on a distributed hash table, a global distributed hash table that allows peers to discover each other and connect directly.

If you have pair installed, you can run pair run pair keet. This will open the Keet application. This is an application that has been built on Pair for messaging. It runs on desktop and mobile. You can scan this QR code to get it on mobile on the Play Store and the App Store. When you look down on the App Store and Play Store, you will see that both Apple and Google have verified that the application collects no data.

2. Pair Development and Deployment#

Short description:

Pair is a development and deployment tool that enables creating and running Pair applications on user devices. It is a JavaScript runtime called Bear, which supports P2P primitives and allows running native modules. Pair is a platform.

Pair is a development tool. It's a CLI tool that you can use to actually create Pair applications. These are the development commands. Pair init to create a Pair project, Pair stage which copies your file system state into a P2P structure called HyperCore, and Pair run, which you can use to run both local folders and keys from the DHT, application keys. Again, there is no infrastructure involved here. This is just peers talking to each other. The applications load from peers.

Pair is a deployment tool. These are some of the deployment commands. Pair seed. It seeds the P2P state to the DHT, to the distributed hash table, and allows others to then run from that seed. If you think of BitTorrent, it's like a next-generation BitTorrent, but the applications are representations, materialised views of append-only logs which are then torrented between the peers. Pair stage is a deployment tool because it's how you release. It's all about whether you share your key. You can have a public key, you can have a private key for the applications, an internal key, say. Pair release marks releases on a core.

Pair is a JavaScript runtime. Not only is it written in JavaScript, but it is also literally a JavaScript runtime because Pair is Bear. Bear is another project that we've made at HolePunch alongside Pair. They came up together. It's a minimal JavaScript runtime for desktop and mobile. We use it in both our mobile and our desktop app. We're moving to an architecture where both the desktop and the mobile apps run the same exact code in a worker, and then the UIs talk to them, and that code runs in Bear. It's a very, very fast node-like runtime with first-class support for P2P primitives. Therefore, Pair is also a native runtime, as well as a JavaScript runtime. You can run native modules with Bear. You can write straight up C, seed that out, and others can run that from you as a peer. No infrastructure, no cloud, nothing, just the peers.

Pair is a platform.

3. Pair Platform and Security#

Short description:

Pair is a platform for building terminal, desktop, and mobile applications. Pair also has self-building capabilities and provides all the necessary tools, helpers, and resources to easily create Pair applications. It offers inherent data security, ensuring that companies cannot leak user data and political organizations cannot manipulate it. Pair uses a hole-punching algorithm to bypass NAT restrictions and connect peers. It is designed for people, offering true security and simplicity in architecture.

Pair is a platform. We do terminal applications, desktop applications, mobile applications. We'll have more coming. There's APIs. There's configuration. And beyond that, Pair also builds itself. We build the platform with the platform. All those commands I showed you, we also use to make Pair itself. We make Pair with Pair. Pair is a way to build. See docs.pairs.com. We have tools, we have helpers, we have building blocks, we have how-tos, we have videos. We have everything you need to get started on building Pair application, and you'd be surprised how simple the architectures can become when you don't need infrastructure.

Pair is data secure. Inherently data secure. A company can't leak passwords if it doesn't have them. A political organization cannot mass-manipulate user data if they don't have it. That is true security. Users are vulnerable currently. Pair is unstoppable. Literally unstoppable. We use a hole-punching algorithm that bypasses NAT restrictions so that you can completely connect peers. It breaks through firewalls. Pair is for the peers. It's for us. It's for people. People as people. Think about it.

Thank you very much.

David Mark Clements
David Mark Clements
8 min
13 Jun, 2024

Comments

Sign in or register to post your comment.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

How Bun Makes Building React Apps Simpler & Faster
React Day Berlin 2022React Day Berlin 2022
9 min
How Bun Makes Building React Apps Simpler & Faster
BUN is a modern all-in-one JavaScript runtime environment that achieves new levels of performance. It includes BUN dev, a fast front-end dev server, BUN install, a speedy package manager, and BUN run, a fast package runner. BUN supports JSX, has optimized React server-side rendering, and offers hot module reloading on the server. The priorities for BUN include stability, node compatibility, documentation improvement, missing features in BUN install, AST plugin API, native Windows support, Bundler and Minifier optimization, and easier deployment to production. BUN's AST plugin API allows for bundle-time JavaScript execution and embedding code, potentially inspiring new frameworks.
Node.js Compatibility in Deno
Node Congress 2022Node Congress 2022
34 min
Node.js Compatibility in Deno
Deno aims to provide Node.js compatibility to make migration smoother and easier. While Deno can run apps and libraries offered for Node.js, not all are supported yet. There are trade-offs to consider, such as incompatible APIs and a less ideal developer experience. Deno is working on improving compatibility and the transition process. Efforts include porting Node.js modules, exploring a superset approach, and transparent package installation from npm.
Bun, Deno, Node.js? Recreating a JavaScript runtime from Scratch - Understand magic behind Node.js
Node Congress 2023Node Congress 2023
29 min
Bun, Deno, Node.js? Recreating a JavaScript runtime from Scratch - Understand magic behind Node.js
The Talk explores the magic behind Node.js and delves into its components, including V8, libuv, and the C++ bridge. It discusses the workflow and execution process, the use of NodeMod, and the understanding of console functions. The Talk also covers Node.js functions and scheduling, the introduction of runtimes, and the collaboration between JavaScript runtimes. It concludes with insights on content production, the choice of Node.js, and the inspiration behind it.
Eval all the strings! - Hardened JavaScript
Node Congress 2023Node Congress 2023
8 min
Eval all the strings! - Hardened JavaScript
NPM packages can be potentially dangerous, so it's important to be proactive in managing them. Lava Mode allows you to detect and investigate suspicious packages before deploying your app. Lavamote prevents unauthorized access to sensitive resources by isolating dependencies and using hardened JavaScript. Lava Mode makes it easier to analyze obfuscated files and understand their actions.
The Future of JavaScript Runtimes
Node Congress 2022Node Congress 2022
34 min
The Future of JavaScript Runtimes
Today's Talk explores the future of JavaScript runtimes, their evolution, and impact on software development. It discusses the historical trends of JavaScript, the adoption of new tools and libraries, and the convergence of Node and Deno. The emergence of isolate clouds and their potential to replace traditional VMs and containers is also highlighted. Additionally, the talk touches on the possibilities of JavaScript in exotic use cases, its impact on machine learning, and the potential for TypeScript to become the de facto language for JavaScript development.
Roll you own JavaScript runtime
Node Congress 2023Node Congress 2023
21 min
Roll you own JavaScript runtime
This Talk introduces Deno, a custom JavaScript runtime similar to Node.js, and discusses the benefits of using a custom runtime. It explores the process of building a custom runtime with Deno in Rust, including the integration with Cargo and the ability to mix and match crates and APIs. The Talk also covers the implementation of the setTimeout function in both Run.js and Runtime.js, and provides examples of how to fix errors and implement additional functions. Overall, the Talk highlights the flexibility and possibilities of creating custom runtimes with Deno.

Workshops on related topic

Build Peer-to-Peer Applications with Pear Runtime
JSNation 2024JSNation 2024
152 min
Build Peer-to-Peer Applications with Pear Runtime
WorkshopFree
David Mark Clements
David Mark Clements
Learn how to rapidly build peer-to-peer applications with Pear Runtime. No servers required. Understand peer-to-peer paradigms and construct applications from well-defined building blocks. This workshop will cover how to create both Desktop and Terminal applications (with discussion for Mobile) that work entirely peer-to-peer from anywhere in the world. By the end of this workshop you should know how to build a new type of highly scalable application with entirely reduced infrastructural costs (~0) along with suitable architectures and best practices for peer-to-peer applications. From the creator of Pear Runtime and the company that brings us keet.io. Table of content:- Introducing Pear- Initial Q & A- Getting Setup- Creating a Pear Desktop Application- Sharing a Pear Application- Running a Pear Application- Creating a Pear Terminal Application- Releasing a Pear Application- Architectural Discussions- Wrap-up Q & A