Skip to content

Federated Server Setup

Jonathan Commins edited this page Jun 28, 2020 · 1 revision

Introduction

While GUN is primarily targeted at fully distributed systems with servers only acting as a known entry point into the network, some applications may require all data to be private.

One way of achieving this is to encrypt all connections used by GUN, resulting in corrupt messages if a peer does not know the decryption key. Encrypting all connections prevents unauthorized GUN instances of talking to peers it doesn't know the encryption key for.

Theory

Let's assume we have websocket library X, functional in both the browser and within Node.JS, which encrypts all connections using a symmetric encryption algorithm with a single key, yet otherwise works the same as for example ws

During the initialization of your GUN instance, you would indicate to use library X as it's websocket library instead of the default one. This would limit your instance to talking to only instances using the same setup, rendering your data & connections private.

On top of your instances, you now control all data flow in- and out of your data storage.

Example

To proof this theory, gun-private was created. It's using RC4 as the encryption algorithm and encrypts each websocket separately through a small wrapper.

This wiki is where all the GUN website documentation comes from.

You can read it here or on the website, but the website has some special features like rendering some markdown extensions to create interactive coding tutorials.

Please feel free to improve the docs itself, we need contributions!

Clone this wiki locally