What Is Ether Mining?
Mining is the process through which transactions are being verified and added to the public ledger, accompanied by release of new crypto coins, ethers in this case. Mining is the activity of miners, participants of the Ethereum network. In theory, any network participant (node), that stores the full Ethereum blockchain on its computer, can become a miner.
This is a distributed register, which stores data on all transactions performed within the Ethereum network. Blockchain is a sort of database that is cryptographically protected, unalterable, and decentralized (stored on devices of the network members). The computers that store blockchain are called full nodes.
What does blockchain consist of?
Blockchain consists of sequentially linked blocks that have a clear structure. Each block contains a header and a list of transactions confirmed by the block.
How does Ethereum blockchain work
Each new block is created once per 12-15 seconds and added to blockchain. After that, the fresh data is updated for all network members and cannot be changed by anyone. Only valid blocks can get attached to blockchain.
How to check the validity of a block?
Structure of the block in blockchain
A block header contains data about the previous valid block added to blockchain. If a miner manages to find a new block, information about its validity is checked by matching with blockchain. Transactions are also checked, and the valid ones are recorded to the block and considered complete.
Block formation requires the use of computing capacities of the network participants. Each node tries to form a valid block by using computational resources of its computer.
To start mining ether, a user installs a special software (program) that uses a hash function with a certain data encryption algorithm.
What is a hash function?
A hash function is a mathematical function that works as an encoder. Any data string is transformed in such a way that it is impossible to get input information from a hash (or a hash value) − the result obtained after a hash function is processed.
How does a hash function work
A hash function used in ether mining is called Ethash, and the value that the miner searches for is a certain number called nonce. The search for a valid nonce is essentially a brute force attack. The higher the computational power is, the higher the chance of finding a nonce and adding a new block to blockchain.
The computational power of a node is determined by its hash rate, which indicates the speed of processing information by a computer and shows the number of hashes found per second. Ethereum users with high hash rates find new blocks more frequently. As a result, they get ether more often. A reward is distributed among all participants by the Proof-of-Work principle.
Proof-of-Work (PoW) is a consensus algorithm, allowing the network nodes to reach agreement on blockchain transactions. In this case, the “work” is the mining process that includes searching for the right nonce and recording transactions to blockchain.
Proof-of-Work vs. Proof-of-Stake
The Ethereum network unites thousands of nodes, but only the node that first discovers a block gets a reward. The size of the reward is always different and is generated with each new block.
What does a reward consist of?
A static block reward
A static block reward is 3 ETH. Previously, the static block reward was 5 ETH, somehow later its size was changed in the protocol.
A commission for transactions
Each time a transaction is sent, a user pays a commission, and a miner receives this commission as a reward for mining. The amount of commissions for all the transactions added to the block changes every time.
The commission size is determined by a transaction sender and is set in Wei or GWei (also known as "gas" or "fuel"). Wei is the tiniest fractional unit of ether, while 1 Gwei = 1 billion wei, and 1018 Wei = 1 ETH. If a sender does not define a commission size or there is not enough money in their wallet to pay the commission, the transaction is considered invalid and money is not transferred.
Uncles are blocks that were found in parallel to other valid blocks (within six closed blocks), but were not included in blockchain. Nevertheless, uncles add weight to blockchain like tree branches. This contributes to the strengthening of decentralization and hence the security of the Ethereum network, and is determined by a special GHOST protocol. A miner can add not more than two uncles per block at will. The reward per each added uncle is 7/8 of the regular reward, which is 2,625 ETH.
This method was used from the very beginning of the Ethereum's existence. Somehow, in 2018-2019, the developers intend to switch to Proof-of-Stake.
Proof-of-Stake (PoS) is another consensus algorithm, it does not involve the computing power of nodes. PoS allows making mining cheaper because it excludes high electricity costs and purchasing of expensive mining equipment that can ensure a higher hash rate.
When it comes to PoS, a hash rate does not play any role here. What matters is the ether amount a user stores and is ready to provide for mining. This entails changes in terminology: the process of getting new coins is no longer mining but forging, and its participants are called forgers.
The users who want to become forgers join a pool of validators who provide their own coins for a new block production. The one who provides the biggest amount of ethers for forging receives a reward. The reward depends on transaction commissions and the sum provided for forging.
All changes, that regulate the process of switching from Proof-of-Work to Proof-of-Stake and concern the PoS method itself, are described in the Casper algorithm, an update of the main Ethereum protocol performed as part of transition from Ethereum 1.0 to Ethereum 2.0. The algorithm will be implemented gradually, and during the transition period, a hybrid method of reward distribution will be used — PoW and PoS alternately.
According to the protocol, the validator, who violated its conditions for the purpose of fraud, is deprived of his deposit and the opportunity to forge. This is done to improve the network security and indicated in the Mauve Paper, a document containing all the information regarding Ethereum 2.0.