Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

SCP-004: Discovery keys #5

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions scps/SCP-004.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## SCP-004: Discovery keys

**Goals**:
* Provide a first line of privacy for databases wanting to be kept private.
* Prevent snooping of database activities, more censorship resistance.
* More privacy of nodes storing a orbit-db database

**Definitions:**
* Discovery Key: A unique key used to address an orbitdb database without disclosing the original database address. Similar to I2P's daily floodfill key rotation.
* Shared Secret: Private key shared among authorized nodes.
* Key Rotation: When the discovery key is changed to a unique but deterministic value. Can be done via time based cycles or modifying a shared salt value.
* Key Salt:


**Pubsub Discovery**
is defined as the ability to correlate a pubsub channel name with a database address. By default orbitdb makes this apparent by setting the pubsub channel name the same as the database. By disclosing this information an adversary can easily determine which nodes are interested in what orbitdb databases.


**Pubsub Secrecy**
is defined as the secrecy of messages sent in the pubsub channel. Pubsubs messages can range of custom P2P calls to syncing database information from one node to another. It is best to have a first layer of encryption to protect these messages if the use case requires secrecy.

### Flow
1. Orbitdb database is started/created.
2. Discovery key is created by hashing the database address & additional salt if any -> Discovery key.
3. Shared secret is generated by hashing database address with a slightly different alogrithmn to be different value than the discovery key.
4. All peers subscribe to the discovery key via pubsub. All peers encrypt/decrypt pubsub messages using the shared secret.

### Notes
[[1](https://datprotocol.github.io/how-dat-works/#discovery-keys)]: `https://datprotocol.github.io/how-dat-works/#discovery-keys` Dat protocol (also known as hypercore) already has implemented discovery keys for "dat repos"