I have been experimenting with Ethereum and I achieved good results with Whisper in a private network. The main problem though is that it is pretty slow even when nodes are running in the same computer because messages take between 300-800ms to be received. What are some faster alternatives? My requirements are to be able to send small JSON messages as fast as possible.
First of all, Whisper is kind of a database to spread announcements to the Ethereum network - or more precisely, to all
geth nodes who have enabled Whisper. By default, Whisper is hidden behind a flag.
Whisper can be used to send messages. Sending messages will have the following properties:
- Receiver anonymity: no one knows who the actual receiver is
- No sender anonymity: a global passive adversary (e. g. your network service provider) can see the origin of the message
- Uncertainty whether a message reached its destination. You can increase the probability by using a higher TTL value but this comes with the drawback that you need to equip the message with a significantly more difficult proof of work.
The problem of Whisper is that each message is flooded through the network until its TTL is reached - even if it has reached the desired destination. And to prevent people from spamming the the network, Whisper nodes only accept messages with a certain proof-of-work which is closely related to the TTL value.
In private networks, this is not a problem. But the bigger the network becomes, the worse it gets.
Anonymous / Privacy preserving communication
There's the anonymity trilemma which states that you can achieve only two out of the following properties:
- Strong anonymity
- Low latency
- High throughput
So when, you want to send "messages as fast as possible" you need to live without strong anonymity.
At the moment, there something like a Whisper 2.0 for point-to-point messaging under development. The project is called
hopr. Its goal is to have:
- provable anonymity / privacy preserving communication as it uses the SPHINX packet format
- incentivations for the parties / nodes that relay messages
- adaptable anonymity - the user can choose to some extend the degree of privacy / anonymity by sacrificing
- latency or
- low relay fees or
- privacy guarantees
PSS (Postal Service over Swarm) has no benchmarks, but it sends a message only to a registered node, so I assume it to be faster.
Disclaimer: I work with the Swarm team.