Privacy-preserving messaging protocol for the web3
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
config 🎨 updated README and contract address Feb 14, 2019
migrations/contracts Updated comment on migration file Dec 10, 2018
test 🐛 signalling bugfix Feb 14, 2019
tools 🔧 Add packages, update Truffle Dec 19, 2018
.babelrc 🔧📝Truffle, Tooling, Comments, Style Dec 6, 2018
.eslintrc Fixed concurrency issues Dec 10, 2018
.solcover.js 🔧📝Truffle, Tooling, Comments, Style Dec 6, 2018
.solhint.json Finish stakeFunds function Dec 11, 2018
LICENSE Create LICENSE Nov 20, 2018 🎨 updated README and contract address Feb 14, 2019
config.json 🐛 signalling bugfix Feb 14, 2019
package.json ♻️ packages upgrades Feb 18, 2019
truffle.js 🔧📝🚧 setup config files and import Dec 19, 2018
yarn.lock ♻️ packages upgrades Feb 18, 2019


HOPR is a privacy-preserving messaging protocol that incentivizes users to participate in the network. It provides privacy by relaying messages via several relay nodes to the recipient. Relay nodes are getting paid via payment channels for their services.

For further details, see the full protocol specification on the wiki

Technical Demo

There is a standalone demo to showcase the functionality:

Software Requirements

  • Node.js >= 10 (this already ships with npx)

On Windows? 👀 here: Windows Setup

Account Requirements


git clone
cd messagingProtocol
yarn install

Setup the configuration file below before preceding. Navigate to the config/ folder and change the .secrets.json similar to the following one:

    "infuraRopstenURL": "",
    "infuraApiKey": "INFURA_PRODUCT_ID",
    "infuraRopstenWssURL": "wss://",
    "fundAccountEthAddress": "YOUR_ETHEREUM_ADDRESS",
    "fundAccountPrivateKey": "YOUR_PRIVATE_KEY"

Please make sure that you:

  • have whitelisted the contract 0x69fc313b19afab7D925E7e05C783E7B36327255b 0xd215A90a15Fede2C126352E200999fFE7D32A614 in your Infura account
  • got some funds on your Ropsten testnet account, you may want to use the faucet to receive test ether.

Now you can run the demo script via:

yarn demo

Demo Script

The demo will

  • generate four key pairs
  • create four test nodes and equip them with the previously generated key pairs
  • start all four nodes such that they listen to some port on your machine
  • establish connections between the nodes such that all nodes are transitively connected to each other and DHT lookup is working
  • fund the corresponding ropsten testnet account of each node with some test ether
  • crawl the network to find enough nodes in order to create a path of the desired length
  • create 4 messages and send them through the network
  • the nodes will
    • decrypt the message, process the SPHINX header, extract the embedded information
    • forward the messages and the embedded money
    • wait for an acknowledgement to be able to decrypt the encrypted transactions that they've received during the protocol execution
    • open a payment channel to the next hop in the case there is no one yet
  • let one party initiate a payout which will
    • settle the payment channels of that party
    • let the nodes listen to the on-chain Settle event and post a better transaction in case that a malicious party tries to close the channel with an unprofitable transaction
    • withdraw the money