m Besu
Key Points
- Enterprise Ethereum Client for public or private permissioned blockchains
References
Key Concepts
Hyperledger Besu is an Ethereum client designed to be enterprise-friendly for both public and private permissioned network use cases. It can also be ran on test networks such as Rinkeby, Ropsten, and Görli. Hyperledger Besu includes several consensus algorithms including PoW, and PoA (IBFT, IBFT 2.0, Etherhash, and Clique). Its comprehensive permissioning schemes are designed specifically for use in a consortium environment.
https://wiki.hyperledger.org/display/BESU/Hyperledger+Besu
What is Hyperledger Besu?
Hyperledger Besu is an open source Ethereum client developed under the Apache 2.0 license and written in Java. It can be run on the Ethereum public network or on private permissioned networks, as well as test networks such as Rinkeby, Ropsten, and Görli. Hyperledger Besu includes several consensus algorithms including PoW, PoA, and IBFT, and has comprehensive permissioning schemes designed specifically for uses in a consortium environment.
What are Hyperledger Besu’s Features?
Hyperledger Besu implements the Enterprise Ethereum Alliance (EEA) specification. The EEA specification was established to create common interfaces amongst the various open and closed source projects within Ethereum, to ensure users do not have vendor lock-in, and to create standard interfaces for teams building applications. Besu implements enterprise features in alignment with the EEA client specification.
Hyperledger Besu’s features include:
- The Ethereum Virtual Machine (EVM) : The EVM is the Turing complete virtual machine that allows the deployment and execution of smart contracts via transactions within an Ethereum blockchain.
- Consensus Algorithms: Hyperledger Besu implements various consensus algorithms which are involved in transaction validation, block validation, and block production (i.e., mining in Proof of Work). They include:
- Proof of Authority: Hyperledger Besu implements several Proof of Authority protocols. Proof of Authority consensus protocols are used when participants are known to each other and there is a level of trust between them––in a permissioned consortium network, for example.
- IBFT 2.0: In IBFT 2.0 networks, transactions and blocks are validated by approved accounts, known as validators. Validators take turns creating the next block. Existing validators propose and vote to add or remove validators. IBFT 2.0 has immediate finality. When using IBFT 2.0, there are no forks and all valid blocks are included in the main chain.
- Clique: Clique is more fault-tolerant than IBFT 2.0. Clique tolerates up to half of the validators failing. IBFT 2.0 networks require greater than or equal to ⅔ of validators to be operating to create blocks. Clique does not have immediate finality. Implementations using Clique must be aware of forks and chain reorganizations occurring.
- Proof of Work (Ethash): Proof of Work is used for mining activities on mainnet Ethereum.
- Storage: Hyperledger Besu uses a RocksDB key-value database to persist chain data locally. This data is divided into a few sub-categories:
- Blockchain: Blockchain data is composed of block headers that form the “chain” of data that is used to cryptographically verify blockchain state; block bodies that contain the list of ordered transactions included in each block; and transaction receipts that contain metadata related to transaction execution including transaction logs.
- World State: Every block header references a world state via a stateRoot hash. The world state is a mapping from addresses to accounts. Externally owned accounts contain an ether balance, while smart contract accounts additionally contain executable code and storage.
- P2P networking: Hyperledger Besu implements Ethereum’s devp2p network protocols for inter-client communication and an additional sub-protocol for IBFT2:
- Discovery: A UDP-based protocol for finding peers on the network
- RLPx: A TCP-based protocol for communication between peers via various “sub-protocols”:
- ETH Sub-protocol (Ethereum Wire Protocol): Used to synchronize blockchain state across the network and propagate new transactions.
- IBF Sub-protocol: Used by IBFT2 consensus protocol to facilitate consensus decisions.
- User-facing APIs: Hyperledger Besu provides mainnet Ethereum and EEA JSON-RPC APIs over HTTP and WebSocket protocols as well as a GraphQL API.
- JSON-RPC
- HTTP JSON-RPC Service
- WebSocket JSON-RPC Service
- GraphQL
- Monitoring: Hyperledger Besu allows you to monitor node and network performance.
- Node performance is monitored using Prometheus or the debug_metrics JSON-RPC API method.
- Network Performance is monitored with Alethio tools such as Block Explorer and EthStats Network Monitor.
- Privacy: Privacy in Hyperledger Besu refers to the ability to keep transactions private between the involved parties. Other parties cannot access the transaction content, sending party, or list of participating parties. Besu uses a Private Transaction Manager to implement privacy.
- Permissioning: A permissioned network allows only specified nodes and accounts to participate by enabling node permissioning and/or account permissioning on the network.
Besu POA - Proof of Authority Consensus Options: IBFT, Clique
Understanding Proof of Authority via Clique and IBFT 2.0 Private Networks (Part 1)
POA - Proof of Authority Consensus
Can select block builders, validators randomly or based on policy
Generally in any PoA consensus mechanism, validators alternate adding blocks to the blockchain in a series. In addition to adding blocks, they can choose to vote to add or kick out a validator. This allows malicious validators to be removed from the network, and trusted validators to be added. This gives PoA resistance against certain kinds of attack vectors
Compare Clique vs IBFT
Property | Clique | IBFT 2.0 |
Finality | Forks / Reorgs possible | Immediate Finality |
Validators Required | 1 | 4 |
Liveness | ½ validators live | >= ⅔ validators live |
Relative Speed | Faster than IBFT 2.0 | Slower than Clique |
Note in Firefly testing, Clique was significantly slower than IBFT
Use Case Questions for BESU Consensus
What are my finality requirements?
- Does my use case require that each block created instantly be confirmed?
- If a block is not instantly confirmed, what are the potential impacts?
How many validators do I intend my network to have?
- How many will I have at the start?
- How many could be added to the network over time?
- Do I think validators could leave my network?
- Would I stop running the network if a certain number of validators left?
- Do I need participants to join the network without being validators? Should they be able to submit transactions?
What fault tolerance does my network require?
- Does the number of validators that will participate at start allow for the network to continue running if one goes down?
- What happens if two or more validators go down?
How fast do I need to be able to create new blocks?
- Will the speed at which I need to create new blocks stay constant or can it slow down if new validators are added?
Documentation
Documentation on Hyperledger Besu can be found here: https://besu.hyperledger.org/
Repositories
https://github.com/hyperledger/besu/
https://github.com/hyperledger/besu-docs
Besu Overview 101 Blockchains
https://101blockchains.com/introduction-to-hyperledger-besu/
Hyperledger Besu, the latest addition among the Hyperledger projects.
- It provides a reliable platform for building public network use cases by leveraging the Ethereum public network. It also allows the creation of permissioned networks.
- It operates according to the Enterprise Ethereum Alliance standard, a standard reference for the creation of common interfaces between different closed and open source projects in the Ethereum ecosystem.
- It facilitates the adoption of different consensus mechanisms.
- Peer-to-peer networking represents one of the prominent features of Hyperledger Besu.
- Monitoring the performance of nodes and networks is another important element of Hyperledger Besu.
- Privacy ensures that external parties cannot access the list of parties involved in the transaction, or the transaction content, or reference of the sending and receiving parties.
One of the most wide-ranging applications associated with Hyperledger Besu is in the pharmaceutical industry. In the Save Pharmaceutical project, unused medicines are returned and provided to patients who need them through a platform based on Hyperledger Besu that connects drug repositories (e.g., pharmacies), drug donors (e.g., clinics), individual patients, and assisted living facilities and patients. The platform ensures a permissioned enterprise-level network to operate as a drug repository system.
Video Intro to Besu - 7 minutes
Let us discover the definition of Hyperledger Besu alongside its architecture and features. Most important of all, the following discussion would emphasize on the functionalities and its notable use cases.
Functionalities Supported on Hyperledger Besu
The functionalities of Hyperledger Besu are also one of the prominent reasons for driving its popularity. It provides the CLI (Command-Line Interface) along with WebSocket & HTTP-based APIs to ensure proper running, maintenance, and monitoring of nodes on the Ethereum network. Client APIs provide adequate support for general Ethereum functionalities, including smart contracts, dapp development, use cases involving operations, and deployment.
The tools like web3j, Truffle, and Remix help in supporting these activities. Furthermore, the Hyperledger Besu client also ensures support for the implementation of common JSON-RPC APIs. Therefore, users don’t have to face difficulties with integration and ecosystem tooling. The Hyperledger Besu client also provides support for the creation of private consortium networks with permissions.
Hyperledger Besu currently doesn’t have support for key management with the client owing to security issues. On the other hand, users can leverage the EthSigner or other Ethereum-compatible wallets for the management of private keys. Tools such as EthSigner also facilitate access to the key store alongside signing transactions through tools such as Microsoft Azure and Hashicorp Vault.
As mentioned already, it also supports node & account permissioning on the basis of local configuration and smart contracts. In addition, the zero-knowledge methods associated with the client can also facilitate private transactions in unison with the Aztex protocol. If the case involves an off-chain approach, then you can use Orion, which is an open-source private transaction manager.
Also Read: Future of Blockchain Technology
Practical Use Case of Hyperledger Besu
The final concern in any introduction to Hyperledger Besu would primarily refer to its practical use cases. One of the most wide-ranging applications associated with it is in the pharmaceutical industry. The problem of pharmaceutical waste in the US is one of the prominent issues with wastage of almost $2 billion worth of prescription drugs annually.
Massive volumes of prescription drugs remain unused in clinics, individual patient homes, and assisted living facilities. Therefore, the most plausible solution, in this case, might point towards destroying unused medication. However, the cost of disposing of unused drugs is another critical setback.
Furthermore, the legal precedents for disposing of unused drugs through incineration could create prominent environmental concerns. So, the most productive solution, in this case, would be a mechanism that can return unused medicines and provide them to patients who need them. Such a solution must comply with the following practical aspects for better efficiency.
- Motivation for pharmacies to serve as facilities to accept unused drugs
- Motivation for patients and clinics to donate unused drugs
- Comprehensive control and transparency over the quality and expiration of donated drugs
- Data security
One of the best examples of the use of Hyperledger Besu in creating such a solution is the Save Pharmaceutical project. The platform leverages Hyperledger Besu for connecting drug repositories, i.e., pharmacies, drug donors such as clinics, individual patients, and assisted living facilities and patients.
The Save Pharmaceutical project is currently under development and would turn out to be an exceptionally multi-functional product. It can be the ideal platform for donors to donate medications they are not using, and pharmacies could easily approve or reject the donated pharmacies. As a result, patients who need drugs and cannot avail of them due to financial difficulties can get the best quality drugs.
Hyperledger Besu serves as the ideal option in this use case because of its facility for operations on a public network. Therefore, patients could access information about the availability of drugs at pharmacies. In addition, the facility of permissioning can help pharmacies maintain better control over the acceptance and verification of quality of drugs.
As a result, Hyperledger Besu can ensure a permissioned enterprise-level network for working as a drug repository system. One can clearly notice that It is ideal for mission-critical applications on private Blockchain while utilizing features of permissionless protocol.
If you are a beginner in the world of blockchain technology, you should know about the Types of Blockchain.
Conclusion
The introduction of Hyperledger Besu in the Hyperledger ecosystem would spell new opportunities for enterprises to avail benefits of public network use cases. Most important of all, It ensures simple and flexible setup and installation through its general system requirements.
It is easier to establish system requirements for Hyperledger Besu with a clear impression of the network specifications such as query complexity, world state size, block gas limit, and the number of transactions. Furthermore, the open community of Hyperledger Besu also drives additional contributions to its ecosystem every day. The adoption of Hyperledger Besu is slowly gaining momentum. Learn more about Hyperledger Besu right now to capitalize on the opportunity!
Besu Performance Best Practices
Besu-Performance-Analysis-ofHyperledger-Besu-in-PrivateBlockchain-2022IEEEDapps link
Besu-Performance-Analysis-ofHyperledger-Besu-in-PrivateBlockchain-2022IEEEDapps.pdf file
consensus method impact
Block Time: Another critical parameter, block time, deter-
mines the block frequency, which directly impacts the latency
and throughput of Besu. This parameter should be carefully
configured according to the application’s needs in practice.
On the one hand, if a block period is very short (e.g., 1s),
Besu will generate blocks very frequently. This results in high
throughput and low latency for consensus algorithms with
finality properties such as QBFT and IBFT 2.0. However,
a short block period will cause more forks in a Clique
network, which in turn degrades the performance.
Load balancing impact
Using Caliper to Measure Besu Performance
Besu Comparison To Fabric
Compare Besu and Fabric - student paper
Potential Value Opportunities
why-hyperledger-besu-is-a-top-choice-for-financial-use-cases - Kaleido
https://www.hyperledger.org/blog/why-hyperledger-besu-is-a-top-choice-for-financial-use-cases
Hyperledger Besu has emerged as a preferred runtime for EVM-based financial initiatives worldwide. For projects like tokenization, settlements, CBDCs (Central Bank Digital Currencies), and trade finance, Besu stands out for its robust security features, versatility in network construction, performance, pluggability, and enterprise-friendly licensing and programming language.
Secure
Besu facilitates the establishment of private networks with meticulously controlled access, ensuring that only authorized entities can participate. This permissioned framework, coupled with strong policy management, empowers enterprises to manage data access with precision.
Key security features of Hyperledger Besu include:
- Secure consensus protocols: Robust and proven implementations of Byzantine Fault Tolerant consensus mechanisms such as IBFT2 and QBFT enhances network integrity.
- Adherence to encryption and security standards: Besu adheres to stringent encryption standards and undergoes regular updates to align with evolving security protocols.
- Node-level permissioning: The ability to control which node identities can participate in a chain, even if the node has network-level access to it.
- Account-level permissioning: The ability to configure granular access to the transaction pool at the level of individual Ethereum accounts.
Interoperable with EVM and private blockchains
Hyperledger Besu's dual functionality, facilitating both private network construction and compatibility with the Ethereum network, renders it highly interoperable. Organizations can build discrete networks for managing digital assets and use that same tried and tested technology for architectures involving public chains.
Besu is the right choice for projects that want to leverage the Ethereum Virtual Machine and offers full support for popular ERC token standards such as ERC20, ERC721, ERC1155, and ERC1400.
Features contributing to Hyperledger Besu's interoperability include:
- Cross-chain functionality: Layer-2 solutions such as Linea are already being built using Besu, demonstrating its suitability for a wide range of multi-chain architectures now and in the future.
- Standards compliance: Adhering to standard protocols and interfaces like JSON RPC enhances compatibility with various blockchain technologies and tools.
- Pluggable consensus algorithms: Besu's support for multiple consensus mechanisms enables integration with diverse networks, ensuring compliance with their governance and validation rules.
- Modular architecture: The modular design allows for easy integration of plug-and-play components for monitoring, logging, transaction validation & selection, metrics, and more, enhancing adaptability and scalability while customizing networks to meet use case demands.
Enterprise Open-source
The software license is also enterprise friendly. An Apache 2.0 License is a permissive free license that allows enterprises to modify and distribute products they build atop the protocol and choose which modifications remain proprietary and which will be contributed back to the community.
Key advantages of Hyperledger Besu's open-source framework include:
- Hyperledger Foundation backing: Hyperledger Foundation operates as a worldwide, open-source ecosystem dedicated to enterprise-grade blockchain solutions. Underpinned by technical and business governance, it certifies service providers to help companies find experienced support.
- Diverse and welcoming community that puts equal weight on public and enterprise, permissioned features.
- Enterprise-friendly license: Unlike Geth, with its less permissive license, Hyperledger Besu is licensed with the business-friendly Apache 2.0 license.
- Common programming language: Hyperledger Besu is written in Java, a well-established, widely used programming language that makes it easier for businesses to find and onboard developers for blockchain projects.
Potential Challenges
Ethereum Proof of Stake Concepts
https://consensys.net/blog/blockchain-explained/what-is-proof-of-stake/
Ethereum Client Architecture after Merge
https://etherworld.co/2021/12/20/an-overview-of-expected-changes-with-the-ethereum-merge-upgrade/
Ethereum Merge from POW to POS impacts Besu role **
Old vs New Ethereum Network Model: POW to POS
The reason the change from PoW to PoS is called “the Merge” is because the already running beacon chain will merge with the existing Ethereum mainnet chain. This preserves the history of the network, its functionality, but crucially changes the consensus mechanism. The beacon chain will coordinate data and the production of new blocks via network validators, which will use economic incentives to secure the blockchain (more info can be found here). At its core, the merge to PoS reduces network energy usage by at least 99.95%! Currently, the network has about the same carbon footprint as the entire nation of Finland and the ecosystem knows we need to do better. The Merge will also alleviate:
- The Proof of Work consensus mechanism is not sustainable and not scalable long-term.
- Proof of Stake makes participating in the network more attainable for many more users and not just large miners.
- More equal distribution of network rewards to incentivize good behaviors and open up yield to many more users, despite a decreased issuance rate of ETH and smaller block rewards.
Architecturally, the Merge is making use of the existing technology in Ethereum and supplementing it with what we need for the future. Current Ethereum clients, like Hyperledger Besu, will become known as “execution clients” and will handle state storage, block production, and smart contract interactions. “Consensus clients,” like Teku, will handle synchronizing state across the network and submitting transactions to the beacon chain. A new piece of technology called the “engine API” will allow these two clients to talk to each other extremely efficiently. All together, this new stack powers PoS with existing technologies and formats (like JSON RPC) and new ones such as REST APIs for the consensus clients.
Candidate Solutions
Step-by-step guide for Example
sample code block