9.6 KiB
Status Client Specification
Version: 0.1 (Draft)
Authors: Adam Babik adam@status.im, Dean Eigenmann dean@status.im, Oskar Thorén oskar@status.im (alphabetical order)
Table of Contents
- Abstract
- P2P Overlay
- Node discovery and roles
- Whisper adapter
- Secure Transport
- Data Sync
- Payloads and clients
- Design Rationale
- Footnotes
- Acknowledgements
Abstract
In this specification, we describe how to write a Status client for communicating with other Status clients.
We present a reference implementation of the protocol 1 that is used in a command line client 2 and a mobile app 3.
This document consists of two parts. The first outlines the specifications that have to be implemented in order to be a full Status client. The second gives a design rationale and answers some common questions.
Protocol layers
Implementing a Status clients means implementing the following layers. Additionally, there are separate specifications for things like key management and account lifecycle.
Layer | Purpose | Technology |
---|---|---|
Data and payloads | End user functionality | 1:1, group chat, public chat |
Data sync | Data consistency | MVDS Ratchet |
Secure transport | Confidentiality, PFS, etc | Double Ratchet |
Transport privacy | Routing, Metadata protection | Whisper |
P2P Overlay | Overlay routing, NAT traversal | devp2p |
P2P Overlay
Status clients run on the public Ethereum network, as specified by the devP2P network protocols. devP2P provides a protocol for node discovery which is in draft mode here. See more on node discovery and management in the next section.
To communicate between Ethereum nodes, the RLPx Transport Protocol, v5 is used, which allows for TCP-based communication between nodes.
On top of this we run the RLPx-based subprotocol Whisper v6 for privacy-preserving messaging.
There MUST be an Ethereum node that is capable of discovering peers and implements Whisper V6 specification.
Node discovery and roles
There are four types of node roles:
- Bootstrap nodes
- Whisper relayers
- Mailservers (servers and clients)
- Mobile nodes (Status Clients)
To implement a standard Status client you MUST implement the last node type. The other node types are optional, but we RECOMMEND you implement a mailserver client mode, otherwise the user experience is likely to be poor.
Bootstrapping
To connect to other Status nodes you need to connect to a bootstrap node. These nodes allow you to discover other nodes of the network.
Currently the main bootstrap nodes are provided by Status Gmbh, but anyone can run these provided they are connected to the rest of the Whisper network.
Discovery
To implement a Status client you need to discover peers to connect to. We use a light discovery mechanism based on a combination of Discovery v5 and Rendezvous Protocol, (with some modifications). Additionally, some static nodes MAY also be used.
This part of the system is currently underspecified and requires further detail.
Mobile nodes
This is a Whisper node which connects to part of the Whisper network. It MAY relay messages. See next section for more details on how to use Whisper to communicate with other Status nodes.
Whisper adapter
Once a Whisper node is up and running there are some specific settings required to commmunicate with other Status nodes.
See Status Whisper Usage Spec for more details.
Secure Transport
In order to provide confidentiality, integrity, authentication and forward secrecy of messages we implement a secure transport on top of Whisper. This is used in 1:1 chats and group chats, but not for public chats. See Status Secure Transport Spec for more.
Data Sync
MVDS is used for 1:1 and group chats, however it is currently not in use for public chats.
Status payloads are serialized and then wrapped inside a MVDS message which is added to an MVDS payload, this payload is then encrypted (if necessary for 1-to-1 / group-chats) and sent using whisper which also encrypts it.
Payloads and clients
On top of secure transport, we have various types of data sync clients and payload formats for things like 1:1 chat, group chat and public chat. These have various degrees of standardization. Please refer to Initial Message Payload Specification for more details.
Design Rationale
P2P Overlay
Why devp2p? Why not use libp2p?
At the time the main Status clients were being developed, devp2p was the most mature. However, it is likely we'll move over to libp2p in the future, as it'll provide us with multiple transports, better protocol negotiation, NAT traversal, etc.
For very experimental bridge support, see the bridge between libp2p and devp2p in Murmur.
What about other RLPx subprotocols like LES, and Swarm?
Status is primarily optimized for resource restricted devices, and at present time light client support for these protocols are suboptimal. This is a work in progress.
For better Ethereum light client support, see Re-enable LES as option. For better Swarm support, see Swarm adaptive nodes.
For transaction support, Status clients currently have to rely on Infura.
Status clients currently do not offer native support for file storage.
Why do you use Whisper?
Whisper is one of the three parts of the vision of Ethereum as the world computer, Ethereum and Swarm being the other two. Status was started as an encapsulation of and a clear window to this world computer.
I heard you were moving away from Whisper?
Whisper is not currently under active development, and it has several drawbacks. Among others:
- It is very wasteful bandwidth-wise and it doesn't appear to be scalable
- Proof of work is a poor spam protection mechanism for heterogenerous devices
- The privacy guarantees provided are not rigorous
- There's no incentives to run a node
Finding a more suitable transport privacy is an ongoing research effort, together with Vac and other teams in the space.
Why is PoW for Whisper set so low?
A higher PoW would be desirable, but this kills the battery on mobilephones, which is a prime target for Status clients.
This means the network is currently vulnerable to DDoS attacks. Alternative methods of spam protection are currently being researched.
Why do you not use Discovery v5 for node discovery?
At the time we implemented dynamic node discovery, Discovery v5 wasn't completed yet. Additionally, running a DHT on a mobile leads to slow node discovery, bad battery and poor bandwidth usage. Instead, each client can choose to turn on Discovery v5 for a short period of time until their peer list is populated.
For some further investigation, see here.
I heard something about mailservers being trusted somehow?
In order to use a mail server, a given node needs to connect to it directly, i.e. add the mailserver as its peer and mark it as trusted. This means that the mail server is able to send direct p2p messages to the node instead of broadcasting them. Effectively, it knows which topics the node is interested in, when it is online as well as many metadata like IP address.
Footnotes
- https://github.com/status-im/status-protocol-go/
- https://github.com/status-im/status-console-client/
- https://github.com/status-im/status-react/