Description
This file explains the process of local development for this repository.
Dependencies
This repository is built using Jekyll along with some plugins and a theme.
To install the necessary dependencies on Ubuntu use:
sudo apt-get install ruby-full build-essential zlib1g-dev
+ DEVELOPMENT - Status Specification DEVELOPMENT | Status Specification Description
This file explains the process of local development for this repository.
Dependencies
This repository is built using Jekyll along with some plugins and a theme.
To install the necessary dependencies on Ubuntu use:
sudo apt-get install ruby-full build-essential zlib1g-dev
gem install jekyll bundler
It might be necessary to specify installation destination for your Gems:
export GEM_HOME="$HOME/.gems"
export PATH="$HOME/gems/bin:$PATH"
diff --git a/draft/12.html b/draft/12.html
index 637828a..bae224d 100644
--- a/draft/12.html
+++ b/draft/12.html
@@ -1,4 +1,4 @@
- 12/IPFS gateway for Sticker Pack - Status Specification 12/IPFS gateway for Sticker Pack | Status Specification 12/IPFS gateway for Sticker Pack
Version: 0.1.0
Status: Draft
Authors: Gheorghe Pinzaru gheorghe@status.im
Table of Contents
Abstract
This specification describes how Status uses the IPFS gateway to store stickers. The specification explores image format, how a user uploads stickers and how an end user can see them inside the Status app.
Definition
Term Description Stickers A set of images which can be used to express emotions Sticker Pack ERC721 token which includes the set of stickers IPFS P2P network used to store and share data, in this case, the images for the stickerpack
Specification
Image format
Accepted image file types are PNG
, JPG/JPEG
and GIF
, with a maximum allowed size of 300kb. The minimum sticker image resolution is 512x512, and its background SHOULD be transparent.
Distribution
The node implements sticker packs as ERC721 token and contain a set of stickers. The node stores these stickers inside the sticker pack as a set of hyperlinks pointing to IPFS storage. These hyperlinks are publicly available and can be accessed by any user inside the status chat. Stickers can be sent in chat only by accounts that own the sticker pack.
IPFS gateway
At the moment of writing, the current main Status app uses the Infura gateway. However, clients could choose a different gateway or to run own IPFS node. Infura gateway is an HTTPS gateway, which based on an HTTP GET request with the multihash block will return the stored content at that block address.
The node requires the use of a gateway to enable easy access to the resources over HTTP. The node stores each image of a sticker inside IPFS using a unique address that is derived from the hash of the file. This ensures that a file can’t be overridden, and an end-user of the IPFS will receive the same file at a given address.
Security
The IPFS gateway acts as an end-user of the IPFS and allows users of the gateway to access IPFS without connection to the P2P network. Usage of a gateway introduces potential risk for the users of that gateway provider. In case of a compromise in the security of the provider, meta information such as IP address, User-Agent and other of its users can be leaked. If the provider servers are unavailable the node loses access through the gateway to the IPFS network.
Status sticker usage
When the app shows a sticker, the Status app makes an HTTP GET request to IPFS gateway using the hyperlink.
To send a sticker in chat, a user of Status should buy or install a sticker pack.
To be available for installation a Sticker Pack should be submitted to Sticker market by an author.
Submit a sticker
To submit a sticker pack, the author should upload all assets to IPFS. Then generate a payload including name, author, thumbnail, preview and a list of stickers in the EDN format. Following this structure:
{meta {:name "Sticker pack name"
+ 12/IPFS gateway for Sticker Pack - Status Specification 12/IPFS gateway for Sticker Pack | Status Specification 12/IPFS gateway for Sticker Pack
Version: 0.1.0
Status: Draft
Authors: Gheorghe Pinzaru gheorghe@status.im
Table of Contents
Abstract
This specification describes how Status uses the IPFS gateway to store stickers. The specification explores image format, how a user uploads stickers and how an end user can see them inside the Status app.
Definition
Term Description Stickers A set of images which can be used to express emotions Sticker Pack ERC721 token which includes the set of stickers IPFS P2P network used to store and share data, in this case, the images for the stickerpack
Specification
Image format
Accepted image file types are PNG
, JPG/JPEG
and GIF
, with a maximum allowed size of 300kb. The minimum sticker image resolution is 512x512, and its background SHOULD be transparent.
Distribution
The node implements sticker packs as ERC721 token and contain a set of stickers. The node stores these stickers inside the sticker pack as a set of hyperlinks pointing to IPFS storage. These hyperlinks are publicly available and can be accessed by any user inside the status chat. Stickers can be sent in chat only by accounts that own the sticker pack.
IPFS gateway
At the moment of writing, the current main Status app uses the Infura gateway. However, clients could choose a different gateway or to run own IPFS node. Infura gateway is an HTTPS gateway, which based on an HTTP GET request with the multihash block will return the stored content at that block address.
The node requires the use of a gateway to enable easy access to the resources over HTTP. The node stores each image of a sticker inside IPFS using a unique address that is derived from the hash of the file. This ensures that a file can’t be overridden, and an end-user of the IPFS will receive the same file at a given address.
Security
The IPFS gateway acts as an end-user of the IPFS and allows users of the gateway to access IPFS without connection to the P2P network. Usage of a gateway introduces potential risk for the users of that gateway provider. In case of a compromise in the security of the provider, meta information such as IP address, User-Agent and other of its users can be leaked. If the provider servers are unavailable the node loses access through the gateway to the IPFS network.
Status sticker usage
When the app shows a sticker, the Status app makes an HTTP GET request to IPFS gateway using the hyperlink.
To send a sticker in chat, a user of Status should buy or install a sticker pack.
To be available for installation a Sticker Pack should be submitted to Sticker market by an author.
Submit a sticker
To submit a sticker pack, the author should upload all assets to IPFS. Then generate a payload including name, author, thumbnail, preview and a list of stickers in the EDN format. Following this structure:
{meta {:name "Sticker pack name"
:author "Author Name"
:thumbnail "e30101701220602163b4f56c747333f43775fdcbe4e62d6a3e147b22aaf6097ce0143a6b2373"
:preview "e30101701220ef54a5354b78ef82e542bd468f58804de71c8ec268da7968a1422909357f2456"
diff --git a/draft/13.html b/draft/13.html
index 35e2c41..bb84402 100644
--- a/draft/13.html
+++ b/draft/13.html
@@ -1 +1 @@
- 13/3RD-PARTY-USAGE - Status Specification 13/3RD-PARTY-USAGE | Status Specification 13/3RD-PARTY
Version: 0.1
Status: Draft
Authors: Volodymyr Kozieiev volodymyr@status.im
Third party APIs used for core functionality
Table of Contents
- Abstract
- Definitions
- Why 3rd party API can be a problem?
- 3rd party APIs used by Status
- Changelog
- Copyright
Abstract
This specification discusses 3rd party APIs that Status relies on. These APIs provide various capabilities such as:
- communicate with the Ethereum network
- allow users to see address and transaction details on external website
- get fiat/crypto exchange rates
- get information about collectibles
- hosts privacy policy
Definitions
Term Description Fiat money Currency which established as money, often by government regulation, but that has no intrinsic value Full node Any computer, connected to the Ethereum network, which fully enforces all the consensus rules of Ethereum. Crypto-collectible A cryptographically unique, non-fungible digital asset . Unlike cryptocurrencies, which require all tokens to be identical, each crypto-collectible token is unique or limited in quantity.
Why 3rd party API can be a problem?
Relying on 3rd party APIs interferes with censorship resistance
Status principle. Since Status aims to avoid suppression of information it is important to reduce amount of 3rd parties crucial for app functionality.
3rd party APIs used by current Status app
Infura
What is it?
Infura hosts a collection of full nodes for the Ethereum network and provides an API to access both the Ethereum and IPFS networks without having to run a full node.
How Status use it?
Status works on mobile devices and therefore can’t rely on local node. So all communication to Ethereum network happens via Infura.
Concerns
Making a HTTP request means that a user leaks metadata, which can be used in various attacks if an attacker hacks the service. Infura hosts on centralized providers. If these fail or the provider cuts off service, then Status features requiring Ethereum calls will.
Etherscan
What is it?
Etherscan is a service that allows user to explore and search the Ethereum blockchain for transactions, addresses, tokens, prices and other activities taking place on Ethereum.
How Status use it?
Status Wallet allows users to view details of addresses and transactions on Etherscan.
Concerns
If Etherscan fails user won’t be able to view address or transaction details with it. But inside the app this info will still be available.
CryptoCompare
What is it?
CryptoCompare is a service that shows live streaming prices, charts and analysis from top crypto exchanges.
How Status use it?
Status regularly fetches crypto prices from CryptoCompare. Using that info Status calculates fiat value for transaction or wallet assets.
Concerns
Making a HTTP request means that a user leaks metadata, which can be used in various attacks if an attacker hacks the service. If CryptoCompare fails Status won’t be able to show fiat equivalent of crypto in wallet.
Collectibles
There is a set of services that used for getting information about collectibles:
- https://api.pixura.io/graphql
- https://www.etheremon.com/api
- https://us-central1-cryptostrikers-prod.cloudfunctions.net/cards/
- https://api.cryptokitties.co/
Concerns
Making a HTTP request means that a user leaks metadata, which can be used in various attacks if an attacker hacks the service.
Iubenda
What is it?
Service that helps in creating documents that make websites and apps compliant with the law across multiple countries and legislations.
How Status use it?
Privacy policy of Status hosted on Iubenda.
Concerns
If Iubenda fails Status users won’t be able to navigate to app’s privacy policy.
Changelog
Version Comment 0.1.0 Initial Release
Copyright
Copyright and related rights waived via CC0.
+ 13/3RD-PARTY-USAGE - Status Specification 13/3RD-PARTY-USAGE | Status Specification 13/3RD-PARTY
Version: 0.1
Status: Draft
Authors: Volodymyr Kozieiev volodymyr@status.im
Third party APIs used for core functionality
Table of Contents
- Abstract
- Definitions
- Why 3rd party API can be a problem?
- 3rd party APIs used by Status
- Changelog
- Copyright
Abstract
This specification discusses 3rd party APIs that Status relies on. These APIs provide various capabilities such as:
- communicate with the Ethereum network
- allow users to see address and transaction details on external website
- get fiat/crypto exchange rates
- get information about collectibles
- hosts privacy policy
Definitions
Term Description Fiat money Currency which established as money, often by government regulation, but that has no intrinsic value Full node Any computer, connected to the Ethereum network, which fully enforces all the consensus rules of Ethereum. Crypto-collectible A cryptographically unique, non-fungible digital asset . Unlike cryptocurrencies, which require all tokens to be identical, each crypto-collectible token is unique or limited in quantity.
Why 3rd party API can be a problem?
Relying on 3rd party APIs interferes with censorship resistance
Status principle. Since Status aims to avoid suppression of information it is important to reduce amount of 3rd parties crucial for app functionality.
3rd party APIs used by current Status app
Infura
What is it?
Infura hosts a collection of full nodes for the Ethereum network and provides an API to access both the Ethereum and IPFS networks without having to run a full node.
How Status use it?
Status works on mobile devices and therefore can’t rely on local node. So all communication to Ethereum network happens via Infura.
Concerns
Making a HTTP request means that a user leaks metadata, which can be used in various attacks if an attacker hacks the service. Infura hosts on centralized providers. If these fail or the provider cuts off service, then Status features requiring Ethereum calls will.
Etherscan
What is it?
Etherscan is a service that allows user to explore and search the Ethereum blockchain for transactions, addresses, tokens, prices and other activities taking place on Ethereum.
How Status use it?
Status Wallet allows users to view details of addresses and transactions on Etherscan.
Concerns
If Etherscan fails user won’t be able to view address or transaction details with it. But inside the app this info will still be available.
CryptoCompare
What is it?
CryptoCompare is a service that shows live streaming prices, charts and analysis from top crypto exchanges.
How Status use it?
Status regularly fetches crypto prices from CryptoCompare. Using that info Status calculates fiat value for transaction or wallet assets.
Concerns
Making a HTTP request means that a user leaks metadata, which can be used in various attacks if an attacker hacks the service. If CryptoCompare fails Status won’t be able to show fiat equivalent of crypto in wallet.
Collectibles
There is a set of services that used for getting information about collectibles:
- https://api.pixura.io/graphql
- https://www.etheremon.com/api
- https://us-central1-cryptostrikers-prod.cloudfunctions.net/cards/
- https://api.cryptokitties.co/
Concerns
Making a HTTP request means that a user leaks metadata, which can be used in various attacks if an attacker hacks the service.
Iubenda
What is it?
Service that helps in creating documents that make websites and apps compliant with the law across multiple countries and legislations.
How Status use it?
Privacy policy of Status hosted on Iubenda.
Concerns
If Iubenda fails Status users won’t be able to navigate to app’s privacy policy.
Changelog
Version Comment 0.1.0 Initial Release
Copyright
Copyright and related rights waived via CC0.
diff --git a/draft/14.html b/draft/14.html
index a7c58ff..1e9ad71 100644
--- a/draft/14.html
+++ b/draft/14.html
@@ -1 +1 @@
- 14/Dapp browser API usage - Status Specification 14/Dapp browser API usage | Status Specification Dapp browser API usage
Table of Contents
Abstract
This document describes requirements that an application must fulfill in order to provide a proper environment for Dapps running inside a browser. A description of the Status Dapp API is provided, along with an overview of bidirectional communication underlying the API implementation. The document also includes a list of EIPs that this API implements.
Definitions
Term Description Webview Platform-specific browser core implementation. Ethereum Provider A JS object (window.ethereum
) injected into each web page opened in the browser providing web3 compatible provider. Bridge A set of facilities allow bidirectional communication between JS code and the application.
Overview
The application should expose an Ethereum Provider object (window.ethereum
) to JS code running inside the browser. It is important to have the window.ethereum
object available before the page loads, otherwise Dapps might not work correctly.
Additionally, the browser component should also provide bidirectional communication between JS code and the application.
Usage in Dapps
Dapps can use the below properties and methods of window.ethereum
object.
Properties
isStatus
Returns true. Can be used by the Dapp to find out whether it’s running inside Status.
status
Returns a StatusAPI
object. For now it supports one method: getContactCode
that sends a contact-code
request to Status.
Methods
isConnected
Similarly to Ethereum JS API docs, it should be called to check if connection to a node exists. On Status, this fn always returns true, as once Status is up and running, node is automatically started.
scanQRCode
Sends a qr-code
Status API request.
request
request
method as defined by EIP-1193.
Unused
Below are some legacy methods that some Dapps might still use.
enable
(DEPRECATED)
Sends a web3
Status API request. It returns a first entry in the list of available accounts.
Legacy enable
method as defined by EIP1102.
send
(DEPRECATED)
Legacy send
method as defined by EIP1193.
sendAsync
(DEPRECATED)
Legacy sendAsync
method as defined by EIP1193.
sendSync
(DEPRECATED)
Legacy send
method.
Implementation
Status uses a forked version of react-native-webview to display web or dapps content. The fork provides an Android implementation of JS injection before page load. It is required in order to properly inject Ethereum Provider object.
Status injects two JS scripts:
- provider.js:
window.ethereum
object - webview.js: override for
history.pushState
used internally
Dapps running inside a browser communicate with Status Ethereum node by means of a bridge provided by react-native-webview library. The bridge allows for bidirectional communication between browser and Status. In order to do so, it injects a special ReactNativeWebview
object into each page it loads.
On Status (React Native) end, react-native-webview
library provides WebView.injectJavascript
function on a webview component that allows to execute arbitrary code inside the webview. Thus it is possible to inject a function call passing Status node response back to the Dapp.
Below is the table briefly describing what functions/properties are used. More details available in package docs.
Direction Side Method Browser->Status JS ReactNativeWebView.postMessage()
Browser->Status RN WebView.onMessage()
Status->Browser JS ReactNativeWebView.onMessage()
Status->Browser RN WebView.injectJavascript()
Compatibility
Status browser supports the following EIPs:
- EIP1102:
eth_requestAccounts
support - EIP1193:
connect
, disconnect
, chainChanged
, and accountsChanged
event support is not implemented
Changelog
Version Comment 0.1.0 Initial Release
Copyright
Copyright and related rights waived via CC0.
+ 14/Dapp browser API usage - Status Specification 14/Dapp browser API usage | Status Specification Dapp browser API usage
Table of Contents
Abstract
This document describes requirements that an application must fulfill in order to provide a proper environment for Dapps running inside a browser. A description of the Status Dapp API is provided, along with an overview of bidirectional communication underlying the API implementation. The document also includes a list of EIPs that this API implements.
Definitions
Term Description Webview Platform-specific browser core implementation. Ethereum Provider A JS object (window.ethereum
) injected into each web page opened in the browser providing web3 compatible provider. Bridge A set of facilities allow bidirectional communication between JS code and the application.
Overview
The application should expose an Ethereum Provider object (window.ethereum
) to JS code running inside the browser. It is important to have the window.ethereum
object available before the page loads, otherwise Dapps might not work correctly.
Additionally, the browser component should also provide bidirectional communication between JS code and the application.
Usage in Dapps
Dapps can use the below properties and methods of window.ethereum
object.
Properties
isStatus
Returns true. Can be used by the Dapp to find out whether it’s running inside Status.
status
Returns a StatusAPI
object. For now it supports one method: getContactCode
that sends a contact-code
request to Status.
Methods
isConnected
Similarly to Ethereum JS API docs, it should be called to check if connection to a node exists. On Status, this fn always returns true, as once Status is up and running, node is automatically started.
scanQRCode
Sends a qr-code
Status API request.
request
request
method as defined by EIP-1193.
Unused
Below are some legacy methods that some Dapps might still use.
enable
(DEPRECATED)
Sends a web3
Status API request. It returns a first entry in the list of available accounts.
Legacy enable
method as defined by EIP1102.
send
(DEPRECATED)
Legacy send
method as defined by EIP1193.
sendAsync
(DEPRECATED)
Legacy sendAsync
method as defined by EIP1193.
sendSync
(DEPRECATED)
Legacy send
method.
Implementation
Status uses a forked version of react-native-webview to display web or dapps content. The fork provides an Android implementation of JS injection before page load. It is required in order to properly inject Ethereum Provider object.
Status injects two JS scripts:
- provider.js:
window.ethereum
object - webview.js: override for
history.pushState
used internally
Dapps running inside a browser communicate with Status Ethereum node by means of a bridge provided by react-native-webview library. The bridge allows for bidirectional communication between browser and Status. In order to do so, it injects a special ReactNativeWebview
object into each page it loads.
On Status (React Native) end, react-native-webview
library provides WebView.injectJavascript
function on a webview component that allows to execute arbitrary code inside the webview. Thus it is possible to inject a function call passing Status node response back to the Dapp.
Below is the table briefly describing what functions/properties are used. More details available in package docs.
Direction Side Method Browser->Status JS ReactNativeWebView.postMessage()
Browser->Status RN WebView.onMessage()
Status->Browser JS ReactNativeWebView.onMessage()
Status->Browser RN WebView.injectJavascript()
Compatibility
Status browser supports the following EIPs:
- EIP1102:
eth_requestAccounts
support - EIP1193:
connect
, disconnect
, chainChanged
, and accountsChanged
event support is not implemented
Changelog
Version Comment 0.1.0 Initial Release
Copyright
Copyright and related rights waived via CC0.
diff --git a/draft/16.html b/draft/16.html
index 02bf57c..cf50c32 100644
--- a/draft/16.html
+++ b/draft/16.html
@@ -1,4 +1,4 @@
- 16/Keycard Usage for Wallet and Chat Keys - Status Specification 16/Keycard Usage for Wallet and Chat Keys | Status Specification Table of Contents
- Abstract
- Definitions
- Multiaccount creation
- Multiaccount restoring via pairing
- Multiaccount unlocking
- Transaction signing
- Account derivation
- Reset pin
- Unblock pin
- Status go calls
- Where are the keys stored?
- Copyright
Abstract
In this specification, we describe how Status communicates with Keycard to create, store and use multiaccount.
Definitions
Term Description Keycard Hardwallet https://keycard.tech/docs/
Multiaccount creation/restoring
Creation and restoring via mnemonic
status-im.hardwallet.card/get-application-info
request: nil
response: {"initialized?" false}
status-im.hardwallet.card/init-card
request: {:pin 123123}
response: {"password" "nEJXqf6VWbqeC5oN",
+ 16/Keycard Usage for Wallet and Chat Keys - Status Specification 16/Keycard Usage for Wallet and Chat Keys | Status Specification Table of Contents
- Abstract
- Definitions
- Multiaccount creation
- Multiaccount restoring via pairing
- Multiaccount unlocking
- Transaction signing
- Account derivation
- Reset pin
- Unblock pin
- Status go calls
- Where are the keys stored?
- Copyright
Abstract
In this specification, we describe how Status communicates with Keycard to create, store and use multiaccount.
Definitions
Term Description Keycard Hardwallet https://keycard.tech/docs/
Multiaccount creation/restoring
Creation and restoring via mnemonic
status-im.hardwallet.card/get-application-info
request: nil
response: {"initialized?" false}
status-im.hardwallet.card/init-card
request: {:pin 123123}
response: {"password" "nEJXqf6VWbqeC5oN",
"puk" "411810112887",
"pin" "123123"}
status-im.hardwallet.card/get-application-info
request: nil
response: {"free-pairing-slots" 5,
diff --git a/draft/3.html b/draft/3.html
index 1de5efd..93f5a6c 100644
--- a/draft/3.html
+++ b/draft/3.html
@@ -1,4 +1,4 @@
- 3/WHISPER-USAGE - Status Specification 3/WHISPER-USAGE | Status Specification 3/WHISPER-USAGE
Version: 0.3
Status: Draft
Authors: Adam Babik adam@status.im, Andrea Maria Piana andreap@status.im, Corey Petty corey@status.im, Oskar Thorén oskar@status.im (alphabetical order)
- Abstract
- Reason
- Terminology
- Whisper packets
- Whisper node configuration
- Handshake
- Rate limiting
- Keys management
- Message encryption
- Message confirmations
- Whisper V6 extensions
- Changelog
Abstract
Status uses Whisper to provide privacy-preserving routing and messaging on top of devP2P. Whisper uses topics to partition its messages, and these are leveraged for all chat capabilities. In the case of public chats, the channel name maps directly to its Whisper topic. This allows anyone to listen on a single channel.
Additionally, since anyone can receive Whisper envelopes, it relies on the ability to decrypt messages to decide who is the correct recipient. Status nodes do not rely upon this property, and implement another secure transport layer on top of Whisper.
Finally, using an extension of Whisper provides the ability to do offline messaging.
Reason
Provide routing, metadata protection, topic-based multicasting and basic encryption properties to support asynchronous chat.
Terminology
- Whisper node: an Ethereum node with Whisper V6 enabled (in the case of geth, it’s
--shh
option) - Whisper network: a group of Whisper nodes connected together through the internet connection and forming a graph
- Message: a decrypted Whisper message
- Offline message: an archived envelope
- Envelope: an encrypted message with metadata like topic and Time-To-Live
Whisper packets
Packet Name Code EIP-627 References Status 0 ✔ Handshake Messages 1 ✔ EIP-627 PoW Requirement 2 ✔ EIP-627 Bloom Filter 3 ✔ EIP-627 Batch Ack 11 𝘅 Undocumented Message Response 12 𝘅 Undocumented P2P Sync Request 123 𝘅 Undocumented P2P Sync Response 124 𝘅 Undocumented P2P Request Complete 125 𝘅 4/WHISPER-MAILSERVER P2P Request 126 ✔ 4/WHISPER-MAILSERVER P2P Messages 127 ✔/𝘅 (EIP-627 supports only single envelope in a packet) 4/WHISPER-MAILSERVER
Whisper node configuration
A Whisper node must be properly configured to receive messages from Status clients.
Whisper’s Proof Of Work algorithm is used to deter denial of service and various spam/flood attacks against the Whisper network. The sender of a message must perform some work which in this case means processing time. Because Status’ main client is a mobile client, this easily leads to battery draining and poor performance of the app itself. Hence, all clients MUST use the following Whisper node settings:
- proof-of-work requirement not larger than
0.00001
- time-to-live not lower than
10
(in seconds) - any payload below
50000
bytes MUST be sent with a PoW Target of at least 0.002
, in order to maintain backward compatibility with version 0.2
and Status app version 1.3
and below
Handshake
Handshake is a RLP-encoded packet sent to a newly connected peer. It MUST start with a Status Code (0x00
) and follow up with items:
[ protocolVersion, PoW, bloom, isLightNode, confirmationsEnabled, rateLimits ]
+ 3/WHISPER-USAGE - Status Specification 3/WHISPER-USAGE | Status Specification 3/WHISPER-USAGE
Version: 0.3
Status: Draft
Authors: Adam Babik adam@status.im, Andrea Maria Piana andreap@status.im, Corey Petty corey@status.im, Oskar Thorén oskar@status.im (alphabetical order)
- Abstract
- Reason
- Terminology
- Whisper packets
- Whisper node configuration
- Handshake
- Rate limiting
- Keys management
- Message encryption
- Message confirmations
- Whisper V6 extensions
- Changelog
Abstract
Status uses Whisper to provide privacy-preserving routing and messaging on top of devP2P. Whisper uses topics to partition its messages, and these are leveraged for all chat capabilities. In the case of public chats, the channel name maps directly to its Whisper topic. This allows anyone to listen on a single channel.
Additionally, since anyone can receive Whisper envelopes, it relies on the ability to decrypt messages to decide who is the correct recipient. Status nodes do not rely upon this property, and implement another secure transport layer on top of Whisper.
Finally, using an extension of Whisper provides the ability to do offline messaging.
Reason
Provide routing, metadata protection, topic-based multicasting and basic encryption properties to support asynchronous chat.
Terminology
- Whisper node: an Ethereum node with Whisper V6 enabled (in the case of geth, it’s
--shh
option) - Whisper network: a group of Whisper nodes connected together through the internet connection and forming a graph
- Message: a decrypted Whisper message
- Offline message: an archived envelope
- Envelope: an encrypted message with metadata like topic and Time-To-Live
Whisper packets
Packet Name Code EIP-627 References Status 0 ✔ Handshake Messages 1 ✔ EIP-627 PoW Requirement 2 ✔ EIP-627 Bloom Filter 3 ✔ EIP-627 Batch Ack 11 𝘅 Undocumented Message Response 12 𝘅 Undocumented P2P Sync Request 123 𝘅 Undocumented P2P Sync Response 124 𝘅 Undocumented P2P Request Complete 125 𝘅 4/WHISPER-MAILSERVER P2P Request 126 ✔ 4/WHISPER-MAILSERVER P2P Messages 127 ✔/𝘅 (EIP-627 supports only single envelope in a packet) 4/WHISPER-MAILSERVER
Whisper node configuration
A Whisper node must be properly configured to receive messages from Status clients.
Whisper’s Proof Of Work algorithm is used to deter denial of service and various spam/flood attacks against the Whisper network. The sender of a message must perform some work which in this case means processing time. Because Status’ main client is a mobile client, this easily leads to battery draining and poor performance of the app itself. Hence, all clients MUST use the following Whisper node settings:
- proof-of-work requirement not larger than
0.00001
- time-to-live not lower than
10
(in seconds) - any payload below
50000
bytes MUST be sent with a PoW Target of at least 0.002
, in order to maintain backward compatibility with version 0.2
and Status app version 1.3
and below
Handshake
Handshake is a RLP-encoded packet sent to a newly connected peer. It MUST start with a Status Code (0x00
) and follow up with items:
[ protocolVersion, PoW, bloom, isLightNode, confirmationsEnabled, rateLimits ]
protocolVersion
: version of the Whisper protocol PoW
: minimum PoW accepted by the peer bloom
: bloom filter of Whisper topic accepted by the peer isLightNode
: when true, the peer won’t forward messages confirmationsEnabled
: when true, the peer will send message confirmations rateLimits
: is [ RateLimitIP, RateLimitPeerID, RateLimitTopic ]
where each values is an integer with a number of accepted packets per second per IP, Peer ID, and Topic respectively
bloom, isLightNode, confirmationsEnabled, and rateLimits
are all optional arguments in the handshake. However, if an optional field is specified, all optional fields preceding it MUST also be specified in order to be unambiguous.
Rate limiting
In order to provide an optional very basic Denial-of-Service attack protection, each node SHOULD define its own rate limits. The rate limits SHOULD be applied on IPs, peer IDs, and envelope topics.
Each node MAY decide to whitelist, i.e. do not rate limit, selected IPs or peer IDs.
If a peer exceeds node’s rate limits, the connection between them MAY be dropped.
Each node SHOULD broadcast its rate limits to its peers using rate limits packet code (0x14
). The rate limits is RLP-encoded information:
[ IP limits, PeerID limits, Topic limits ]
IP limits
: 4-byte wide unsigned integer PeerID limits
: 4-byte wide unsigned integer Topic limits
: 4-byte wide unsigned integer
The rate limits MAY also be sent as an optional parameter in the handshake.
Each node SHOULD respect rate limits advertised by its peers. The number of packets SHOULD be throttled in order not to exceed peer’s rate limits. If the limit gets exceeded, the connection MAY be dropped by the peer.
Keys management
The protocol requires a key (symmetric or asymmetric) for the following actions:
- signing & verifying messages (asymmetric key)
- encrypting & decrypting messages (asymmetric or symmetric key).
As nodes require asymmetric keys and symmetric keys to process incoming messages, they must be available all the time and are stored in memory.
Keys management for PFS is described in 5/SECURE-TRANSPORT.
The Status protocols uses a few particular Whisper topics to achieve its goals.
Contact code topic
Nodes use the contact code topic to facilitate the discovery of X3DH bundles so that the first message can be PFS-encrypted.
Each user publishes periodically to this topic. If user A wants to contact user B, she SHOULD look for their bundle on this contact code topic.
Contact code topic MUST be created following the algorithm below:
contactCode := "0x" + hexEncode(activePublicKey) + "-contact-code"
diff --git a/draft/6.html b/draft/6.html
index d1f5af2..7551e0a 100644
--- a/draft/6.html
+++ b/draft/6.html
@@ -1,4 +1,4 @@
- 6/PAYLOADS - Status Specification 6/PAYLOADS | Status Specification 6/PAYLOADS
Version: 0.5
Status: Draft
Authors: Adam Babik adam@status.im, Andrea Maria Piana andreap@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
Abstract
This specification describes how the payload of each message in Status looks like. It is primarily centered around chat and chat-related use cases.
The payloads aims to be flexible enough to support messaging but also cases described in the Status Whitepaper as well as various clients created using different technologies.
Table of Contents
- Abstract
- Table of Contents
- Introduction
- Payload wrapper
- Encoding
- Types of messages
- Upgradability
- Security Considerations
- Changelog
- Copyright
Introduction
This document describes the payload format and some special considerations.
Payload wrapper
The node wraps all payloads in a protobuf record record:
message StatusProtocolMessage {
+ 6/PAYLOADS - Status Specification 6/PAYLOADS | Status Specification 6/PAYLOADS
Version: 0.5
Status: Draft
Authors: Adam Babik adam@status.im, Andrea Maria Piana andreap@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
Abstract
This specification describes how the payload of each message in Status looks like. It is primarily centered around chat and chat-related use cases.
The payloads aims to be flexible enough to support messaging but also cases described in the Status Whitepaper as well as various clients created using different technologies.
Table of Contents
- Abstract
- Table of Contents
- Introduction
- Payload wrapper
- Encoding
- Types of messages
- Upgradability
- Security Considerations
- Changelog
- Copyright
Introduction
This document describes the payload format and some special considerations.
Payload wrapper
The node wraps all payloads in a protobuf record record:
message StatusProtocolMessage {
bytes signature = 4001;
bytes payload = 4002;
}
diff --git a/draft/7.html b/draft/7.html
index f40f27f..0c0072e 100644
--- a/draft/7.html
+++ b/draft/7.html
@@ -1,4 +1,4 @@
- 7/GROUP-CHAT - Status Specification 7/GROUP-CHAT | Status Specification 7/GROUP-CHAT
Version: 0.1
Status: Draft
Authors: Andrea Maria Piana andreap@status.im
Table of Contents
Abstract
This document describes the group chat protocol used by the status application. The node uses pairwise encryption among member so a message is exchanged between each participant, similarly to a one-to-one message.
Membership updates
The node uses membership updates messages to propagate group chat membership changes. The protobuf format is described in the 6/PAYLOADS. Below describes each specific field.
The protobuf messages are:
// MembershipUpdateMessage is a message used to propagate information
+ 7/GROUP-CHAT - Status Specification 7/GROUP-CHAT | Status Specification 7/GROUP-CHAT
Version: 0.1
Status: Draft
Authors: Andrea Maria Piana andreap@status.im
Table of Contents
Abstract
This document describes the group chat protocol used by the status application. The node uses pairwise encryption among member so a message is exchanged between each participant, similarly to a one-to-one message.
Membership updates
The node uses membership updates messages to propagate group chat membership changes. The protobuf format is described in the 6/PAYLOADS. Below describes each specific field.
The protobuf messages are:
// MembershipUpdateMessage is a message used to propagate information
// about group membership changes.
message MembershipUpdateMessage {
// The chat id of the private group chat
diff --git a/draft/index.html b/draft/index.html
index 53bd2df..5fc417d 100644
--- a/draft/index.html
+++ b/draft/index.html
@@ -1 +1 @@
- Draft specs - Status Specification Draft specs | Status Specification
+ Draft specs - Status Specification Draft specs | Status Specification
diff --git a/home.html b/home.html
index ee86262..8a207fa 100644
--- a/home.html
+++ b/home.html
@@ -1 +1 @@
- - Status Specification Status Specification Draft specs - Status Specification Draft specs | Status Specification
+ - Status Specification Status Specification Draft specs - Status Specification Draft specs | Status Specification
diff --git a/index.html b/index.html
index d3c1af3..eaffc39 100644
--- a/index.html
+++ b/index.html
@@ -1 +1 @@
- - Status Specification Status Specification Specifications for Status clients
This repository contains a list of specifications for implementing Status and its various capabilities.
How to contribute
You can read about how to build this project here.
- Create an issue for a new Status Improvement Proposal (SIP) or some bug that you’d like to address
- Create a corresponding PR and ping some existing SIP editors for review
If you need help, ask in #protocol at Status / Discord.
Specification style guidelines
Become familiar with the specification style guidelines to understand how you should write or amend specifications.
Spec lifecycle
Every spec has its own lifecycle that shows its maturity. We indicate this in a similar fashion to COSS Lifecycle:
At present (March 30, 2020) this means stable specs are what is in v1 of the Status App. Drafts and raw are work in progress specs.
Status Improvement Proposals (SIPs)
The main specification for writing a Status client is 1/CLIENT.
For all full index of all specs, see specs.status.im, especially stable specs.
Protocol Research
These are protocols that are currently being researched. These are designed to be useful outside of Status as well. To the extent that these protocols are used within Status clients, they will show up as SIPs in the future.
To see more on this, please visit the current home: vac protocol.
Continuous Integration
The site is built in Our Jenkins CI based off of master
branch.
+ - Status Specification Status Specification Specifications for Status clients
This repository contains a list of specifications for implementing Status and its various capabilities.
How to contribute
You can read about how to build this project here.
- Create an issue for a new Status Improvement Proposal (SIP) or some bug that you’d like to address
- Create a corresponding PR and ping some existing SIP editors for review
If you need help, ask in #protocol at Status / Discord.
Specification style guidelines
Become familiar with the specification style guidelines to understand how you should write or amend specifications.
Spec lifecycle
Every spec has its own lifecycle that shows its maturity. We indicate this in a similar fashion to COSS Lifecycle:
At present (March 30, 2020) this means stable specs are what is in v1 of the Status App. Drafts and raw are work in progress specs.
Status Improvement Proposals (SIPs)
The main specification for writing a Status client is 1/CLIENT.
For all full index of all specs, see specs.status.im, especially stable specs.
Protocol Research
These are protocols that are currently being researched. These are designed to be useful outside of Status as well. To the extent that these protocols are used within Status clients, they will show up as SIPs in the future.
To see more on this, please visit the current home: vac protocol.
Continuous Integration
The site is built in Our Jenkins CI based off of master
branch.
diff --git a/post.html b/post.html
index 85de6b8..70526dd 100644
--- a/post.html
+++ b/post.html
@@ -1 +1 @@
- - Status Specification Status Specification - Status Specification Status Specification Draft specs - Status Specification Draft specs | Status Specification
+ - Status Specification Status Specification - Status Specification Status Specification Draft specs - Status Specification Draft specs | Status Specification
diff --git a/raw/16.html b/raw/16.html
index 35cf92c..d8f6884 100644
--- a/raw/16.html
+++ b/raw/16.html
@@ -1,4 +1,4 @@
- 16/PUSH-NOTIFICATION-SERVER - Status Specification 16/PUSH-NOTIFICATION-SERVER | Status Specification 16/PUSH-NOTIFICATION-SERVER
Version: 0.1
Status: Raw
Authors: Andrea Maria Piana andreap@status.im
- Push Notification Server
- Reason
- Requirements
- Components
- Registering with the push notification service
- Re-registering with the push notification service
- Changing options
- Unregistering from push notifications
- Advertising a push notification server
- Discovering a push notification server
- Querying the push notification service
- Sending a push notification
- Flow
- Protobuf description
- Anonymous mode of operations
- Security considerations
- FAQ
- Changelog
- Copyright
Reason
Push notifications for iOS devices and some Android devices can only be implemented by relying on APN service for iOS or Firebase.
This is useful for Android devices that do not support foreground services or that often kill the foreground service.
iOS only allows certain kind of applications to keep a connection open when in the background, VoIP for example, which current status client does not qualify for.
Applications on iOS can also request execution time when they are in the background but it has a limited set of use cases, for example it won’t schedule any time if the application was force quit, and generally is not responsive enough to implement a push notification system.
Therefore Status provides a set of Push notification services that can be used to achieve this functionality.
Because this can’t be safely implemented in a privacy preserving manner, clients MUST be given an option to opt-in to receiving and sending push notifications. They are disabled by default.
Requirements
The party releasing the app MUST possess a certificate for the Apple Push Notification service and its has to run a gorush publicly accessible server for sending the actual notification. The party releasing the app, Status in this case, needs to run its own gorush
Components
Gorush instance
A gorush instance MUST be publicly available, this will be used only by push notification servers.
Push notification server
A push notification server used by clients to register for receiving and sending push notifications.
Registering client
A Status client that wants to receive push notifications
Sending client
A Status client that wants to send push notifications
Registering with the push notification service
A client MAY register with one or more Push Notification services of their choice.
A PNR message
(Push Notification Registration) MUST be sent to the partitioned topic for the public key of the node, encrypted with this key.
The message MUST be wrapped in a ApplicationMetadataMessage
with type set to PUSH_NOTIFICATION_REGISTRATION
.
The marshaled protobuf payload MUST also be encrypted with AES-GCM using the Diffie–Hellman key generated from the client and server identity.
This is done in order to ensure that the extracted key from the signature will be considered invalid if it can’t decrypt the payload.
The content of the message MUST contain the following protobuf record:
message PushNotificationRegistration {
+ 16/PUSH-NOTIFICATION-SERVER - Status Specification 16/PUSH-NOTIFICATION-SERVER | Status Specification 16/PUSH-NOTIFICATION-SERVER
Version: 0.1
Status: Raw
Authors: Andrea Maria Piana andreap@status.im
- Push Notification Server
- Reason
- Requirements
- Components
- Registering with the push notification service
- Re-registering with the push notification service
- Changing options
- Unregistering from push notifications
- Advertising a push notification server
- Discovering a push notification server
- Querying the push notification service
- Sending a push notification
- Flow
- Protobuf description
- Anonymous mode of operations
- Security considerations
- FAQ
- Changelog
- Copyright
Reason
Push notifications for iOS devices and some Android devices can only be implemented by relying on APN service for iOS or Firebase.
This is useful for Android devices that do not support foreground services or that often kill the foreground service.
iOS only allows certain kind of applications to keep a connection open when in the background, VoIP for example, which current status client does not qualify for.
Applications on iOS can also request execution time when they are in the background but it has a limited set of use cases, for example it won’t schedule any time if the application was force quit, and generally is not responsive enough to implement a push notification system.
Therefore Status provides a set of Push notification services that can be used to achieve this functionality.
Because this can’t be safely implemented in a privacy preserving manner, clients MUST be given an option to opt-in to receiving and sending push notifications. They are disabled by default.
Requirements
The party releasing the app MUST possess a certificate for the Apple Push Notification service and its has to run a gorush publicly accessible server for sending the actual notification. The party releasing the app, Status in this case, needs to run its own gorush
Components
Gorush instance
A gorush instance MUST be publicly available, this will be used only by push notification servers.
Push notification server
A push notification server used by clients to register for receiving and sending push notifications.
Registering client
A Status client that wants to receive push notifications
Sending client
A Status client that wants to send push notifications
Registering with the push notification service
A client MAY register with one or more Push Notification services of their choice.
A PNR message
(Push Notification Registration) MUST be sent to the partitioned topic for the public key of the node, encrypted with this key.
The message MUST be wrapped in a ApplicationMetadataMessage
with type set to PUSH_NOTIFICATION_REGISTRATION
.
The marshaled protobuf payload MUST also be encrypted with AES-GCM using the Diffie–Hellman key generated from the client and server identity.
This is done in order to ensure that the extracted key from the signature will be considered invalid if it can’t decrypt the payload.
The content of the message MUST contain the following protobuf record:
message PushNotificationRegistration {
enum TokenType {
UNKNOWN_TOKEN_TYPE = 0;
APN_TOKEN = 1;
diff --git a/raw/index.html b/raw/index.html
index c5290f2..6d10203 100644
--- a/raw/index.html
+++ b/raw/index.html
@@ -1 +1 @@
- Raw specs - Status Specification Raw specs | Status Specification
+ Raw specs - Status Specification Raw specs | Status Specification
diff --git a/sitemap.xml b/sitemap.xml
index e65a08f..548c952 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -1,13 +1,13 @@
-https://specs.status.im/stable/1
+https://specs.status.im/spec/1
-https://specs.status.im/stable/10
+https://specs.status.im/spec/10
-https://specs.status.im/stable/11
+https://specs.status.im/spec/11
https://specs.status.im/draft/12
@@ -19,40 +19,40 @@
https://specs.status.im/draft/14
-https://specs.status.im/stable/15
+https://specs.status.im/spec/15
https://specs.status.im/draft/16
-https://specs.status.im/stable/2
-
-
-https://specs.status.im/stable/3
+https://specs.status.im/spec/2
https://specs.status.im/draft/3
-https://specs.status.im/stable/4
+https://specs.status.im/spec/3
-https://specs.status.im/stable/5
+https://specs.status.im/spec/4
-https://specs.status.im/stable/6
+https://specs.status.im/spec/5
https://specs.status.im/draft/6
+https://specs.status.im/spec/6
+
+
https://specs.status.im/draft/7
-https://specs.status.im/stable/8
+https://specs.status.im/spec/8
-https://specs.status.im/stable/9
+https://specs.status.im/spec/9
https://specs.status.im/development
@@ -79,7 +79,7 @@
https://specs.status.im/raw/
-https://specs.status.im/stable/
+https://specs.status.im/spec/
https://specs.status.im/default.html
diff --git a/spec/1.html b/spec/1.html
new file mode 100644
index 0000000..c32a88a
--- /dev/null
+++ b/spec/1.html
@@ -0,0 +1 @@
+ 1/CLIENT - Status Specification 1/CLIENT | Status Specification 1/CLIENT
Version: 0.3
Status: Stable
Authors: Adam Babik adam@status.im, Andrea Maria Piana andreap@status.im, Dean Eigenmann dean@status.im, Corey Petty corey@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
Abstract
This specification describes how to write a Status client for communicating with other Status clients.
This specification presents 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.
Table of Contents
- Abstract
- Table of Contents
- Introduction
- Components
- Security Considerations
- Design Rationale
- Footnotes
- Appendix A: Security considerations
- Acknowledgments
- Changelog
Introduction
Protocol layers
Implementing a Status clients largely means implementing the following layers. Additionally, there are separate specifications for things like key management and account lifecycle.
Other aspects, such as how a node uses IPFS for stickers or how the browser works, are currently underspecified. These specifications facilitate the implementation of a Status client for basic private communication.
Layer Purpose Technology Data and payloads End user functionality 1:1, group chat, public chat Data sync Data consistency MVDS. Secure transport Confidentiality, PFS, etc Double Ratchet Transport privacy Routing, Metadata protection Waku / Whisper P2P Overlay Overlay routing, NAT traversal devp2p
Protobuf
protobuf
is used in different layers, version proto3
used is unless stated otherwise.
Components
P2P Overlay
Status clients run on a public, permissionless peer-to-peer 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 Status nodes, the RLPx Transport Protocol, v5 is used, which allows for TCP-based communication between nodes.
On top of this RLPx-based subprotocols are ran, the client SHOULD NOT use Whisper V6, the client SHOULD use Waku V1 for privacy-preserving messaging and efficient usage of a node’s bandwidth.
Node discovery and roles
There are four types of node roles:
Bootstrap node
Whisper/Waku relayer
Mailserver
(servers and clients) Mobile node
(Status Clients)
A standard Status client MUST implement both Whisper/Waku relayer
and Mobile node
node types. The other node types are optional, but it is RECOMMEND to implement a Mailserver
client mode, otherwise the user experience is likely to be poor.
Bootstrapping
Bootstrap nodes allow Status nodes to discover and connect to other Status nodes in the network.
Currently, Status Gmbh provides the main bootstrap nodes, but anyone can run these provided they are connected to the rest of the Whisper/Waku network.
Status maintains a list of production fleet bootstrap nodes in the following locations:
Hong Kong:
enode://6e6554fb3034b211398fcd0f0082cbb6bd13619e1a7e76ba66e1809aaa0c5f1ac53c9ae79cf2fd4a7bacb10d12010899b370c75fed19b991d9c0cdd02891abad@47.75.99.169:443
enode://23d0740b11919358625d79d4cac7d50a34d79e9c69e16831c5c70573757a1f5d7d884510bc595d7ee4da3c1508adf87bbc9e9260d804ef03f8c1e37f2fb2fc69@47.52.106.107:443
Amsterdam:
enode://436cc6f674928fdc9a9f7990f2944002b685d1c37f025c1be425185b5b1f0900feaf1ccc2a6130268f9901be4a7d252f37302c8335a2c1a62736e9232691cc3a@178.128.138.128:443
enode://5395aab7833f1ecb671b59bf0521cf20224fe8162fc3d2675de4ee4d5636a75ec32d13268fc184df8d1ddfa803943906882da62a4df42d4fccf6d17808156a87@178.128.140.188:443
Central US:
enode://32ff6d88760b0947a3dee54ceff4d8d7f0b4c023c6dad34568615fcae89e26cc2753f28f12485a4116c977be937a72665116596265aa0736b53d46b27446296a@34.70.75.208:443
enode://5405c509df683c962e7c9470b251bb679dd6978f82d5b469f1f6c64d11d50fbd5dd9f7801c6ad51f3b20a5f6c7ffe248cc9ab223f8bcbaeaf14bb1c0ef295fd0@35.223.215.156:443
These bootstrap nodes MAY change and are not guaranteed to stay this way forever and at some point circumstances might force them to change.
Discovery
A Status client MUST discover or have a list of peers to connect to. Status uses 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.
A Status client MUST use at least one discovery method or use static nodes to communicate with other clients.
Discovery V5 uses bootstrap nodes to discover other peers. Bootstrap nodes MUST support Discovery V5 protocol as well in order to provide peers. It is kademlia-based discovery mechanism and it might consume significant (at least on mobile) amount of network traffic to operate.
In order to take advantage from simpler and more mobile-friendly peers discovery mechanism, i.e. Rendezvous protocol, one MUST provide a list of Rendezvous nodes which speak Rendezvous protocol. Rendezvous protocol is request-response discovery mechanism. It uses Ethereum Node Records (ENR) to report discovered peers.
Both peers discovery mechanisms use topics to provide peers with certain capabilities. There is no point in returning peers that do not support a particular protocol. Status nodes that want to be discovered MUST register to Discovery V5 and/or Rendezvous with the whisper
topic. Status nodes that are Mailservers
and want to be discoverable MUST additionally register with the whispermail
topic.
It is RECOMMENDED to use both mechanisms but at the same time implement a structure called PeerPool
. PeerPool
is responsible for maintaining an optimal number of peers. For mobile nodes, there is no significant advantage to have more than 2-3 peers and one Mailserver
. PeerPool
can notify peers discovery protocol implementations that they should suspend their execution because the optimal number of peers is found. They should resume if the number of connected peers drops or a Mailserver
disconnects.
It is worth noticing that an efficient caching strategy MAY be of great use, especially, on mobile devices. Discovered peers can be cached as they rarely change and used when the client starts again. In such a case, there might be no need to even start peers discovery protocols because cached peers will satisfy the optimal number of peers.
Alternatively, a client MAY rely exclusively on a list of static peers. This is the most efficient way because there are no peers discovery algorithm overhead introduced. The disadvantage is that these peers might be gone and without peers discovery mechanism, it won’t be possible to find new ones.
The current list of static peers is published on https://fleets.status.im/. eth.prod
is the current group of peers the official Status client uses. The others are test networks.
Finally, Waku node addresses can be retrieved by traversing the merkle tree found at fleets.status.im
, as described in EIP-1459.
Mobile nodes
A Mobile node
is a Whisper and/or Waku node which connects to part of the respective Whisper and/or Waku network(s). A Mobile node
MAY relay messages. See next section for more details on how to use Whisper and/or Waku to communicate with other Status nodes.
Transport privacy and Whisper / Waku usage
Once a Whisper and/or Waku node is up and running there are some specific settings required to communicate with other Status nodes.
See 3/WHISPER-USAGE and 10/WAKU-USAGE for more details.
For providing an offline inbox, see the complementary 4/WHISPER-MAILSERVER and 11/WAKU-MAILSERVER.
Secure Transport
In order to provide confidentiality, integrity, authentication and forward secrecy of messages the node implements a secure transport on top of Whisper and Waku. This is used in 1:1 chats and group chats, but not for public chats. See 5/SECURE-TRANSPORT 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 an MVDS message which is added to an MVDS payload, the node encrypts this payload (if necessary for 1-to-1 / group-chats) and sends it using Whisper or Waku which also encrypts it.
Payloads and clients
On top of secure transport, various types of data sync clients and the node uses payload formats for things like 1:1 chat, group chat and public chat. These have various degrees of standardization. Please refer to 6/PAYLOADS for more details.
BIPs and EIPs Standards support
For a list of EIPs and BIPs that SHOULD be supported by Status client, please see 8/EIPS.
Security Considerations
See Appendix A
Design Rationale
P2P Overlay
Why devp2p? Why not use libp2p?
At the time Status developed the main Status clients, devp2p was the most mature. However, in the future libp2p is likely to be used, 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.
Why do you use Waku?
Waku is a direct upgrade and replacement for Whisper, the main motivation for developing and implementing Waku can be found in the Waku specs.
Waku was created to incrementally improve in areas that Whisper is lacking in, with special attention to resource restricted devices. We specify the standard for Waku messages in order to ensure forward compatibility of different Waku clients, backwards compatibility with Whisper clients, as well as to allow multiple implementations of Waku and its capabilities. We also modify the language to be more unambiguous, concise and consistent.
Considerable work has gone into the active development of Ethereum, in contrast Whisper is not currently under active development, and it has several drawbacks. Among others:
- Whisper is very wasteful bandwidth-wise and doesn’t appear to be scalable
- Proof of work is a poor spam protection mechanism for heterogeneous devices
- The privacy guarantees provided are not rigorous
- There are 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 Waku set so low?
A higher PoW would be desirable, but this kills the battery on mobile phones, 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 of implementing 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 until the node populates their peer list.
For some further investigation, see here.
I heard something about Mailservers
being trusted somehow?
In order to use a Mailserver
, 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 Mailserver
is able to send direct p2p messages to the node instead of broadcasting them. Effectively, it knows the bloom filter of the topics the node is interested in, when it is online as well as many metadata like IP address.
Data sync
Why is MVDS not used for public chats?
Currently, public chats are broadcast-based, and there’s no direct way of finding out who is receiving messages. Hence there’s no clear group sync state context whereby participants can sync. Additionally, MVDS is currently not optimized for large group contexts, which means bandwidth usage will be a lot higher than reasonable. See P2P Data Sync for Mobile for more. This is an active area of research.
Footnotes
- https://github.com/status-im/status-protocol-go/
- https://github.com/status-im/status-console-client/
- https://github.com/status-im/status-react/
Appendix A: Security considerations
There are several security considerations to take into account when running Status. Chief among them are: scalability, DDoS-resistance and privacy. These also vary depending on what capabilities are used, such as Mailserver
, light node, and so on.
Scalability and UX
Bandwidth usage:
In version 1 of Status, bandwidth usage is likely to be an issue. In Status version 1.1 this is partially addressed with Waku usage, see the theoretical scaling model.
Mailserver
High Availability requirement:
A Mailserver
has to be online to receive messages for other nodes, this puts a high availability requirement on it.
Gossip-based routing:
Use of gossip-based routing doesn’t necessarily scale. It means each node can see a message multiple times, and having too many light nodes can cause propagation probability that is too low. See Whisper vs PSS for more and a possible Kademlia based alternative.
Lack of incentives:
Status currently lacks incentives to run nodes, which means node operators are more likely to create centralized choke points.
Privacy
Light node privacy:
The main privacy concern with light nodes is that directly connected peers will know that a message originates from them (as it are the only ones it sends). This means nodes can make assumptions about what messages (topics) their peers are interested in.
Bloom filter privacy:
A user reveals which messages they are interested in, by setting only the topics they are interested in on the bloom filter. This is a fundamental trade-off between bandwidth usage and privacy, though the trade-off space is likely suboptimal in terms of the Anonymity trilemma.
Mailserver client
privacy:
A Mailserver client
has to trust a Mailserver
, which means they can send direct traffic. This reveals what topics / bloom filter a node is interested in, along with its peerID (with IP).
Privacy guarantees not rigorous:
Privacy for Whisper or Waku hasn’t been studied rigorously for various threat models like global passive adversary, local active attacker, etc. This is unlike e.g. Tor and mixnets.
Topic hygiene:
Similar to bloom filter privacy, using a very specific topic reveals more information. See scalability model linked above.
Spam resistance
PoW bad for heterogeneous devices:
Proof of work is a poor spam prevention mechanism. A mobile device can only have a very low PoW in order not to use too much CPU / burn up its phone battery. This means someone can spin up a powerful node and overwhelm the network.
Mailserver
trusted connection:
A Mailserver
has a direct TCP connection, which means they are trusted to send traffic. This means a malicious or malfunctioning Mailserver
can overwhelm an individual node.
Censorship resistance
Devp2p TCP port blockable:
By default Devp2p runs on port 30303
, which is not commonly used for any other service. This means it is easy to censor, e.g. airport WiFi. This can be mitigated somewhat by running on e.g. port 80
or 443
, but there are still outstanding issues. See libp2p and Tor’s Pluggable Transport for how this can be improved.
See https://github.com/status-im/status-react/issues/6351 for some discussion.
Acknowledgments
Jacek Sieka
Changelog
Version 0.3
Released May 22, 2020
- Added that Waku SHOULD be used
- Added that Whisper SHOULD NOT be used
- Added language to include Waku in all relevant places
- Change to keep
Mailserver
term consistent
Copyright
Copyright and related rights waived via CC0.
diff --git a/stable/10.html b/spec/10.html
similarity index 68%
rename from stable/10.html
rename to spec/10.html
index ddadbd5..e26e14d 100644
--- a/stable/10.html
+++ b/spec/10.html
@@ -1,4 +1,4 @@
- 10/WAKU-USAGE - Status Specification 10/WAKU-USAGE | Status Specification 10/WAKU-USAGE
Version: 0.1
Status: Stable
Authors: Adam Babik adam@status.im, Corey Petty corey@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
- Status Waku Usage Specification
Abstract
Status uses Waku to provide privacy-preserving routing and messaging on top of devP2P. Waku uses topics to partition its messages, and these are leveraged for all chat capabilities. In the case of public chats, the channel name maps directly to its Waku topic. This allows anyone to listen on a single channel.
Additionally, since anyone can receive Waku envelopes, it relies on the ability to decrypt messages to decide who is the correct recipient. Status nodes do not rely upon this property, and implement another secure transport layer on top of Whisper.
Reason
Provide routing, metadata protection, topic-based multicasting and basic encryption properties to support asynchronous chat.
Terminology
- Waku node: an Ethereum node with Waku V1 enabled
- Waku network: a group of Waku nodes connected together through the internet connection and forming a graph
- Message: a decrypted Waku message
- Offline message: an archived envelope
- Envelope: an encrypted message with metadata like topic and Time-To-Live
Waku packets
Packet Name Code References Status 0 Status, WAKU-1 Messages 1 WAKU-1 Batch Ack 11 Undocumented. Marked for Deprecation Message Response 12 WAKU-1 Status Update 22 WAKU-1 P2P Request Complete 125 4/WAKU-MAILSERVER P2P Request 126 4/WAKU-MAILSERVER, WAKU-1 P2P Messages 127 4/WAKU-MAILSERVER, WAKU-1
Waku node configuration
A Waku node must be properly configured to receive messages from Status clients.
Nodes use Waku’s Proof Of Work algorithm to deter denial of service and various spam/flood attacks against the Whisper network. The sender of a message must perform some work which in this case means processing time. Because Status’ main client is a mobile client, this easily leads to battery draining and poor performance of the app itself. Hence, all clients MUST use the following Whisper node settings:
- proof-of-work requirement not larger than
0.002
for payloads less than 50,000 bytes - proof-of-work requirement not larger than
0.000002
for payloads greater than or equal to 50,000 bytes - time-to-live not lower than
10
(in seconds)
Status
Handshake is a RLP-encoded packet sent to a newly connected peer. It MUST start with a Status Code (0x00
) and follow up with items:
[
+ 10/WAKU-USAGE - Status Specification 10/WAKU-USAGE | Status Specification 10/WAKU-USAGE
Version: 0.1
Status: Stable
Authors: Adam Babik adam@status.im, Corey Petty corey@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
- Status Waku Usage Specification
Abstract
Status uses Waku to provide privacy-preserving routing and messaging on top of devP2P. Waku uses topics to partition its messages, and these are leveraged for all chat capabilities. In the case of public chats, the channel name maps directly to its Waku topic. This allows anyone to listen on a single channel.
Additionally, since anyone can receive Waku envelopes, it relies on the ability to decrypt messages to decide who is the correct recipient. Status nodes do not rely upon this property, and implement another secure transport layer on top of Whisper.
Reason
Provide routing, metadata protection, topic-based multicasting and basic encryption properties to support asynchronous chat.
Terminology
- Waku node: an Ethereum node with Waku V1 enabled
- Waku network: a group of Waku nodes connected together through the internet connection and forming a graph
- Message: a decrypted Waku message
- Offline message: an archived envelope
- Envelope: an encrypted message with metadata like topic and Time-To-Live
Waku packets
Packet Name Code References Status 0 Status, WAKU-1 Messages 1 WAKU-1 Batch Ack 11 Undocumented. Marked for Deprecation Message Response 12 WAKU-1 Status Update 22 WAKU-1 P2P Request Complete 125 4/WAKU-MAILSERVER P2P Request 126 4/WAKU-MAILSERVER, WAKU-1 P2P Messages 127 4/WAKU-MAILSERVER, WAKU-1
Waku node configuration
A Waku node must be properly configured to receive messages from Status clients.
Nodes use Waku’s Proof Of Work algorithm to deter denial of service and various spam/flood attacks against the Whisper network. The sender of a message must perform some work which in this case means processing time. Because Status’ main client is a mobile client, this easily leads to battery draining and poor performance of the app itself. Hence, all clients MUST use the following Whisper node settings:
- proof-of-work requirement not larger than
0.002
for payloads less than 50,000 bytes - proof-of-work requirement not larger than
0.000002
for payloads greater than or equal to 50,000 bytes - time-to-live not lower than
10
(in seconds)
Status
Handshake is a RLP-encoded packet sent to a newly connected peer. It MUST start with a Status Code (0x00
) and follow up with items:
[
[ pow-requirement-key pow-requirement ]
[ bloom-filter-key bloom-filter ]
[ light-node-key light-node ]
diff --git a/spec/11.html b/spec/11.html
new file mode 100644
index 0000000..3632886
--- /dev/null
+++ b/spec/11.html
@@ -0,0 +1,3 @@
+ 11/WAKU-MAILSERVER - Status Specification 11/WAKU-MAILSERVER | Status Specification 11/WAKU-MAILSERVER
Version: 0.1
Status: Stable
Authors: Adam Babik adam@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
Abstract
Being mostly offline is an intrinsic property of mobile clients. They need to save network transfer and battery consumption to avoid spending too much money or constant charging. Waku protocol, on the other hand, is an online protocol. Messages are available in the Waku network only for short period of time calculate in seconds.
Waku Mailserver is a specification that allows messages to be stored permanently and to allows the stored messages to be delivered to requesting client nodes, regardless if the messages are not available in the network due to the message TTL expiring.
Mailserver
From the network perspective, a Mailserver
is just like any other Waku node. The only difference is that a Mailserver
has the capability of archiving messages and delivering them to its peers on-demand.
It is important to notice that a Mailserver
will only handle requests from its direct peers and exchanged packets between a Mailserver
and a peer are p2p messages.
Archiving messages
A node which wants to provide Mailserver
functionality MUST store envelopes from incoming message packets (Waku packet-code 0x01
). The envelopes can be stored in any format, however they MUST be serialized and deserialized to the Waku envelope format.
A Mailserver
SHOULD store envelopes for all topics to be generally useful for any peer, however for specific use cases it MAY store envelopes for a subset of topics.
Requesting messages
In order to request historic messages, a node MUST send a packet P2P Request (0x7e
) to a peer providing Mailserver
functionality. This packet requires one argument which MUST be a Waku envelope.
In the Waku envelope’s payload section, there MUST be RLP-encoded information about the details of the request:
[ Lower, Upper, Bloom, Limit, Cursor ]
+
Lower
: 4-byte wide unsigned integer (UNIX time in seconds; oldest requested envelope’s creation time)
Upper
: 4-byte wide unsigned integer (UNIX time in seconds; newest requested envelope’s creation time)
Bloom
: 64-byte wide array of Waku topics encoded in a bloom filter to filter envelopes
Limit
: 4-byte wide unsigned integer limiting the number of returned envelopes
Cursor
: an array of a cursor returned from the previous request (optional)
The Cursor
field SHOULD be filled in if a number of envelopes between Lower
and Upper
is greater than Limit
so that the requester can send another request using the obtained Cursor
value. What exactly is in the Cursor
is up to the implementation. The requester SHOULD NOT use a Cursor
obtained from one Mailserver
in a request to another Mailserver
because the format or the result MAY be different.
The envelope MUST be encrypted with a symmetric key agreed between the requester and the Mailserver
.
Receiving historic messages
Historic messages MUST be sent to a peer as a packet with a P2P Message code (0x7f
) followed by an array of Waku envelopes.
In order to receive historic messages from a Mailserver
, a node MUST trust the selected Mailserver
, that is allowed to send packets with the P2P Message code. By default, the node discards such packets.
Received envelopes MUST be passed through the Waku envelope pipelines so that they are picked up by registered filters and passed to subscribers.
For a requester, to know that all messages have been sent by a Mailserver
, it SHOULD handle P2P Request Complete code (0x7d
). This code is followed by the following parameters:
[ RequestID, LastEnvelopeHash, Cursor ]
+
RequestID
: 32-byte wide array with a Keccak-256 hash of the envelope containing the original request LastEnvelopeHash
: 32-byte wide array with a Keccak-256 hash of the last sent envelope for the request Cursor
: an array of a cursor returned from the previous request (optional)
If Cursor
is not empty, it means that not all messages were sent due to the set Limit
in the request. One or more consecutive requests MAY be sent with Cursor
field filled in order to receive the rest of the messages.
Security considerations
Confidentiality
The node encrypts all Waku envelopes. A Mailserver
node can not inspect their contents.
Altruistic and centralized operator risk
In order to be useful, a Mailserver
SHOULD be online most of time. That means users either have to be a bit tech-savvy to run their own node, or rely on someone else to run it for them.
Currently, one of Status’s legal entities provides Mailservers
in an altruistic manner, but this is suboptimal from a decentralization, continuance and risk point of view. Coming up with a better system for this is ongoing research.
A Status client SHOULD allow the Mailserver
selection to be customizable.
Privacy concerns
In order to use a Mailserver
, 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 Mailserver
is able to send direct p2p messages to the node instead of broadcasting them. Effectively, it will have access to the bloom filter of topics that the user is interested in, when it is online as well as many metadata like IP address.
Denial-of-service
Since a Mailserver
is delivering expired envelopes and has a direct TCP connection with the recipient, the recipient is vulnerable to DoS attacks from a malicious Mailserver
node.
Changelog
Version 0.1
Released May 22, 2020
- Created document
- Forked from 4-whisper-mailserver
- Change to keep
Mailserver
term consistent - Replaced Whisper references with Waku
Copyright
Copyright and related rights waived via CC0.
diff --git a/spec/15.html b/spec/15.html
new file mode 100644
index 0000000..ca25254
--- /dev/null
+++ b/spec/15.html
@@ -0,0 +1 @@
+ 15/NOTIFICATIONS - Status Specification 15/NOTIFICATIONS | Status Specification 15/NOTIFICATIONS
Local Notifications
A client should implement local notifications to offer notifications for any event in the app without the privacy cost and dependency on third party services. This means that the client should run a background service to continuously or periodically check for updates.
Android
Android allows running services on the device. When the user enables notifications, the client may start a ``Foreground Service`, and display a permanent notification indicating that the service is running, as required by Android guidelines. The service will simply keep the app from being killed by the system when it is in the background. The client will then be able to run in the background and display local notifications on events such as receiving a message in a one to one chat.
To facilitate the implementation of local notifications, a node implementation such as status-go
may provide a specific notification
signal.
Notifications are a separate process in Android, and interaction with a notification generates an Intent
. To handle intents, the NewMessageSignalHandler
may use a BroadcastReceiver
, in order to update the state of local notifications when the user dismisses or tap a notification. If the user taps on a notification, the BroadcastReceiver
generates a new intent to open the app should use universal links to get the user to the right place.
iOS
We are not able to offer local notifications on iOS because there is no concept of services in iOS. It offers background updates but they’re not consistently triggered, and cannot be relied upon. The system decides when the background updates are triggered and the heuristics aren’t known.
Why is there no Push Notifications?
Push Notifications, as offered by Apple and Google are a privacy concern, they require a centralized service that is aware of who the notification needs to be delivered to.
Copyright
Copyright and related rights waived via CC0.
diff --git a/stable/2.html b/spec/2.html
similarity index 52%
rename from stable/2.html
rename to spec/2.html
index d7f6467..3337e54 100644
--- a/stable/2.html
+++ b/spec/2.html
@@ -1,4 +1,4 @@
- 2/ACCOUNT - Status Specification 2/ACCOUNT | Status Specification 2/ACCOUNT
Version: 0.4
Status: Stable
Authors: Corey Petty corey@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
Abstract
This specification explains what Status account is, and how a node establishes trust.
Table of Contents
- Abstract
- Table of Contents
- Introduction
- Initial Key Generation
- Account Broadcasting
- Optional Account additions
- Trust establishment
- Public Key Serialization
- Security Considerations
- Changelog
Introduction
The core concept of an account in Status is a set of cryptographic keypairs. Namely, the combination of the following:
- a Whisper/Waku chat identity keypair
- a set of cryptocurrency wallet keypairs
The node verifies or derives everything else associated with the contact from the above items, including:
- Ethereum address (future verification, currently the same base keypair)
- 3 word mnemonic name
- identicon
- message signatures
Initial Key Generation
Public/Private Keypairs
- An ECDSA (secp256k1 curve) public/private keypair MUST be generated via a BIP43 derived path from a BIP39 mnemonic seed phrase.
- The default paths are defined as such:
X3DH Prekey bundle creation
- Status follows the X3DH prekey bundle scheme that Open Whisper Systems (not to be confused with the Whisper sub-protocol) outlines in their documentation with the following exceptions:
- Status does not publish one-time keys
OPK
or perform DH including them, because there are no central servers in the Status implementation.
- A client MUST create X3DH prekey bundles, each defined by the following items:
- Identity Key:
IK
- Signed prekey:
SPK
- Prekey signature:
Sig(IK, Encode(SPK))
- Timestamp
- These bundles are made available in a variety of ways, as defined in section 2.1.
Account Broadcasting
- A user is responsible for broadcasting certain information publicly so that others may contact them.
X3DH Prekey bundles
- A client SHOULD regenerate a new X3DH prekey bundle every 24 hours. This MAY be done in a lazy way, such that a client that does not come online past this time period does not regenerate or broadcast bundles.
- The current bundle SHOULD be broadcast on a Whisper/Waku topic specific to his Identity Key,
{IK}-contact-code
, intermittently. This MAY be done every 6 hours. - A bundle SHOULD accompany every message sent.
- TODO: retrieval of long-time offline users bundle via
{IK}-contact-code
Optional Account additions
ENS Username
- A user MAY register a public username on the Ethereum Name System (ENS). This username is a user-chosen subdomain of the
stateofus.eth
ENS registration that maps to their Whisper/Waku identity key (IK
).
Trust establishment
Trust establishment deals with users verifying they are communicating with who they think they are.
Terms Glossary
term description privkey ECDSA secp256k1 private key pubkey ECDSA secp256k1 public key Whisper/Waku key pubkey for chat with HD derivation path m/43’/60’/1581’/0’/0
Contact Discovery
Public channels
- Public group channels in Status are a broadcast/subscription system. All public messages are encrypted with a symmetric key derived from the channel name,
K_{pub,sym}
, which is publicly known. - A public group channel’s symmetric key MUST creation must follow the web3 API’s
web3.ssh.generateSymKeyFromPassword
function - In order to post to a public group channel, a client MUST have a valid account created.
- In order to listen to a public group channel, a client must subscribe to the channel name. The sender of a message is derived from the message’s signature.
- Discovery of channel names is not currently part of the protocol, and is typically done out of band. If a channel name is used that has not been used, it will be created.
- A client MUST sign the message otherwise it will be discarded by the recipients.
- channel name specification:
- matches
[a-z0-9\-]
- is not a public key
Private 1:1 messages
This can be done in the following ways:
- scanning a user generated QR code
- discovery through the Status app
- asynchronous X3DH key exchange
- public key via public channel listening
status-react/src/status_im/contact_code/core.cljs
- contact codes
- decentralized storage (not implemented)
- Whisper/Waku
Initial Key Exchange
Bundles
- An X3DH prekey bundle is defined as (code):
Identity // Identity key
+ 2/ACCOUNT - Status Specification 2/ACCOUNT | Status Specification 2/ACCOUNT
Version: 0.4
Status: Stable
Authors: Corey Petty corey@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
Abstract
This specification explains what Status account is, and how a node establishes trust.
Table of Contents
- Abstract
- Table of Contents
- Introduction
- Initial Key Generation
- Account Broadcasting
- Optional Account additions
- Trust establishment
- Public Key Serialization
- Security Considerations
- Changelog
Introduction
The core concept of an account in Status is a set of cryptographic keypairs. Namely, the combination of the following:
- a Whisper/Waku chat identity keypair
- a set of cryptocurrency wallet keypairs
The node verifies or derives everything else associated with the contact from the above items, including:
- Ethereum address (future verification, currently the same base keypair)
- 3 word mnemonic name
- identicon
- message signatures
Initial Key Generation
Public/Private Keypairs
- An ECDSA (secp256k1 curve) public/private keypair MUST be generated via a BIP43 derived path from a BIP39 mnemonic seed phrase.
- The default paths are defined as such:
X3DH Prekey bundle creation
- Status follows the X3DH prekey bundle scheme that Open Whisper Systems (not to be confused with the Whisper sub-protocol) outlines in their documentation with the following exceptions:
- Status does not publish one-time keys
OPK
or perform DH including them, because there are no central servers in the Status implementation.
- A client MUST create X3DH prekey bundles, each defined by the following items:
- Identity Key:
IK
- Signed prekey:
SPK
- Prekey signature:
Sig(IK, Encode(SPK))
- Timestamp
- These bundles are made available in a variety of ways, as defined in section 2.1.
Account Broadcasting
- A user is responsible for broadcasting certain information publicly so that others may contact them.
X3DH Prekey bundles
- A client SHOULD regenerate a new X3DH prekey bundle every 24 hours. This MAY be done in a lazy way, such that a client that does not come online past this time period does not regenerate or broadcast bundles.
- The current bundle SHOULD be broadcast on a Whisper/Waku topic specific to his Identity Key,
{IK}-contact-code
, intermittently. This MAY be done every 6 hours. - A bundle SHOULD accompany every message sent.
- TODO: retrieval of long-time offline users bundle via
{IK}-contact-code
Optional Account additions
ENS Username
- A user MAY register a public username on the Ethereum Name System (ENS). This username is a user-chosen subdomain of the
stateofus.eth
ENS registration that maps to their Whisper/Waku identity key (IK
).
Trust establishment
Trust establishment deals with users verifying they are communicating with who they think they are.
Terms Glossary
term description privkey ECDSA secp256k1 private key pubkey ECDSA secp256k1 public key Whisper/Waku key pubkey for chat with HD derivation path m/43’/60’/1581’/0’/0
Contact Discovery
Public channels
- Public group channels in Status are a broadcast/subscription system. All public messages are encrypted with a symmetric key derived from the channel name,
K_{pub,sym}
, which is publicly known. - A public group channel’s symmetric key MUST creation must follow the web3 API’s
web3.ssh.generateSymKeyFromPassword
function - In order to post to a public group channel, a client MUST have a valid account created.
- In order to listen to a public group channel, a client must subscribe to the channel name. The sender of a message is derived from the message’s signature.
- Discovery of channel names is not currently part of the protocol, and is typically done out of band. If a channel name is used that has not been used, it will be created.
- A client MUST sign the message otherwise it will be discarded by the recipients.
- channel name specification:
- matches
[a-z0-9\-]
- is not a public key
Private 1:1 messages
This can be done in the following ways:
- scanning a user generated QR code
- discovery through the Status app
- asynchronous X3DH key exchange
- public key via public channel listening
status-react/src/status_im/contact_code/core.cljs
- contact codes
- decentralized storage (not implemented)
- Whisper/Waku
Initial Key Exchange
Bundles
- An X3DH prekey bundle is defined as (code):
Identity // Identity key
SignedPreKeys // a map of installation id to array of signed prekeys by that installation id
Signature // Prekey signature
Timestamp // When the bundle was lasted created locally
diff --git a/stable/3.html b/spec/3.html
similarity index 66%
rename from stable/3.html
rename to spec/3.html
index 2ae374c..1e6a646 100644
--- a/stable/3.html
+++ b/spec/3.html
@@ -1,4 +1,4 @@
- 3/WHISPER-USAGE - Status Specification 3/WHISPER-USAGE | Status Specification 3/WHISPER-USAGE
Version: 0.3
Status: Stable
Authors: Adam Babik adam@status.im, Corey Petty corey@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
- Abstract
- Reason
- Terminology
- Whisper packets
- Whisper node configuration
- Handshake
- Rate limiting
- Keys management
- Message encryption
- Message confirmations
- Whisper / Waku bridging
- Whisper V6 extensions
- Changelog
Abstract
Status uses Whisper to provide privacy-preserving routing and messaging on top of devP2P. Whisper uses topics to partition its messages, and these are leveraged for all chat capabilities. In the case of public chats, the channel name maps directly to its Whisper topic. This allows anyone to listen on a single channel.
Additionally, since anyone can receive Whisper envelopes, it relies on the ability to decrypt messages to decide who is the correct recipient. Status nodes do not rely upon this property, and implement another secure transport layer on top of Whisper.
Finally, using an extension of Whisper provides the ability to do offline messaging.
Reason
Provide routing, metadata protection, topic-based multicasting and basic encryption properties to support asynchronous chat.
Terminology
- Whisper node: an Ethereum node with Whisper V6 enabled (in the case of go-ethereum, it’s
--shh
option) - Whisper network: a group of Whisper nodes connected together through the internet connection and forming a graph
- Message: a decrypted Whisper message
- Offline message: an archived envelope
- Envelope: an encrypted message with metadata like topic and Time-To-Live
Whisper packets
Packet Name Code EIP-627 References Status 0 ✔ Handshake Messages 1 ✔ EIP-627 PoW Requirement 2 ✔ EIP-627 Bloom Filter 3 ✔ EIP-627 Batch Ack 11 𝘅 Undocumented Message Response 12 𝘅 Undocumented P2P Sync Request 123 𝘅 Undocumented P2P Sync Response 124 𝘅 Undocumented P2P Request Complete 125 𝘅 4/WHISPER-MAILSERVER P2P Request 126 ✔ 4/WHISPER-MAILSERVER P2P Messages 127 ✔/𝘅 (EIP-627 supports only single envelope in a packet) 4/WHISPER-MAILSERVER
Whisper node configuration
A Whisper node must be properly configured to receive messages from Status clients.
Nodes use Whisper’s Proof Of Work algorithm to deter denial of service and various spam/flood attacks against the Whisper network. The sender of a message must perform some work which in this case means processing time. Because Status’ main client is a mobile client, this easily leads to battery draining and poor performance of the app itself. Hence, all clients MUST use the following Whisper node settings:
- proof-of-work requirement not larger than
0.002
- time-to-live not lower than
10
(in seconds)
Handshake
Handshake is a RLP-encoded packet sent to a newly connected peer. It MUST start with a Status Code (0x00
) and follow up with items:
[ protocolVersion, PoW, bloom, isLightNode, confirmationsEnabled, rateLimits ]
+ 3/WHISPER-USAGE - Status Specification 3/WHISPER-USAGE | Status Specification 3/WHISPER-USAGE
Version: 0.3
Status: Stable
Authors: Adam Babik adam@status.im, Corey Petty corey@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
- Abstract
- Reason
- Terminology
- Whisper packets
- Whisper node configuration
- Handshake
- Rate limiting
- Keys management
- Message encryption
- Message confirmations
- Whisper / Waku bridging
- Whisper V6 extensions
- Changelog
Abstract
Status uses Whisper to provide privacy-preserving routing and messaging on top of devP2P. Whisper uses topics to partition its messages, and these are leveraged for all chat capabilities. In the case of public chats, the channel name maps directly to its Whisper topic. This allows anyone to listen on a single channel.
Additionally, since anyone can receive Whisper envelopes, it relies on the ability to decrypt messages to decide who is the correct recipient. Status nodes do not rely upon this property, and implement another secure transport layer on top of Whisper.
Finally, using an extension of Whisper provides the ability to do offline messaging.
Reason
Provide routing, metadata protection, topic-based multicasting and basic encryption properties to support asynchronous chat.
Terminology
- Whisper node: an Ethereum node with Whisper V6 enabled (in the case of go-ethereum, it’s
--shh
option) - Whisper network: a group of Whisper nodes connected together through the internet connection and forming a graph
- Message: a decrypted Whisper message
- Offline message: an archived envelope
- Envelope: an encrypted message with metadata like topic and Time-To-Live
Whisper packets
Packet Name Code EIP-627 References Status 0 ✔ Handshake Messages 1 ✔ EIP-627 PoW Requirement 2 ✔ EIP-627 Bloom Filter 3 ✔ EIP-627 Batch Ack 11 𝘅 Undocumented Message Response 12 𝘅 Undocumented P2P Sync Request 123 𝘅 Undocumented P2P Sync Response 124 𝘅 Undocumented P2P Request Complete 125 𝘅 4/WHISPER-MAILSERVER P2P Request 126 ✔ 4/WHISPER-MAILSERVER P2P Messages 127 ✔/𝘅 (EIP-627 supports only single envelope in a packet) 4/WHISPER-MAILSERVER
Whisper node configuration
A Whisper node must be properly configured to receive messages from Status clients.
Nodes use Whisper’s Proof Of Work algorithm to deter denial of service and various spam/flood attacks against the Whisper network. The sender of a message must perform some work which in this case means processing time. Because Status’ main client is a mobile client, this easily leads to battery draining and poor performance of the app itself. Hence, all clients MUST use the following Whisper node settings:
- proof-of-work requirement not larger than
0.002
- time-to-live not lower than
10
(in seconds)
Handshake
Handshake is a RLP-encoded packet sent to a newly connected peer. It MUST start with a Status Code (0x00
) and follow up with items:
[ protocolVersion, PoW, bloom, isLightNode, confirmationsEnabled, rateLimits ]
protocolVersion
: version of the Whisper protocol PoW
: minimum PoW accepted by the peer bloom
: bloom filter of Whisper topic accepted by the peer isLightNode
: when true, the peer won’t forward messages confirmationsEnabled
: when true, the peer will send message confirmations rateLimits
: is [ RateLimitIP, RateLimitPeerID, RateLimitTopic ]
where each values is an integer with a number of accepted packets per second per IP, Peer ID, and Topic respectively
bloom, isLightNode, confirmationsEnabled, and rateLimits
are all optional arguments in the handshake. However, if an optional field is specified, all optional fields preceding it MUST also be specified in order to be unambiguous.
Rate limiting
In order to provide an optional very basic Denial-of-Service attack protection, each node SHOULD define its own rate limits. The rate limits SHOULD be applied on IPs, peer IDs, and envelope topics.
Each node MAY decide to whitelist, i.e. do not rate limit, selected IPs or peer IDs.
If a peer exceeds node’s rate limits, the connection between them MAY be dropped.
Each node SHOULD broadcast its rate limits to its peers using rate limits packet code (0x14
). The rate limits is RLP-encoded information:
[ IP limits, PeerID limits, Topic limits ]
IP limits
: 4-byte wide unsigned integer PeerID limits
: 4-byte wide unsigned integer Topic limits
: 4-byte wide unsigned integer
The rate limits MAY also be sent as an optional parameter in the handshake.
Each node SHOULD respect rate limits advertised by its peers. The number of packets SHOULD be throttled in order not to exceed peer’s rate limits. If the limit gets exceeded, the connection MAY be dropped by the peer.
Keys management
The protocol requires a key (symmetric or asymmetric) for the following actions:
- signing & verifying messages (asymmetric key)
- encrypting & decrypting messages (asymmetric or symmetric key).
As nodes require asymmetric keys and symmetric keys to process incoming messages, they must be available all the time and are stored in memory.
Keys management for PFS is described in 5/SECURE-TRANSPORT.
The Status protocols uses a few particular Whisper topics to achieve its goals.
Contact code topic
Nodes use the contact code topic to facilitate the discovery of X3DH bundles so that the first message can be PFS-encrypted.
Each user publishes periodically to this topic. If user A wants to contact user B, she SHOULD look for their bundle on this contact code topic.
Contact code topic MUST be created following the algorithm below:
contactCode := "0x" + hexEncode(activePublicKey) + "-contact-code"
diff --git a/spec/4.html b/spec/4.html
new file mode 100644
index 0000000..0c8723a
--- /dev/null
+++ b/spec/4.html
@@ -0,0 +1,3 @@
+ 4/WHISPER-MAILSERVER - Status Specification 4/WHISPER-MAILSERVER | Status Specification 4/WHISPER-MAILSERVER
Version: 0.3
Status: Stable
Authors: Adam Babik adam@status.im, Oskar Thorén oskar@status.im (alphabetical order)
Abstract
Being mostly offline is an intrinsic property of mobile clients. They need to save network transfer and battery consumption to avoid spending too much money or constant charging. Whisper protocol, on the other hand, is an online protocol. Messages are available in the Whisper network only for short period of time calculate in seconds.
Whisper Mailserver
is a Whisper extension that allows to store messages permanently and deliver them to the clients even though they are already not available in the network and expired.
Mailserver
From the network perspective, Mailserver
is just like any other Whisper node. The only difference is that it has a capability of archiving messages and delivering them to its peers on-demand.
It is important to notice that Mailserver
will only handle requests from its direct peers and exchanged packets between Mailserver
and a peer are p2p messages.
Archiving messages
A node which wants to provide Mailserver
functionality MUST store envelopes from incoming message packets (Whisper packet-code 0x01
). The envelopes can be stored in any format, however they MUST be serialized and deserialized to the Whisper envelope format.
A Mailserver
SHOULD store envelopes for all topics to be generally useful for any peer, however for specific use cases it MAY store envelopes for a subset of topics.
Requesting messages
In order to request historic messages, a node MUST send a packet P2P Request (0x7e
) to a peer providing Mailserver
functionality. This packet requires one argument which MUST be a Whisper envelope.
In the Whisper envelope’s payload section, there MUST be RLP-encoded information about the details of the request:
[ Lower, Upper, Bloom, Limit, Cursor ]
+
Lower
: 4-byte wide unsigned integer (UNIX time in seconds; oldest requested envelope’s creation time)
Upper
: 4-byte wide unsigned integer (UNIX time in seconds; newest requested envelope’s creation time)
Bloom
: 64-byte wide array of Whisper topics encoded in a bloom filter to filter envelopes
Limit
: 4-byte wide unsigned integer limiting the number of returned envelopes
Cursor
: an array of a cursor returned from the previous request (optional)
The Cursor
field SHOULD be filled in if a number of envelopes between Lower
and Upper
is greater than Limit
so that the requester can send another request using the obtained Cursor
value. What exactly is in the Cursor
is up to the implementation. The requester SHOULD NOT use a Cursor
obtained from one Mailserver
in a request to another Mailserver
because the format or the result MAY be different.
The envelope MUST be encrypted with a symmetric key agreed between the requester and Mailserver
.
Receiving historic messages
Historic messages MUST be sent to a peer as a packet with a P2P Message code (0x7f
) followed by an array of Whisper envelopes. It is incompatible with the original Whisper spec (EIP-627) because it allows only a single envelope, however, an array of envelopes is much more performant. In order to stay compatible with EIP-627, a peer receiving historic message MUST handle both cases.
In order to receive historic messages from a Mailserver
, a node MUST trust the selected Mailserver
, that is allowed to send packets with the P2P Message code. By default, the node discards such packets.
Received envelopes MUST be passed through the Whisper envelope pipelines so that they are picked up by registered filters and passed to subscribers.
For a requester, to know that all messages have been sent by Mailserver
, it SHOULD handle P2P Request Complete code (0x7d
). This code is followed by the following parameters:
[ RequestID, LastEnvelopeHash, Cursor ]
+
RequestID
: 32-byte wide array with a Keccak-256 hash of the envelope containing the original request
LastEnvelopeHash
: 32-byte wide array with a Keccak-256 hash of the last sent envelope for the request
Cursor
: an array of a cursor returned from the previous request (optional)
If Cursor
is not empty, it means that not all messages were sent due to the set Limit
in the request. One or more consecutive requests MAY be sent with Cursor
field filled in order to receive the rest of the messages.
Security considerations
Confidentiality
The node encrypts all Whisper envelopes. A Mailserver
node can not inspect their contents.
Altruistic and centralized operator risk
In order to be useful, a Mailserver
SHOULD be online most of the time. That means users either have to be a bit tech-savvy to run their own node, or rely on someone else to run it for them.
Currently, one of Status’s legal entities provides Mailservers
in an altruistic manner, but this is suboptimal from a decentralization, continuance and risk point of view. Coming up with a better system for this is ongoing research.
A Status client SHOULD allow the Mailserver
selection to be customizable.
Privacy concerns
In order to use a Mailserver
, 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 Mailserver
is able to send direct p2p messages to the node instead of broadcasting them. Effectively, it will have access to the bloom filter of topics that the user is interested in, when it is online as well as many metadata like IP address.
Denial-of-service
Since a Mailserver
is delivering expired envelopes and has a direct TCP connection with the recipient, the recipient is vulnerable to DoS attacks from a malicious Mailserver
node.
Changelog
Version 0.3
Released May 22, 2020
- Change to keep
Mailserver
term consistent
Copyright
Copyright and related rights waived via CC0.
diff --git a/stable/5.html b/spec/5.html
similarity index 59%
rename from stable/5.html
rename to spec/5.html
index a829408..e5ff3e6 100644
--- a/stable/5.html
+++ b/spec/5.html
@@ -1,4 +1,4 @@
- 5/SECURE-TRANSPORT - Status Specification 5/SECURE-TRANSPORT | Status Specification 5/SECURE-TRANSPORT
Version: 0.3
Status: Stable
Authors: Andrea Piana andreap@status.im, Pedro Pombeiro pedro@status.im, Corey Petty corey@status.im, Oskar Thorén oskar@status.im, Dean Eigenmann dean@status.im
Abstract
This document describes how Status provides a secure channel between two peers, and thus provide confidentiality, integrity, authenticity and forward secrecy. It is transport-agnostic and works over asynchronous networks.
It builds on the X3DH and Double Ratchet specifications, with some adaptations to operate in a decentralized environment.
Table of Contents
- Abstract
- Table of Contents
- Introduction
- Messaging
- Security Considerations
- Session management
- Changelog
Introduction
This document describes how nodes establish a secure channel, and how various conversational security properties are achieved.
Definitions
-
Perfect Forward Secrecy is a feature of specific key-agreement protocols which provide assurances that session keys will not be compromised even if the private keys of the participants are compromised. Specifically, past messages cannot be decrypted by a third-party who manages to get a hold of a private key.
-
Secret channel describes a communication channel where Double Ratchet algorithm is in use.
Design Requirements
- Confidentiality: The adversary should not be able to learn what data is being exchanged between two Status clients.
- Authenticity: The adversary should not be able to cause either endpoint of a Status 1:1 chat to accept data from any third party as though it came from the other endpoint.
- Forward Secrecy: The adversary should not be able to learn what data was exchanged between two Status clients if, at some later time, the adversary compromises one or both of the endpoint devices.
- Integrity: The adversary should not be able to cause either endpoint of a Status 1:1 chat to accept data that has been tampered with.
All of these properties are ensured by the use of Signal’s Double Ratchet
Conventions
Types used in this specification are defined using Protobuf.
Transport Layer
Whisper and Waku serves as the transport layers for the Status chat protocol.
User flow for 1-to-1 communications
Account generation
Account recovery
If Alice later recovers her account, the Double Ratchet state information will not be available, so she is no longer able to decrypt any messages received from existing contacts.
If an incoming message (on the same Whisper/Waku topic) fails to decrypt, the node replies a message with the current bundle, so that the node notifies the other end of the new device. Subsequent communications will use this new bundle.
Messaging
All 1:1 and group chat messaging in Status is subject to end-to-end encryption to provide users with a strong degree of privacy and security. Public chat messages are publicly readable by anyone since there’s no permission model for who is participating in a public chat.
The rest of this document is purely about 1:1 and private group chat. Private group chat largely reduces to 1:1 chat, since there’s a secure channel between each pair-wise participant.
End-to-end encryption
End-to-end encryption (E2EE) takes place between two clients. The main cryptographic protocol is a Status implementation of the Double Ratchet protocol, which is in turn derived from the Off-the-Record protocol, using a different ratchet. The transport protocol subsequently encrypt the message payload - Whisper/Waku (see section Transport Layer) -, using symmetric key encryption. Furthermore, Status uses the concept of prekeys (through the use of X3DH) to allow the protocol to operate in an asynchronous environment. It is not necessary for two parties to be online at the same time to initiate an encrypted conversation.
Status uses the following cryptographic primitives:
- Whisper/Waku
- AES-256-GCM
- ECIES
- ECDSA
- KECCAK-256
- X3DH
- Elliptic curve Diffie-Hellman key exchange (secp256k1)
- KECCAK-256
- ECDSA
- ECIES
- Double Ratchet
- HMAC-SHA-256 as MAC
- Elliptic curve Diffie-Hellman key exchange (Curve25519)
- AES-256-CTR with HMAC-SHA-256 and IV derived alongside an encryption key
The node achieves key derivation using HKDF.
Prekeys
Every client initially generates some key material which is stored locally:
- Identity keypair based on secp256k1 -
IK
- A signed prekey based on secp256k1 -
SPK
- A prekey signature -
Sig(IK, Encode(SPK))
More details can be found in the X3DH Prekey bundle creation
section of 2/ACCOUNT.
Prekey bundles can be extracted from any user’s messages, or found via searching for their specific topic, {IK}-contact-code
.
TODO: See below on bundle retrieval, this seems like enhancement and parameter for recommendation
Bundle retrieval
X3DH works by having client apps create and make available a bundle of prekeys (the X3DH bundle) that can later be requested by other interlocutors when they wish to start a conversation with a given user.
In the X3DH specification, nodes typically use a shared server to store bundles and allow other users to download them upon request. Given Status’ goal of decentralization, Status chat clients cannot rely on the same type of infrastructure and must achieve the same result using other means. By growing order of convenience and security, the considered approaches are:
- contact codes;
- public and one-to-one chats;
- QR codes;
- ENS record;
- Decentralized permanent storage (e.g. Swarm, IPFS).
- Whisper/Waku
Currently, only public and one-to-one message exchanges and Whisper/Waku is used to exchange bundles.
Since bundles stored in QR codes or ENS records cannot be updated to delete already used keys, the approach taken is to rotate more frequently the bundle (once every 24 hours), which will be propagated by the app through the channel available.
1:1 chat contact request
There are two phases in the initial negotiation of a 1:1 chat:
- Identity verification (e.g., face-to-face contact exchange through QR code, Identicon matching). A QR code serves two purposes simultaneously - identity verification and initial bundle retrieval;
- Asynchronous initial key exchange, using X3DH.
For more information on account generation and trust establishment, see 2/ACCOUNT
Initial key exchange flow (X3DH)
Section 3 of the X3DH protocol describes the initial key exchange flow, with some additional context:
- The users’ identity keys
IK_A
and IK_B
correspond to their respective Status chat public keys; - Since it is not possible to guarantee that a prekey will be used only once in a decentralized world, the one-time prekey
OPK_B
is not used in this scenario; - Nodes do not send Bundles to a centralized server, but instead served in a decentralized way as described in bundle retrieval.
Alice retrieves Bob’s prekey bundle, however it is not specific to Alice. It contains:
(protobuf)
// X3DH prekey bundle
+ 5/SECURE-TRANSPORT - Status Specification 5/SECURE-TRANSPORT | Status Specification 5/SECURE-TRANSPORT
Version: 0.3
Status: Stable
Authors: Andrea Piana andreap@status.im, Pedro Pombeiro pedro@status.im, Corey Petty corey@status.im, Oskar Thorén oskar@status.im, Dean Eigenmann dean@status.im
Abstract
This document describes how Status provides a secure channel between two peers, and thus provide confidentiality, integrity, authenticity and forward secrecy. It is transport-agnostic and works over asynchronous networks.
It builds on the X3DH and Double Ratchet specifications, with some adaptations to operate in a decentralized environment.
Table of Contents
- Abstract
- Table of Contents
- Introduction
- Messaging
- Security Considerations
- Session management
- Changelog
Introduction
This document describes how nodes establish a secure channel, and how various conversational security properties are achieved.
Definitions
-
Perfect Forward Secrecy is a feature of specific key-agreement protocols which provide assurances that session keys will not be compromised even if the private keys of the participants are compromised. Specifically, past messages cannot be decrypted by a third-party who manages to get a hold of a private key.
-
Secret channel describes a communication channel where Double Ratchet algorithm is in use.
Design Requirements
- Confidentiality: The adversary should not be able to learn what data is being exchanged between two Status clients.
- Authenticity: The adversary should not be able to cause either endpoint of a Status 1:1 chat to accept data from any third party as though it came from the other endpoint.
- Forward Secrecy: The adversary should not be able to learn what data was exchanged between two Status clients if, at some later time, the adversary compromises one or both of the endpoint devices.
- Integrity: The adversary should not be able to cause either endpoint of a Status 1:1 chat to accept data that has been tampered with.
All of these properties are ensured by the use of Signal’s Double Ratchet
Conventions
Types used in this specification are defined using Protobuf.
Transport Layer
Whisper and Waku serves as the transport layers for the Status chat protocol.
User flow for 1-to-1 communications
Account generation
Account recovery
If Alice later recovers her account, the Double Ratchet state information will not be available, so she is no longer able to decrypt any messages received from existing contacts.
If an incoming message (on the same Whisper/Waku topic) fails to decrypt, the node replies a message with the current bundle, so that the node notifies the other end of the new device. Subsequent communications will use this new bundle.
Messaging
All 1:1 and group chat messaging in Status is subject to end-to-end encryption to provide users with a strong degree of privacy and security. Public chat messages are publicly readable by anyone since there’s no permission model for who is participating in a public chat.
The rest of this document is purely about 1:1 and private group chat. Private group chat largely reduces to 1:1 chat, since there’s a secure channel between each pair-wise participant.
End-to-end encryption
End-to-end encryption (E2EE) takes place between two clients. The main cryptographic protocol is a Status implementation of the Double Ratchet protocol, which is in turn derived from the Off-the-Record protocol, using a different ratchet. The transport protocol subsequently encrypt the message payload - Whisper/Waku (see section Transport Layer) -, using symmetric key encryption. Furthermore, Status uses the concept of prekeys (through the use of X3DH) to allow the protocol to operate in an asynchronous environment. It is not necessary for two parties to be online at the same time to initiate an encrypted conversation.
Status uses the following cryptographic primitives:
- Whisper/Waku
- AES-256-GCM
- ECIES
- ECDSA
- KECCAK-256
- X3DH
- Elliptic curve Diffie-Hellman key exchange (secp256k1)
- KECCAK-256
- ECDSA
- ECIES
- Double Ratchet
- HMAC-SHA-256 as MAC
- Elliptic curve Diffie-Hellman key exchange (Curve25519)
- AES-256-CTR with HMAC-SHA-256 and IV derived alongside an encryption key
The node achieves key derivation using HKDF.
Prekeys
Every client initially generates some key material which is stored locally:
- Identity keypair based on secp256k1 -
IK
- A signed prekey based on secp256k1 -
SPK
- A prekey signature -
Sig(IK, Encode(SPK))
More details can be found in the X3DH Prekey bundle creation
section of 2/ACCOUNT.
Prekey bundles can be extracted from any user’s messages, or found via searching for their specific topic, {IK}-contact-code
.
TODO: See below on bundle retrieval, this seems like enhancement and parameter for recommendation
Bundle retrieval
X3DH works by having client apps create and make available a bundle of prekeys (the X3DH bundle) that can later be requested by other interlocutors when they wish to start a conversation with a given user.
In the X3DH specification, nodes typically use a shared server to store bundles and allow other users to download them upon request. Given Status’ goal of decentralization, Status chat clients cannot rely on the same type of infrastructure and must achieve the same result using other means. By growing order of convenience and security, the considered approaches are:
- contact codes;
- public and one-to-one chats;
- QR codes;
- ENS record;
- Decentralized permanent storage (e.g. Swarm, IPFS).
- Whisper/Waku
Currently, only public and one-to-one message exchanges and Whisper/Waku is used to exchange bundles.
Since bundles stored in QR codes or ENS records cannot be updated to delete already used keys, the approach taken is to rotate more frequently the bundle (once every 24 hours), which will be propagated by the app through the channel available.
1:1 chat contact request
There are two phases in the initial negotiation of a 1:1 chat:
- Identity verification (e.g., face-to-face contact exchange through QR code, Identicon matching). A QR code serves two purposes simultaneously - identity verification and initial bundle retrieval;
- Asynchronous initial key exchange, using X3DH.
For more information on account generation and trust establishment, see 2/ACCOUNT
Initial key exchange flow (X3DH)
Section 3 of the X3DH protocol describes the initial key exchange flow, with some additional context:
- The users’ identity keys
IK_A
and IK_B
correspond to their respective Status chat public keys; - Since it is not possible to guarantee that a prekey will be used only once in a decentralized world, the one-time prekey
OPK_B
is not used in this scenario; - Nodes do not send Bundles to a centralized server, but instead served in a decentralized way as described in bundle retrieval.
Alice retrieves Bob’s prekey bundle, however it is not specific to Alice. It contains:
(protobuf)
// X3DH prekey bundle
message Bundle {
bytes identity = 1;
diff --git a/stable/6.html b/spec/6.html
similarity index 75%
rename from stable/6.html
rename to spec/6.html
index d65deae..d729ab3 100644
--- a/stable/6.html
+++ b/spec/6.html
@@ -1,4 +1,4 @@
- 6/PAYLOADS - Status Specification 6/PAYLOADS | Status Specification 6/PAYLOADS
Version: 0.3
Status: Stable
Authors: Adam Babik adam@status.im, Andrea Maria Piana andreap@status.im, Oskar Thorén oskar@status.im (alphabetical order)
Abstract
This specification describes how the payload of each message in Status looks like. It is primarily centered around chat and chat-related use cases.
The payloads aims to be flexible enough to support messaging but also cases described in the Status Whitepaper as well as various clients created using different technologies.
Table of Contents
- Abstract
- Table of Contents
- Introduction
- Payload wrapper
- Encoding
- Types of messages
- Upgradability
- Security Considerations
- Changelog
Introduction
This document describes the payload format and some special considerations.
Payload wrapper
The node wraps all payloads in a protobuf record record:
message ApplicationMetadataMessage {
+ 6/PAYLOADS - Status Specification 6/PAYLOADS | Status Specification 6/PAYLOADS
Version: 0.3
Status: Stable
Authors: Adam Babik adam@status.im, Andrea Maria Piana andreap@status.im, Oskar Thorén oskar@status.im (alphabetical order)
Abstract
This specification describes how the payload of each message in Status looks like. It is primarily centered around chat and chat-related use cases.
The payloads aims to be flexible enough to support messaging but also cases described in the Status Whitepaper as well as various clients created using different technologies.
Table of Contents
- Abstract
- Table of Contents
- Introduction
- Payload wrapper
- Encoding
- Types of messages
- Upgradability
- Security Considerations
- Changelog
Introduction
This document describes the payload format and some special considerations.
Payload wrapper
The node wraps all payloads in a protobuf record record:
message ApplicationMetadataMessage {
bytes signature = 1;
bytes payload = 2;
diff --git a/spec/8.html b/spec/8.html
new file mode 100644
index 0000000..95e9071
--- /dev/null
+++ b/spec/8.html
@@ -0,0 +1 @@
+ 8/EIPS - Status Specification 8/EIPS | Status Specification 8/EIPS
Version: 0.2
Status: Stable
Authors: Ricardo Guilherme Schmidt ricardo3@status.im
Abstract
This specification describes how Status relates with EIPs.
Table of Contents
Introduction
Status should follow all standards as possible. Whenever the Status app needs a feature, it should be first checked if there is a standard for that, if not, Status should propose a standard.
Support table
Status v0 Status v1 Other State BIP32 N Y N stable
BIP39 Y Y Y stable
BIP43 N Y N stable
BIP44 N Y N stable
EIP20 Y Y Y stable
EIP55 Y Y Y stable
EIP67 P P N stable
EIP137 P P N stable
EIP155 Y Y Y stable
EIP165 P N N stable
EIP181 P N N stable
EIP191 Y? N Y stable
EIP627 Y Y N stable
EIP681 Y N Y stable
EIP712 P P Y stable
EIP721 P P Y stable
EIP831 N Y N stable
EIP945 Y Y N stable
EIP1102 Y Y Y stable
EIP1193 Y Y Y stable
EIP1577 Y P N stable
EIP1581 N Y N stable
EIP1459 N N raw
Components
BIP32 - Hierarchical Deterministic Wallets
Support: Dependency.
Reference: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
Description: Enable wallets to derive multiple private keys from the same seed.
Used for: Dependency of BIP39 and BIP43.
BIP39 - Mnemonic code for generating deterministic keys
Support: Dependency.
Reference: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
Description: Enable wallet to create private key based on a safe seed phrase. Used for: Security and user experience.
BIP43 - Purpose Field for Deterministic Wallets
Support: Dependency.
Reference: https://github.com/bitcoin/bips/blob/master/bip-0043.mediawiki
Description: Enable wallet to create private keys branched for a specific purpose.
Used for: Dependency of BIP44, uses “ethereum” coin.
BIP44 - Multi-Account Hierarchy for Deterministic Wallets
Support: Dependency.
Reference: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
Description: Enable wallet to derive multiple accounts in top of BIP39.
Used for: Privacy.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/constants.cljs#L240
Observation: BIP44 don’t solve privacy issues regarding the transparency of transactions, therefore directly connected addresses through a transactions can be identifiable by a “network reconnaissance attack” over transaction history, this attack together with leakage of information from centralized services, such as exchanges, would be fatal against the whole privacy of users, regardless of BIP44.
EIP20 - Fungible Token
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-20
Description: Enable wallets to use tokens based on smart contracts compliant with this standard.
Used for: Wallet feature.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/tokens.cljs
EIP55 - Mixed-case checksum address encoding
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-55
Description: Checksum standard that uses lowercase and uppercase inside address hex value.
Used for: Sanity check of forms using ethereum address.
Related: https://github.com/status-im/status-react/issues/4959 https://github.com/status-im/status-react/issues/8707
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/eip55.cljs
EIP67 - Standard URI scheme with metadata, value and byte code
Support: Partial.
Reference: https://github.com/ethereum/EIPs/issues/67
Description: A standard way of creating Ethereum URIs for various use-cases.
Used for: Legacy support.
https://github.com/status-im/status-react/issues/875
EIP137 - Ethereum Domain Name Service - Specification
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-137
Description: Enable wallets to lookup ENS names.
Used for: User experience, as a wallet and identity feature, usernames.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/ens.cljs#L86
EIP155 - Simple replay attack protection
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-155
Description: Defined chainId parameter in the singed ethereum transaction payload.
Used for: Signing transactions, crucial to safety of users against replay attacks.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/core.cljs
EIP165 - Standard Interface Detection
Support: Dependency/Partial.
Reference: https://eips.ethereum.org/EIPS/eip-165
Description: Standard interface for contract to answer if it supports other interfaces.
Used for: Dependency of ENS and EIP721.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/eip165.cljs
EIP181 - ENS support for reverse resolution of Ethereum addresses
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-181
Description: Enable wallets to render reverse resolution of Ethereum addresses.
Used for: Wallet feature.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/ens.cljs#L86
EIP191 - Signed Message
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-191
Description: Contract signature standard, adds an obligatory padding to signed message to differentiate from Ethereum Transaction messages.
Used for: Dapp support, security, dependency of ERC712.
EIP627 - Whisper Specification
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-627
Description: format of Whisper messages within the ÐΞVp2p Wire Protocol.
Used for: Chat protocol.
EIP681 - URL Format for Transaction Requests
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-681 Description: A link that pop up a transaction in the wallet.
Used for: Useful as QR code data for transaction requests, chat transaction requests and for dapp links to transaction requests.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/eip681.cljs
Related: Issue #9183: URL Format for Transaction Requests (EIP681) is poorly supported https://github.com/status-im/status-react/pull/9240 https://github.com/status-im/status-react/issues/9238 https://github.com/status-im/status-react/issues/7214 https://github.com/status-im/status-react/issues/7325 https://github.com/status-im/status-react/issues/8150
EIP712 - Typed Signed Message
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-712
Description: Standardize types for contract signature, allowing users to easily inspect whats being signed.
Used for: User experience, security.
Related: https://github.com/status-im/status-react/issues/5461 https://github.com/status-im/status-react/commit/ba37f7b8d029d3358c7b284f6a2383b9ef9526c9
EIP721 - Non Fungible Token
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-721
Description: Enable wallets to use tokens based on smart contracts compliant with this standard.
Used for: Wallet feature.
Related: https://github.com/status-im/status-react/issues/8909
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/erc721.cljs https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/tokens.cljs
EIP945 - Web 3 QR Code Scanning API
Support: Full.
Reference: https://github.com/ethereum/EIPs/issues/945
Used for: Sharing contactcode, reading transaction requests.
Related: https://github.com/status-im/status-react/issues/5870
EIP1102 - Opt-in account exposure
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-1102
Description: Allow users to opt-in the exposure of their ethereum address to dapps they browse.
Used for: Privacy, DApp support.
Related: https://github.com/status-im/status-react/issues/7985
EIP1193 - Ethereum Provider JavaScript API
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-1193
Description: Allows dapps to recognize event changes on wallet.
Used for: DApp support.
Related: https://github.com/status-im/status-react/pull/7246
EIP1577 - contenthash field for ENS
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-1577
Description: Allows users browse ENS domains using contenthash standard.
Used for: Browser, DApp support.
Related: https://github.com/status-im/status-react/issues/6688
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/utils/contenthash.cljs https://github.com/status-im/status-react/blob/develop/test/cljs/status_im/test/utils/contenthash.cljs#L5
EIP1581 - Non-wallet usage of keys derived from BIP-32 trees
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-1581
Description: Allow wallet to derive keys that are less sensible (non wallet).
Used for: Security (don’t reuse wallet key) and user experience (don’t request keycard every login).
Related: https://github.com/status-im/status-react/issues/9088 https://github.com/status-im/status-react/pull/9096
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/constants.cljs#L242
EIP1459 - Node Discovery via DNS
Support: - Reference: https://eips.ethereum.org/EIPS/eip-1459 Description: Allows the storing and retrieving of nodes through merkle trees stored in TXT records of a domain. Used for: Finding Waku nodes. Related: - Sourcecode: -
Copyright
Copyright and related rights waived via CC0.
diff --git a/stable/9.html b/spec/9.html
similarity index 54%
rename from stable/9.html
rename to spec/9.html
index 1b37cad..632871a 100644
--- a/stable/9.html
+++ b/spec/9.html
@@ -1,4 +1,4 @@
- 9/ETHEREUM-USAGE - Status Specification 9/ETHEREUM-USAGE | Status Specification 9/ETHEREUM-USAGE
Version: 0.1
Status: Stable
Authors: Andrea Maria Piana andreap@status.im
Status interactions with the Ethereum blockchain
This specification documents all the interactions that the Status client has with the Ethereum blockchain.
All the interactions are made through JSON-RPC. Currently Infura is used. The client assumes high-availability, otherwise it will not be able to interact with the Ethereum blockchain. Status nodes rely on these Infura nodes to validate the integrity of the transaction and report a consistent history.
Key handling is described here
Wallet
The wallet in Status has two main components:
1) Sending transactions 2) Fetching balance
In the section below are described the RPC
calls made the nodes, with a brief description of their functionality and how it is used by Status.
Sending transactions
EstimateGas
EstimateGas tries to estimate the gas needed to execute a specific transaction based on the current pending state of the backend blockchain. There is no guarantee that this is the true gas limit requirement as other transactions may be added or removed by miners, but it should provide a basis for setting a reasonable default.
func (ec *Client) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
+ 9/ETHEREUM-USAGE - Status Specification 9/ETHEREUM-USAGE | Status Specification 9/ETHEREUM-USAGE
Version: 0.1
Status: Stable
Authors: Andrea Maria Piana andreap@status.im
Status interactions with the Ethereum blockchain
This specification documents all the interactions that the Status client has with the Ethereum blockchain.
All the interactions are made through JSON-RPC. Currently Infura is used. The client assumes high-availability, otherwise it will not be able to interact with the Ethereum blockchain. Status nodes rely on these Infura nodes to validate the integrity of the transaction and report a consistent history.
Key handling is described here
Wallet
The wallet in Status has two main components:
1) Sending transactions 2) Fetching balance
In the section below are described the RPC
calls made the nodes, with a brief description of their functionality and how it is used by Status.
Sending transactions
EstimateGas
EstimateGas tries to estimate the gas needed to execute a specific transaction based on the current pending state of the backend blockchain. There is no guarantee that this is the true gas limit requirement as other transactions may be added or removed by miners, but it should provide a basis for setting a reasonable default.
func (ec *Client) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L499
PendingNonceAt
PendingNonceAt
returns the account nonce of the given account in the pending state. This is the nonce that should be used for the next transaction.
func (ec *Client) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L440
SuggestGasPrice
SuggestGasPrice
retrieves the currently suggested gas price to allow a timely execution of a transaction.
func (ec *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error)
https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L487
SendTransaction
SendTransaction
injects a signed transaction into the pending pool for execution.
If the transaction was a contract creation use the TransactionReceipt method to get the contract address after the transaction has been mined.
func (ec *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error
diff --git a/spec/index.html b/spec/index.html
new file mode 100644
index 0000000..9362dcc
--- /dev/null
+++ b/spec/index.html
@@ -0,0 +1 @@
+ Stable specs - Status Specification Stable specs | Status Specification
diff --git a/stable/1.html b/stable/1.html
deleted file mode 100644
index 60f1e96..0000000
--- a/stable/1.html
+++ /dev/null
@@ -1 +0,0 @@
- 1/CLIENT - Status Specification 1/CLIENT | Status Specification 1/CLIENT
Version: 0.3
Status: Stable
Authors: Adam Babik adam@status.im, Andrea Maria Piana andreap@status.im, Dean Eigenmann dean@status.im, Corey Petty corey@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
Abstract
This specification describes how to write a Status client for communicating with other Status clients.
This specification presents 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.
Table of Contents
- Abstract
- Table of Contents
- Introduction
- Components
- Security Considerations
- Design Rationale
- Footnotes
- Appendix A: Security considerations
- Acknowledgments
- Changelog
Introduction
Protocol layers
Implementing a Status clients largely means implementing the following layers. Additionally, there are separate specifications for things like key management and account lifecycle.
Other aspects, such as how a node uses IPFS for stickers or how the browser works, are currently underspecified. These specifications facilitate the implementation of a Status client for basic private communication.
Layer Purpose Technology Data and payloads End user functionality 1:1, group chat, public chat Data sync Data consistency MVDS. Secure transport Confidentiality, PFS, etc Double Ratchet Transport privacy Routing, Metadata protection Waku / Whisper P2P Overlay Overlay routing, NAT traversal devp2p
Protobuf
protobuf
is used in different layers, version proto3
used is unless stated otherwise.
Components
P2P Overlay
Status clients run on a public, permissionless peer-to-peer 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 Status nodes, the RLPx Transport Protocol, v5 is used, which allows for TCP-based communication between nodes.
On top of this RLPx-based subprotocols are ran, the client SHOULD NOT use Whisper V6, the client SHOULD use Waku V1 for privacy-preserving messaging and efficient usage of a node’s bandwidth.
Node discovery and roles
There are four types of node roles:
Bootstrap node
Whisper/Waku relayer
Mailserver
(servers and clients) Mobile node
(Status Clients)
A standard Status client MUST implement both Whisper/Waku relayer
and Mobile node
node types. The other node types are optional, but it is RECOMMEND to implement a Mailserver
client mode, otherwise the user experience is likely to be poor.
Bootstrapping
Bootstrap nodes allow Status nodes to discover and connect to other Status nodes in the network.
Currently, Status Gmbh provides the main bootstrap nodes, but anyone can run these provided they are connected to the rest of the Whisper/Waku network.
Status maintains a list of production fleet bootstrap nodes in the following locations:
Hong Kong:
enode://6e6554fb3034b211398fcd0f0082cbb6bd13619e1a7e76ba66e1809aaa0c5f1ac53c9ae79cf2fd4a7bacb10d12010899b370c75fed19b991d9c0cdd02891abad@47.75.99.169:443
enode://23d0740b11919358625d79d4cac7d50a34d79e9c69e16831c5c70573757a1f5d7d884510bc595d7ee4da3c1508adf87bbc9e9260d804ef03f8c1e37f2fb2fc69@47.52.106.107:443
Amsterdam:
enode://436cc6f674928fdc9a9f7990f2944002b685d1c37f025c1be425185b5b1f0900feaf1ccc2a6130268f9901be4a7d252f37302c8335a2c1a62736e9232691cc3a@178.128.138.128:443
enode://5395aab7833f1ecb671b59bf0521cf20224fe8162fc3d2675de4ee4d5636a75ec32d13268fc184df8d1ddfa803943906882da62a4df42d4fccf6d17808156a87@178.128.140.188:443
Central US:
enode://32ff6d88760b0947a3dee54ceff4d8d7f0b4c023c6dad34568615fcae89e26cc2753f28f12485a4116c977be937a72665116596265aa0736b53d46b27446296a@34.70.75.208:443
enode://5405c509df683c962e7c9470b251bb679dd6978f82d5b469f1f6c64d11d50fbd5dd9f7801c6ad51f3b20a5f6c7ffe248cc9ab223f8bcbaeaf14bb1c0ef295fd0@35.223.215.156:443
These bootstrap nodes MAY change and are not guaranteed to stay this way forever and at some point circumstances might force them to change.
Discovery
A Status client MUST discover or have a list of peers to connect to. Status uses 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.
A Status client MUST use at least one discovery method or use static nodes to communicate with other clients.
Discovery V5 uses bootstrap nodes to discover other peers. Bootstrap nodes MUST support Discovery V5 protocol as well in order to provide peers. It is kademlia-based discovery mechanism and it might consume significant (at least on mobile) amount of network traffic to operate.
In order to take advantage from simpler and more mobile-friendly peers discovery mechanism, i.e. Rendezvous protocol, one MUST provide a list of Rendezvous nodes which speak Rendezvous protocol. Rendezvous protocol is request-response discovery mechanism. It uses Ethereum Node Records (ENR) to report discovered peers.
Both peers discovery mechanisms use topics to provide peers with certain capabilities. There is no point in returning peers that do not support a particular protocol. Status nodes that want to be discovered MUST register to Discovery V5 and/or Rendezvous with the whisper
topic. Status nodes that are Mailservers
and want to be discoverable MUST additionally register with the whispermail
topic.
It is RECOMMENDED to use both mechanisms but at the same time implement a structure called PeerPool
. PeerPool
is responsible for maintaining an optimal number of peers. For mobile nodes, there is no significant advantage to have more than 2-3 peers and one Mailserver
. PeerPool
can notify peers discovery protocol implementations that they should suspend their execution because the optimal number of peers is found. They should resume if the number of connected peers drops or a Mailserver
disconnects.
It is worth noticing that an efficient caching strategy MAY be of great use, especially, on mobile devices. Discovered peers can be cached as they rarely change and used when the client starts again. In such a case, there might be no need to even start peers discovery protocols because cached peers will satisfy the optimal number of peers.
Alternatively, a client MAY rely exclusively on a list of static peers. This is the most efficient way because there are no peers discovery algorithm overhead introduced. The disadvantage is that these peers might be gone and without peers discovery mechanism, it won’t be possible to find new ones.
The current list of static peers is published on https://fleets.status.im/. eth.prod
is the current group of peers the official Status client uses. The others are test networks.
Finally, Waku node addresses can be retrieved by traversing the merkle tree found at fleets.status.im
, as described in EIP-1459.
Mobile nodes
A Mobile node
is a Whisper and/or Waku node which connects to part of the respective Whisper and/or Waku network(s). A Mobile node
MAY relay messages. See next section for more details on how to use Whisper and/or Waku to communicate with other Status nodes.
Transport privacy and Whisper / Waku usage
Once a Whisper and/or Waku node is up and running there are some specific settings required to communicate with other Status nodes.
See 3/WHISPER-USAGE and 10/WAKU-USAGE for more details.
For providing an offline inbox, see the complementary 4/WHISPER-MAILSERVER and 11/WAKU-MAILSERVER.
Secure Transport
In order to provide confidentiality, integrity, authentication and forward secrecy of messages the node implements a secure transport on top of Whisper and Waku. This is used in 1:1 chats and group chats, but not for public chats. See 5/SECURE-TRANSPORT 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 an MVDS message which is added to an MVDS payload, the node encrypts this payload (if necessary for 1-to-1 / group-chats) and sends it using Whisper or Waku which also encrypts it.
Payloads and clients
On top of secure transport, various types of data sync clients and the node uses payload formats for things like 1:1 chat, group chat and public chat. These have various degrees of standardization. Please refer to 6/PAYLOADS for more details.
BIPs and EIPs Standards support
For a list of EIPs and BIPs that SHOULD be supported by Status client, please see 8/EIPS.
Security Considerations
See Appendix A
Design Rationale
P2P Overlay
Why devp2p? Why not use libp2p?
At the time Status developed the main Status clients, devp2p was the most mature. However, in the future libp2p is likely to be used, 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.
Why do you use Waku?
Waku is a direct upgrade and replacement for Whisper, the main motivation for developing and implementing Waku can be found in the Waku specs.
Waku was created to incrementally improve in areas that Whisper is lacking in, with special attention to resource restricted devices. We specify the standard for Waku messages in order to ensure forward compatibility of different Waku clients, backwards compatibility with Whisper clients, as well as to allow multiple implementations of Waku and its capabilities. We also modify the language to be more unambiguous, concise and consistent.
Considerable work has gone into the active development of Ethereum, in contrast Whisper is not currently under active development, and it has several drawbacks. Among others:
- Whisper is very wasteful bandwidth-wise and doesn’t appear to be scalable
- Proof of work is a poor spam protection mechanism for heterogeneous devices
- The privacy guarantees provided are not rigorous
- There are 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 Waku set so low?
A higher PoW would be desirable, but this kills the battery on mobile phones, 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 of implementing 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 until the node populates their peer list.
For some further investigation, see here.
I heard something about Mailservers
being trusted somehow?
In order to use a Mailserver
, 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 Mailserver
is able to send direct p2p messages to the node instead of broadcasting them. Effectively, it knows the bloom filter of the topics the node is interested in, when it is online as well as many metadata like IP address.
Data sync
Why is MVDS not used for public chats?
Currently, public chats are broadcast-based, and there’s no direct way of finding out who is receiving messages. Hence there’s no clear group sync state context whereby participants can sync. Additionally, MVDS is currently not optimized for large group contexts, which means bandwidth usage will be a lot higher than reasonable. See P2P Data Sync for Mobile for more. This is an active area of research.
Footnotes
- https://github.com/status-im/status-protocol-go/
- https://github.com/status-im/status-console-client/
- https://github.com/status-im/status-react/
Appendix A: Security considerations
There are several security considerations to take into account when running Status. Chief among them are: scalability, DDoS-resistance and privacy. These also vary depending on what capabilities are used, such as Mailserver
, light node, and so on.
Scalability and UX
Bandwidth usage:
In version 1 of Status, bandwidth usage is likely to be an issue. In Status version 1.1 this is partially addressed with Waku usage, see the theoretical scaling model.
Mailserver
High Availability requirement:
A Mailserver
has to be online to receive messages for other nodes, this puts a high availability requirement on it.
Gossip-based routing:
Use of gossip-based routing doesn’t necessarily scale. It means each node can see a message multiple times, and having too many light nodes can cause propagation probability that is too low. See Whisper vs PSS for more and a possible Kademlia based alternative.
Lack of incentives:
Status currently lacks incentives to run nodes, which means node operators are more likely to create centralized choke points.
Privacy
Light node privacy:
The main privacy concern with light nodes is that directly connected peers will know that a message originates from them (as it are the only ones it sends). This means nodes can make assumptions about what messages (topics) their peers are interested in.
Bloom filter privacy:
A user reveals which messages they are interested in, by setting only the topics they are interested in on the bloom filter. This is a fundamental trade-off between bandwidth usage and privacy, though the trade-off space is likely suboptimal in terms of the Anonymity trilemma.
Mailserver client
privacy:
A Mailserver client
has to trust a Mailserver
, which means they can send direct traffic. This reveals what topics / bloom filter a node is interested in, along with its peerID (with IP).
Privacy guarantees not rigorous:
Privacy for Whisper or Waku hasn’t been studied rigorously for various threat models like global passive adversary, local active attacker, etc. This is unlike e.g. Tor and mixnets.
Topic hygiene:
Similar to bloom filter privacy, using a very specific topic reveals more information. See scalability model linked above.
Spam resistance
PoW bad for heterogeneous devices:
Proof of work is a poor spam prevention mechanism. A mobile device can only have a very low PoW in order not to use too much CPU / burn up its phone battery. This means someone can spin up a powerful node and overwhelm the network.
Mailserver
trusted connection:
A Mailserver
has a direct TCP connection, which means they are trusted to send traffic. This means a malicious or malfunctioning Mailserver
can overwhelm an individual node.
Censorship resistance
Devp2p TCP port blockable:
By default Devp2p runs on port 30303
, which is not commonly used for any other service. This means it is easy to censor, e.g. airport WiFi. This can be mitigated somewhat by running on e.g. port 80
or 443
, but there are still outstanding issues. See libp2p and Tor’s Pluggable Transport for how this can be improved.
See https://github.com/status-im/status-react/issues/6351 for some discussion.
Acknowledgments
Jacek Sieka
Changelog
Version 0.3
Released May 22, 2020
- Added that Waku SHOULD be used
- Added that Whisper SHOULD NOT be used
- Added language to include Waku in all relevant places
- Change to keep
Mailserver
term consistent
Copyright
Copyright and related rights waived via CC0.
diff --git a/stable/11.html b/stable/11.html
deleted file mode 100644
index f4dc8b0..0000000
--- a/stable/11.html
+++ /dev/null
@@ -1,3 +0,0 @@
- 11/WAKU-MAILSERVER - Status Specification 11/WAKU-MAILSERVER | Status Specification 11/WAKU-MAILSERVER
Version: 0.1
Status: Stable
Authors: Adam Babik adam@status.im, Oskar Thorén oskar@status.im, Samuel Hawksby-Robinson samuel@status.im (alphabetical order)
Abstract
Being mostly offline is an intrinsic property of mobile clients. They need to save network transfer and battery consumption to avoid spending too much money or constant charging. Waku protocol, on the other hand, is an online protocol. Messages are available in the Waku network only for short period of time calculate in seconds.
Waku Mailserver is a specification that allows messages to be stored permanently and to allows the stored messages to be delivered to requesting client nodes, regardless if the messages are not available in the network due to the message TTL expiring.
Mailserver
From the network perspective, a Mailserver
is just like any other Waku node. The only difference is that a Mailserver
has the capability of archiving messages and delivering them to its peers on-demand.
It is important to notice that a Mailserver
will only handle requests from its direct peers and exchanged packets between a Mailserver
and a peer are p2p messages.
Archiving messages
A node which wants to provide Mailserver
functionality MUST store envelopes from incoming message packets (Waku packet-code 0x01
). The envelopes can be stored in any format, however they MUST be serialized and deserialized to the Waku envelope format.
A Mailserver
SHOULD store envelopes for all topics to be generally useful for any peer, however for specific use cases it MAY store envelopes for a subset of topics.
Requesting messages
In order to request historic messages, a node MUST send a packet P2P Request (0x7e
) to a peer providing Mailserver
functionality. This packet requires one argument which MUST be a Waku envelope.
In the Waku envelope’s payload section, there MUST be RLP-encoded information about the details of the request:
[ Lower, Upper, Bloom, Limit, Cursor ]
-
Lower
: 4-byte wide unsigned integer (UNIX time in seconds; oldest requested envelope’s creation time)
Upper
: 4-byte wide unsigned integer (UNIX time in seconds; newest requested envelope’s creation time)
Bloom
: 64-byte wide array of Waku topics encoded in a bloom filter to filter envelopes
Limit
: 4-byte wide unsigned integer limiting the number of returned envelopes
Cursor
: an array of a cursor returned from the previous request (optional)
The Cursor
field SHOULD be filled in if a number of envelopes between Lower
and Upper
is greater than Limit
so that the requester can send another request using the obtained Cursor
value. What exactly is in the Cursor
is up to the implementation. The requester SHOULD NOT use a Cursor
obtained from one Mailserver
in a request to another Mailserver
because the format or the result MAY be different.
The envelope MUST be encrypted with a symmetric key agreed between the requester and the Mailserver
.
Receiving historic messages
Historic messages MUST be sent to a peer as a packet with a P2P Message code (0x7f
) followed by an array of Waku envelopes.
In order to receive historic messages from a Mailserver
, a node MUST trust the selected Mailserver
, that is allowed to send packets with the P2P Message code. By default, the node discards such packets.
Received envelopes MUST be passed through the Waku envelope pipelines so that they are picked up by registered filters and passed to subscribers.
For a requester, to know that all messages have been sent by a Mailserver
, it SHOULD handle P2P Request Complete code (0x7d
). This code is followed by the following parameters:
[ RequestID, LastEnvelopeHash, Cursor ]
-
RequestID
: 32-byte wide array with a Keccak-256 hash of the envelope containing the original request LastEnvelopeHash
: 32-byte wide array with a Keccak-256 hash of the last sent envelope for the request Cursor
: an array of a cursor returned from the previous request (optional)
If Cursor
is not empty, it means that not all messages were sent due to the set Limit
in the request. One or more consecutive requests MAY be sent with Cursor
field filled in order to receive the rest of the messages.
Security considerations
Confidentiality
The node encrypts all Waku envelopes. A Mailserver
node can not inspect their contents.
Altruistic and centralized operator risk
In order to be useful, a Mailserver
SHOULD be online most of time. That means users either have to be a bit tech-savvy to run their own node, or rely on someone else to run it for them.
Currently, one of Status’s legal entities provides Mailservers
in an altruistic manner, but this is suboptimal from a decentralization, continuance and risk point of view. Coming up with a better system for this is ongoing research.
A Status client SHOULD allow the Mailserver
selection to be customizable.
Privacy concerns
In order to use a Mailserver
, 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 Mailserver
is able to send direct p2p messages to the node instead of broadcasting them. Effectively, it will have access to the bloom filter of topics that the user is interested in, when it is online as well as many metadata like IP address.
Denial-of-service
Since a Mailserver
is delivering expired envelopes and has a direct TCP connection with the recipient, the recipient is vulnerable to DoS attacks from a malicious Mailserver
node.
Changelog
Version 0.1
Released May 22, 2020
- Created document
- Forked from 4-whisper-mailserver
- Change to keep
Mailserver
term consistent - Replaced Whisper references with Waku
Copyright
Copyright and related rights waived via CC0.
diff --git a/stable/15.html b/stable/15.html
deleted file mode 100644
index cf504a0..0000000
--- a/stable/15.html
+++ /dev/null
@@ -1 +0,0 @@
- 15/NOTIFICATIONS - Status Specification 15/NOTIFICATIONS | Status Specification 15/NOTIFICATIONS
Local Notifications
A client should implement local notifications to offer notifications for any event in the app without the privacy cost and dependency on third party services. This means that the client should run a background service to continuously or periodically check for updates.
Android
Android allows running services on the device. When the user enables notifications, the client may start a ``Foreground Service`, and display a permanent notification indicating that the service is running, as required by Android guidelines. The service will simply keep the app from being killed by the system when it is in the background. The client will then be able to run in the background and display local notifications on events such as receiving a message in a one to one chat.
To facilitate the implementation of local notifications, a node implementation such as status-go
may provide a specific notification
signal.
Notifications are a separate process in Android, and interaction with a notification generates an Intent
. To handle intents, the NewMessageSignalHandler
may use a BroadcastReceiver
, in order to update the state of local notifications when the user dismisses or tap a notification. If the user taps on a notification, the BroadcastReceiver
generates a new intent to open the app should use universal links to get the user to the right place.
iOS
We are not able to offer local notifications on iOS because there is no concept of services in iOS. It offers background updates but they’re not consistently triggered, and cannot be relied upon. The system decides when the background updates are triggered and the heuristics aren’t known.
Why is there no Push Notifications?
Push Notifications, as offered by Apple and Google are a privacy concern, they require a centralized service that is aware of who the notification needs to be delivered to.
Copyright
Copyright and related rights waived via CC0.
diff --git a/stable/4.html b/stable/4.html
deleted file mode 100644
index 604f2c6..0000000
--- a/stable/4.html
+++ /dev/null
@@ -1,3 +0,0 @@
- 4/WHISPER-MAILSERVER - Status Specification 4/WHISPER-MAILSERVER | Status Specification 4/WHISPER-MAILSERVER
Version: 0.3
Status: Stable
Authors: Adam Babik adam@status.im, Oskar Thorén oskar@status.im (alphabetical order)
Abstract
Being mostly offline is an intrinsic property of mobile clients. They need to save network transfer and battery consumption to avoid spending too much money or constant charging. Whisper protocol, on the other hand, is an online protocol. Messages are available in the Whisper network only for short period of time calculate in seconds.
Whisper Mailserver
is a Whisper extension that allows to store messages permanently and deliver them to the clients even though they are already not available in the network and expired.
Mailserver
From the network perspective, Mailserver
is just like any other Whisper node. The only difference is that it has a capability of archiving messages and delivering them to its peers on-demand.
It is important to notice that Mailserver
will only handle requests from its direct peers and exchanged packets between Mailserver
and a peer are p2p messages.
Archiving messages
A node which wants to provide Mailserver
functionality MUST store envelopes from incoming message packets (Whisper packet-code 0x01
). The envelopes can be stored in any format, however they MUST be serialized and deserialized to the Whisper envelope format.
A Mailserver
SHOULD store envelopes for all topics to be generally useful for any peer, however for specific use cases it MAY store envelopes for a subset of topics.
Requesting messages
In order to request historic messages, a node MUST send a packet P2P Request (0x7e
) to a peer providing Mailserver
functionality. This packet requires one argument which MUST be a Whisper envelope.
In the Whisper envelope’s payload section, there MUST be RLP-encoded information about the details of the request:
[ Lower, Upper, Bloom, Limit, Cursor ]
-
Lower
: 4-byte wide unsigned integer (UNIX time in seconds; oldest requested envelope’s creation time)
Upper
: 4-byte wide unsigned integer (UNIX time in seconds; newest requested envelope’s creation time)
Bloom
: 64-byte wide array of Whisper topics encoded in a bloom filter to filter envelopes
Limit
: 4-byte wide unsigned integer limiting the number of returned envelopes
Cursor
: an array of a cursor returned from the previous request (optional)
The Cursor
field SHOULD be filled in if a number of envelopes between Lower
and Upper
is greater than Limit
so that the requester can send another request using the obtained Cursor
value. What exactly is in the Cursor
is up to the implementation. The requester SHOULD NOT use a Cursor
obtained from one Mailserver
in a request to another Mailserver
because the format or the result MAY be different.
The envelope MUST be encrypted with a symmetric key agreed between the requester and Mailserver
.
Receiving historic messages
Historic messages MUST be sent to a peer as a packet with a P2P Message code (0x7f
) followed by an array of Whisper envelopes. It is incompatible with the original Whisper spec (EIP-627) because it allows only a single envelope, however, an array of envelopes is much more performant. In order to stay compatible with EIP-627, a peer receiving historic message MUST handle both cases.
In order to receive historic messages from a Mailserver
, a node MUST trust the selected Mailserver
, that is allowed to send packets with the P2P Message code. By default, the node discards such packets.
Received envelopes MUST be passed through the Whisper envelope pipelines so that they are picked up by registered filters and passed to subscribers.
For a requester, to know that all messages have been sent by Mailserver
, it SHOULD handle P2P Request Complete code (0x7d
). This code is followed by the following parameters:
[ RequestID, LastEnvelopeHash, Cursor ]
-
RequestID
: 32-byte wide array with a Keccak-256 hash of the envelope containing the original request
LastEnvelopeHash
: 32-byte wide array with a Keccak-256 hash of the last sent envelope for the request
Cursor
: an array of a cursor returned from the previous request (optional)
If Cursor
is not empty, it means that not all messages were sent due to the set Limit
in the request. One or more consecutive requests MAY be sent with Cursor
field filled in order to receive the rest of the messages.
Security considerations
Confidentiality
The node encrypts all Whisper envelopes. A Mailserver
node can not inspect their contents.
Altruistic and centralized operator risk
In order to be useful, a Mailserver
SHOULD be online most of the time. That means users either have to be a bit tech-savvy to run their own node, or rely on someone else to run it for them.
Currently, one of Status’s legal entities provides Mailservers
in an altruistic manner, but this is suboptimal from a decentralization, continuance and risk point of view. Coming up with a better system for this is ongoing research.
A Status client SHOULD allow the Mailserver
selection to be customizable.
Privacy concerns
In order to use a Mailserver
, 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 Mailserver
is able to send direct p2p messages to the node instead of broadcasting them. Effectively, it will have access to the bloom filter of topics that the user is interested in, when it is online as well as many metadata like IP address.
Denial-of-service
Since a Mailserver
is delivering expired envelopes and has a direct TCP connection with the recipient, the recipient is vulnerable to DoS attacks from a malicious Mailserver
node.
Changelog
Version 0.3
Released May 22, 2020
- Change to keep
Mailserver
term consistent
Copyright
Copyright and related rights waived via CC0.
diff --git a/stable/8.html b/stable/8.html
deleted file mode 100644
index 243fb2a..0000000
--- a/stable/8.html
+++ /dev/null
@@ -1 +0,0 @@
- 8/EIPS - Status Specification 8/EIPS | Status Specification 8/EIPS
Version: 0.2
Status: Stable
Authors: Ricardo Guilherme Schmidt ricardo3@status.im
Abstract
This specification describes how Status relates with EIPs.
Table of Contents
Introduction
Status should follow all standards as possible. Whenever the Status app needs a feature, it should be first checked if there is a standard for that, if not, Status should propose a standard.
Support table
Status v0 Status v1 Other State BIP32 N Y N stable
BIP39 Y Y Y stable
BIP43 N Y N stable
BIP44 N Y N stable
EIP20 Y Y Y stable
EIP55 Y Y Y stable
EIP67 P P N stable
EIP137 P P N stable
EIP155 Y Y Y stable
EIP165 P N N stable
EIP181 P N N stable
EIP191 Y? N Y stable
EIP627 Y Y N stable
EIP681 Y N Y stable
EIP712 P P Y stable
EIP721 P P Y stable
EIP831 N Y N stable
EIP945 Y Y N stable
EIP1102 Y Y Y stable
EIP1193 Y Y Y stable
EIP1577 Y P N stable
EIP1581 N Y N stable
EIP1459 N N raw
Components
BIP32 - Hierarchical Deterministic Wallets
Support: Dependency.
Reference: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
Description: Enable wallets to derive multiple private keys from the same seed.
Used for: Dependency of BIP39 and BIP43.
BIP39 - Mnemonic code for generating deterministic keys
Support: Dependency.
Reference: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
Description: Enable wallet to create private key based on a safe seed phrase. Used for: Security and user experience.
BIP43 - Purpose Field for Deterministic Wallets
Support: Dependency.
Reference: https://github.com/bitcoin/bips/blob/master/bip-0043.mediawiki
Description: Enable wallet to create private keys branched for a specific purpose.
Used for: Dependency of BIP44, uses “ethereum” coin.
BIP44 - Multi-Account Hierarchy for Deterministic Wallets
Support: Dependency.
Reference: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
Description: Enable wallet to derive multiple accounts in top of BIP39.
Used for: Privacy.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/constants.cljs#L240
Observation: BIP44 don’t solve privacy issues regarding the transparency of transactions, therefore directly connected addresses through a transactions can be identifiable by a “network reconnaissance attack” over transaction history, this attack together with leakage of information from centralized services, such as exchanges, would be fatal against the whole privacy of users, regardless of BIP44.
EIP20 - Fungible Token
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-20
Description: Enable wallets to use tokens based on smart contracts compliant with this standard.
Used for: Wallet feature.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/tokens.cljs
EIP55 - Mixed-case checksum address encoding
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-55
Description: Checksum standard that uses lowercase and uppercase inside address hex value.
Used for: Sanity check of forms using ethereum address.
Related: https://github.com/status-im/status-react/issues/4959 https://github.com/status-im/status-react/issues/8707
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/eip55.cljs
EIP67 - Standard URI scheme with metadata, value and byte code
Support: Partial.
Reference: https://github.com/ethereum/EIPs/issues/67
Description: A standard way of creating Ethereum URIs for various use-cases.
Used for: Legacy support.
https://github.com/status-im/status-react/issues/875
EIP137 - Ethereum Domain Name Service - Specification
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-137
Description: Enable wallets to lookup ENS names.
Used for: User experience, as a wallet and identity feature, usernames.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/ens.cljs#L86
EIP155 - Simple replay attack protection
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-155
Description: Defined chainId parameter in the singed ethereum transaction payload.
Used for: Signing transactions, crucial to safety of users against replay attacks.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/core.cljs
EIP165 - Standard Interface Detection
Support: Dependency/Partial.
Reference: https://eips.ethereum.org/EIPS/eip-165
Description: Standard interface for contract to answer if it supports other interfaces.
Used for: Dependency of ENS and EIP721.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/eip165.cljs
EIP181 - ENS support for reverse resolution of Ethereum addresses
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-181
Description: Enable wallets to render reverse resolution of Ethereum addresses.
Used for: Wallet feature.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/ens.cljs#L86
EIP191 - Signed Message
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-191
Description: Contract signature standard, adds an obligatory padding to signed message to differentiate from Ethereum Transaction messages.
Used for: Dapp support, security, dependency of ERC712.
EIP627 - Whisper Specification
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-627
Description: format of Whisper messages within the ÐΞVp2p Wire Protocol.
Used for: Chat protocol.
EIP681 - URL Format for Transaction Requests
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-681 Description: A link that pop up a transaction in the wallet.
Used for: Useful as QR code data for transaction requests, chat transaction requests and for dapp links to transaction requests.
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/eip681.cljs
Related: Issue #9183: URL Format for Transaction Requests (EIP681) is poorly supported https://github.com/status-im/status-react/pull/9240 https://github.com/status-im/status-react/issues/9238 https://github.com/status-im/status-react/issues/7214 https://github.com/status-im/status-react/issues/7325 https://github.com/status-im/status-react/issues/8150
EIP712 - Typed Signed Message
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-712
Description: Standardize types for contract signature, allowing users to easily inspect whats being signed.
Used for: User experience, security.
Related: https://github.com/status-im/status-react/issues/5461 https://github.com/status-im/status-react/commit/ba37f7b8d029d3358c7b284f6a2383b9ef9526c9
EIP721 - Non Fungible Token
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-721
Description: Enable wallets to use tokens based on smart contracts compliant with this standard.
Used for: Wallet feature.
Related: https://github.com/status-im/status-react/issues/8909
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/erc721.cljs https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/tokens.cljs
EIP945 - Web 3 QR Code Scanning API
Support: Full.
Reference: https://github.com/ethereum/EIPs/issues/945
Used for: Sharing contactcode, reading transaction requests.
Related: https://github.com/status-im/status-react/issues/5870
EIP1102 - Opt-in account exposure
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-1102
Description: Allow users to opt-in the exposure of their ethereum address to dapps they browse.
Used for: Privacy, DApp support.
Related: https://github.com/status-im/status-react/issues/7985
EIP1193 - Ethereum Provider JavaScript API
Support: Full.
Reference: https://eips.ethereum.org/EIPS/eip-1193
Description: Allows dapps to recognize event changes on wallet.
Used for: DApp support.
Related: https://github.com/status-im/status-react/pull/7246
EIP1577 - contenthash field for ENS
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-1577
Description: Allows users browse ENS domains using contenthash standard.
Used for: Browser, DApp support.
Related: https://github.com/status-im/status-react/issues/6688
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/utils/contenthash.cljs https://github.com/status-im/status-react/blob/develop/test/cljs/status_im/test/utils/contenthash.cljs#L5
EIP1581 - Non-wallet usage of keys derived from BIP-32 trees
Support: Partial.
Reference: https://eips.ethereum.org/EIPS/eip-1581
Description: Allow wallet to derive keys that are less sensible (non wallet).
Used for: Security (don’t reuse wallet key) and user experience (don’t request keycard every login).
Related: https://github.com/status-im/status-react/issues/9088 https://github.com/status-im/status-react/pull/9096
Sourcecode: https://github.com/status-im/status-react/blob/develop/src/status_im/constants.cljs#L242
EIP1459 - Node Discovery via DNS
Support: - Reference: https://eips.ethereum.org/EIPS/eip-1459 Description: Allows the storing and retrieving of nodes through merkle trees stored in TXT records of a domain. Used for: Finding Waku nodes. Related: - Sourcecode: -
Copyright
Copyright and related rights waived via CC0.
diff --git a/stable/index.html b/stable/index.html
deleted file mode 100644
index 5f7e7df..0000000
--- a/stable/index.html
+++ /dev/null
@@ -1 +0,0 @@
- Stable specs - Status Specification Stable specs | Status Specification
diff --git a/style-guideline.html b/style-guideline.html
index 5c6a5b4..0f7dfb5 100644
--- a/style-guideline.html
+++ b/style-guideline.html
@@ -1,4 +1,4 @@
- STYLE-GUIDELINE - Status Specification STYLE-GUIDELINE | Status Specification Style guidelines for Status client specifications
Spellcheck
To run the spellchecker locally, you must install pyspelling.
It can then be run with the following command:
pyspelling -c spellcheck.yml
+ STYLE-GUIDELINE - Status Specification STYLE-GUIDELINE | Status Specification Style guidelines for Status client specifications
Spellcheck
To run the spellchecker locally, you must install pyspelling.
It can then be run with the following command:
pyspelling -c spellcheck.yml
Words that should be ignored or are unrecognized must be added to the wordlist.
Markdown Verification
We use remark to verify our markdown. You can easily run this tool simply by using our npm
package:
npm install
npm run lint
Language mode
- Specifications SHOULD use formal technical language (different from academic language).
- Where appropriate, language SHOULD NOT use personal pronouns.
- Avoid using the passive voice when being specific.
- In places where the passive voice is appropriate but makes the subject ambiguous, append the passive voice with “by
subject
”. Alternatively restructure the sentence to be in the active voice adding the sentence subject.
For further reading on writing technical documents please read the Google Technical Writing article on Active voice vs. passive voice.
Examples:
### Personal pronouns Informal: >In this specification, **we** describe Formal: >This specification describes Informal: >If **you** want to run a Waku node and receive messages from Status clients, it must be properly configured. Formal: >A Waku node must be properly configured to receive messages from Status clients. ### Passive voice Passive voice: >a corresponding confirmation **is broadcast** by one or more peers Active voice: >**one or more peers broadcast** a corresponding confirmation In the case where the object of the sentence needs to be highlighted or given prominence the passive voice is appropriate. However, pay attention to not introduce an ambiguous subject if communicating specific information is your goal. ### Appropriate use of the passive voice >The Batch Acknowledge packet is followed by a keccak256 hash of the envelope's batch data (raw bytes). The subject of the sentence is "a keccak256 hash", but the sentence wants to highlight the Batch Acknowledge. ### Ambiguous subject In many cases sentences written in passive voice may be grammatically correct but hide that the sentence lacks a specified subject. Ambiguous: >A message confirmation **is sent** using Batch Acknowledge Active specific: >**A node sends** a message confirmation using Batch Acknowledge Passive specific: >A message confirmation **is sent by a node** using Batch Acknowledge Notice that the ambiguous sentence infers or omits the subject. Making it unclear what or who performs an action on the object of the sentence. In the example ambiguous sentence it is not stated what or who is sending a message confirmation.