HYPERLEDGER BESU
As we all known Ethereum is popular for permisionless blockchain and on the other hand Hyperledger Fabric is popular for permissioned blockchain, here comes Hyperledger Besu which can be used on Ethereum public network or on private permissioned networks, as well as test networks such as Rinkeby, Ropsten, and Gorli. It is an open source Ethereum client developed under the Apache 2.0 license and written in Java.
It helps to develop the enterprise applications that require secure, high-transaction processing in a private network. The enterprise features supported by Besu are permissioning and privacy. Hyperledger Besu is also an Ethereum client. An ethereum client refers to a node that verifies a blockchain and its smart contracts and everything else related to a blockchain. In other words, it is a software that implements the Ethereum protocol.
The API of Hyperledger Besu supports typical Ethereum functionalities such as:
- Smart contract development.
- Ether mining.
- Decentralized application (DApp) development.
The features of Hyperledger Besu are
- Ethereum Virtual Machine (EVM) : It is the Turing complete virtual machine that enables deployment and execution of smart contracts through transactions within an Ethereum blockchain.
- Consensus protocols : Besu implements several consensus algorithms that are involved in block validation, transaction validation, and block production. The consensus algorithms of Besu are Proof-of-Authority and Proof-of-work.
- Storage : Hyperledger Besu uses a RocksDB key-value database for persisting chain data locally.
- Monitoring : Node and network performance can be monitored using Besu. Node performance is monitored through Prometheus or debug_metrics JSON-RPC API method. Network performance is monitored using Alethio tools like EthStats Network Monitor and Block Explorer.
- Privacy : Privacy in Besu refers to the ability to keep transactions between the involved parties safe and private. The private transaction manager of Besu implements privacy and does not allow other parties to access the transaction content, sending party, and the list of participating parties.
- Permissioning : Besu is a permissioned network that allows only specific nodes and accounts to participate by enabling account permissioning and/or node permissioning on the network.
The architecture of Hyperledger Besu looks like
Hyperledger Besu Architecture :
Storage : In a storage setup, the data is divided into a few sub-categories, such as:
- Blockchain - This is comprised of ‘block headers’ that form the chain of data that is used to verify the blockchain state cryptographically. Block bodies contain the list of ordered transactions that are included in each block. Transaction receipts contain metadata related to transaction execution, and this includes transaction logs.
- World state - Every block header references a world state through a stateRoot hash. World state refers to a mapping from addresses to accounts. An Ether balance is maintained by externally owned accounts. Smart contract accounts additionally contain executable code and storage.
P2P networking : Besu implements Ethereum’s devp2p network protocols for inter-client communication and a sub-protocol for IBFT2:
- Discovery - A UDP-based protocol to find users on the network.
- RLPx - A TCP-based protocol that is used for communication between peers through sub-protocols. They are the ETH sub-protocol (Ethereum Wire Protocol) that is used to synchronize the blockchain state across the network and propagate new transactions and the IBF sub-protocol that is used by IBFT2 consensus protocol to facilitate consensus decisions.
User-facing APIs : Besu provides mainnet Ethereum and EEA JSON-RPC APIs over HTTP and WebSocket protocols and the GraphQL API.
JSON-RPC:
1.HTTP JSON-RPC service
2.WebSocket JSON-RPC Service
CONSENSUS PROTOCOLS
Hyperledger Besu makes use of many Proof of Authority (PoA) consensus protocols. These are used when participants are known to each other, and there is a high level of trust between them, for example, in a permissioned consortium network. The types of PoA algorithms implemented by Hyperledger Besu are:
- Clique - This is used by the Rinkeby Testnet and can be used for private networks. In a Clique network, blocks and transactions are validated by approved accounts. These accounts are called signers. Signers will take turns to create the next block. The existing signers propose and vote to add or remove signers. Clique is more fault-tolerant than IBFT 2.0. Clique does not have immediate finality. Implementations using clique must be aware of chain reorganizations and the forks that occur. The properties that are specific to clique are:
- Blockperiodseconds - Block time in seconds.
- epochLength - Number of blocks following which the votes must be reset.
- extraData - Initial signers are specified after the 32 bytes that are reserved for vanity data.
- IBFT 2.0 - This can be used for private networks. Here, blocks and transactions are validated by approved accounts called validators. Validators will take turns to create the next block, and a super-majority (greater than 66%) of validators are required to sign the block before it is inserted into the chain. Existing validators will propose and vote to remove or add validators. A majority vote (more than 50%) is needed to add or remove a validator. IBFT 2.0 needs four validators to be Byzantine Fault Tolerant.