← Open Nook

How Nook works

Nook is a chat app with text, voice, camera and screen share, like Discord. Each device encrypts everything before it sends it. The servers keep and pass on data that they cannot read.

The parts

PartWhat it does
The pageThe app in your browser, the desktop app, or the phone home screen. All encryption happens here.
A serverIt stores encrypted messages and files, and passes them on. Anybody can run one with Docker.
A clusterSeveral servers that keep copies of the same spaces. If one server stops, the app moves to the next one.

Spaces and invites

A space is a group. It has text channels, voice channels, notes and people.

A space is a code, such as K7M2-9QPT-VB2W. The code is also the key that opens the messages. The invite link puts the code after the #. A browser never sends that part to a server, so the server never sees the code.

Important: anybody with the invite link can join and read the space. Give the link only to people you trust.

Features

Your identity

Your device makes a secret key the first time you open Nook. This key is "you". It signs everything that you write. Every other device checks each signature. Thus a server cannot change a message or write a fake message in your name.

The key is on your devices only. If you lose all your devices and you have no backup, you lose the account.

Caution: anybody with your backup file can be you. Keep the file in a private place, and use a password.

How a message travels

  1. You write a message.
  2. Your device signs it with your identity key.
  3. Your device encrypts it with the space key (AES-GCM).
  4. The server stores the encrypted message and sends it to the others.
  5. Each device decrypts the message and checks the signature.

What is encrypted

WhatHowWho can read it
Messages, edits, reactions, names, channelsAES-GCM, with a key made from the space codePeople with the invite. After a removal, only the people still in the space.
Direct messagesAlso a key that only the two people shareThe two people
FilesAES-GCM, a new key for each file, sent inside the messagePeople who can read that message
Typing, presence, call setupThe space key, and signedPeople in the space
Your list of spaces, read marks, settingsA key made from your identityOnly your devices
Notifications when Nook is closedWeb Push encryption, made by the device of the senderOnly your browser
Voice, camera, screen shareDTLS-SRTP, between the browsersThe people in the call

What is not secret

The server must see some data to do its work:

Some features have limits:

Removals and bans

When an admin removes a person, the device of the admin makes a new space key at once. It sends a copy of the key to each person who stays. Nobody has to click anything. The removed person cannot read new messages.

The removed person can still join again with the old code, as a new person. A ban stops this. After a ban, a new invite needs a pass, and the old code alone does not let anybody in.

Voice, calls and screen share

Nook has no media server. Sound and video go from browser to browser with WebRTC.

The setup messages for a call are encrypted and signed. So a server cannot step into the middle of a call.

TURN relay: by default, all sound and video go through the TURN relay of the server. This hides the IP address of each person from the others. The relay cannot decrypt the media. A server owner can set NOOK_TURN_ONLY=0 to try a direct connection first.

Voice and screen share continue if the server restarts, because the media goes between the browsers.

Where data is kept

WhatWhere
Messages, channels, levelsPostgres on the server, and on every server of the cluster, encrypted
FilesThe disk of the server, encrypted
Your identity keyYour devices only
Voice and videoNowhere. Nook does not record calls.