
Privacy leverage the public infrastructure while maintaining the confidentiality of your transactions
This is the first tutorial to get started with Privacy technology.
In 10 minutes, get Privacy running on your developer’s machine and understand
- where the Ethereum Privacy process sits between your web3 program and your usual Ethereum client node
- what configurations are required to have the technology ready to use
- how to specify with whom your transaction mus be shared
1.Before we start, some requirements for your target machine
The packaging as of now (v 0.1.2) uses docker image, so you need docker and docker-compose. This has been tested on the following version but it should work with others
Docker version 18.09.2, build 6247962
docker-compose version 1.23.2, build 1110ad01
2. Download the get-started package
~ $ git clone --depth 1
This will give you a folder structure with the following
: the docker services description and configuration
: common configuration file for all the privacy nodes
: shell script to prepare the public and privacy nodes
node1/keystore: contains a standard for node1
node2/keystore: same for privacy node2
node3/keystore: same for privacy node3
client: a node js command line projet that interacts with the privacy nodes
3. Deploy the environment
~/get-started $ ./setup-env.sh
- Starts the public node: here a simple geth in local dev mode with PoA consensus mining when a transaction is received
- Launching a geth attach — exec javascript to the public node, to credit each of the wallets that will be used by the Ethereum Privacy nodes to interact with the public node.
- Deploying in the public node the smart contract () used to the encrypted transaction and the encrypted notifications. . The generated contract address must be given to the privacy nodes so they know to what they should communicate with. This deployment is done using one of the privacy node command line.
- Starting each of the 3 Ethereum Privacy nodes (node A, node B, Node C)
- From each node, collect the other nodes public key (from their url) and it in the local PKI.
Setup is now ready and operational (also look at the for additional details). You can test the setup by running for each url
$ geth attach
Welcome to the Geth JavaScript console!
instance: Ethereum-Standalone-Node/v0.0.1/6000
coinbase: 0x1778fef1adf67b8d904a73f64da4d29c1f13ec0b
at block: 0 (Sat, 09 Feb 2019 18:53:29 CET)
modules: admin:1.0 eth:1.0 net:1.0 parked:1.0 personal:1.0 web3:1.0
geth public node listens for JSON RPC requests at
Privacy Node A listens for Web3 JSON RPC requests at Node B and C at and :8548 respectively.
4. Test the setup
with a NodeJS client using a simple key/value smart-contract.
The client test program uses the following smart contract as a mean to simulate private interactions between each other while going through the public
- The smart contract has the following behaviour
- Each key is globally unique, belong to the first person setting a value.
- Only the owner can change the value.
- An event is generated on first set and subsequent change
- Every one can read the value
Below is the recording of a test session that you can replicate easily on your machine.
# On top left terminal
$ node main.js --smartcontract create --listen --url
# On top right terminal
$ node main.js --smartcontract auto --listen --url
# On bottom left terminal
$ node main.js --smartcontract auto --listen --url 8
# On bottom right terminal
$ node main.js --smartcontract auto --url --key Hello --value World
$ node main.js --smartcontract auto --url --key Hello2 --value World-A-And-C --target 'node C'
$ node main.js --smartcontract auto --url --key Hello3 --value World-A-And-B --target 'node B'
Published at Mon, 08 Apr 2019 20:18:56 +0000