As we have known, the Ethereum blockchain can be installed using PoW (Proof of Work) algorithm. This article will instruct you how to set up an Ethereum blockchain using PoA (Proof of Authority).
What is PoA with PoW?
PoW and PoA are two consensus algorithms that are commonly used in the blockchain network to authenticate transactions. If you Google search these 2 keywords, it will produce millions of results. However, we can understand these two algorithms with a normal example as follows.
2 young people apply for a job at a state-owned company. To be able to get in with the “right process”, the candidates must go through the test, interview with Tech Lead, and the interview with the Manager.
Proof of work
The first young man named PoW, who was a farmer’s child, unknown, so that he could get into the job, he had to use all his strength to go through the interviews. To finally be admitted to work, it takes a whole week.
The PoW algorithm in blockchain is similar to the example above. The PoW works like miners (excavators) in the Blockchain network. Excavators must use computational resource power (CPU, electrical power) to perform Blockchain algorithm decoding. Any strong excavator will successfully decode first and receive Bitcoin. It is like in the interview, the talented young man with the best skills will be recruited. The implementation of this decryption takes a lot of time, especially over time, the more difficulty of Blockchain network is, the longer the block creation time. Bitcoin network takes about ten minutes, Ethereum network takes over 1 minute.
In PoW, when a miner can control 51% of computing power in a network, it is possible to manipulate the entire blockchain network. In theory, it is possible, but in fact this is unlikely.
Proof of Authority
Continue the example of the second young man named PoA. He is the son of comrade X, a member of the Central Party, known by many people. And of course when he was interviewing, he just have to say a little. And he got his place immediately within 1 note, not having to test and interview. Simply because he has the identity and known by everyone.
The Node (PC) in the PoA blockchain network operated by the young man above, has a clear identity. Authentication on PoA is done by nodes with a clear identity, able to validate blocks. The identity of the user must follow some verification requirements (comrade X, grandchild of President Y), requiring an authenticated address and no criminal record.
And when based on identity to authenticate, nodes in the PoA blockchain network do not need to use computational resources, buckling out hard work like the PoW. Of course, the authentication time, creating a new block is also much faster just a few seconds for the Ethereum network.
PoA is quite similar to the Ethereum protocol. However, the PoA consensus mechanism allows for much faster block creation time, since it is not “digging” (algorithm decoding).
In PoA, users only need to provide identity and the network will automatically perform the whole process: from authorization to transaction execution. Just like the young POA just needs to provide the identity, the company will take care of it.
However the PoA blockchain has the disadvantage of poor security. Just like a company that recruits only known youths without relying on their own abilities, what will the result be? So it is recommended to use only in the Private blockchain network.
Setup 1 PoA blockchain network
This part of the article will introduce step by step in setting up an Ethereum network using PoA algorithm.
The environment here is Ubuntu 16.04.
Step 1: Install geth ethereum
On the Linux terminal, type the following command:
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum
The installation starts
Step 2: Create an account
Type this command:
geth --datadir [thư mục của bạn] account new
Create a new terminal window, run the following command to enter Ethereum console:
geth attach ~ / Blockchain / ethereum / geth.ipc
The bold text is the –datadir folder you created above
Type the following command to create a base account:
Step 3: Configure the blockchain network
Create a new terminal window, run the following command:
Select 2 – Configure new genesis to configure genesis block, then select the information as above. Note that accounts address is the address created in step 2.
The system will ask you to enter which ID, enter any number except 1, 2, 3 which is the ID of the existing Ethereum networks.
Enter the following information:
Ctrl + C to finish. The ethereum-poa.json file will be used for different computers. At the terminal, type the following command to start network PoA blockchain.
geth --datadir ethereum --port 3000
personal.unlockAccount(eth.coinbase, ‘password’, 0)
You will see the blockchain start network as shown below.
Do Trong Nguyen – FPT Software
Potato Tech Mag