Project Plan - Reworking HL Iroha Consensus API
Goal
The goal of the project is the Implementation and Integration of a Pluggable Consensus Interface for Hyperledger Iroha. Achieving this goal will increase the modularity of Iroha by giving the opportunity to use different consensus algorithms.
Background Knowledge
Blockchain is a distributed ledger that is stored on every peer in the network. This makes blockchain reliable, immutable and secure. But in order to achieve this goal peers must agree on the ledger that they will store (in order to have the same copy). To achieve this goal Consensus Algorithms are used. There are two types of consensus algorithms: the voting based and the lottery based ones. In voting based algorithms a single node can commit a block at any given time, thus forks don't happen. Meanwhile on lottery based ones forks can happen.
At the current time Hyperledger Iroha uses a Consensus Algorithm called YAC (Yet Another Consensus) and it is hardcoded in the Hyperledger Iroha's pipeline.
Previous Work
Hyperledger Sawtooth already supports dymanic consensus and has support for lottery and voting based algorithms. Currently there are implementations for PBFT, Raft and PoET.
Project Scope
- Adding Support for Hyperledger Sawtooth Consensus Engines to the Hyperledger Iroha
- Considering changes to the Hyperledger Iroha Pipeline and Blocks to support new Interface.
Technologies
Iroha is Implemented mainly in C++, meanwhile Sawtooth in Rust and Python. Additionally ZMQ library is used for network communication.
Deliverables
- Interface for communication with consensus engine.
- Interface for communication between the consensus components.
- Integration with the rest of Iroha Project
Project Timeline
Week 1-3
- Understand how Consensus works in Hyperledger Sawtooth.
- Get familiar with Hyperledger Iroha Implementation.
Week 3-6
- Implement Interface for Communication with Sawtooth Consensus Engine.
Week 6-9
- Implement the P2P Network Consensus Interface.
Week 9-12
- Integrate the component to the Iroha project
Methodology
- Quarter basis review according to Hyperledger Internship Programme schedule.
- Internal communication and updates with the mentors using Telegram.
- After every implementation, writing tests and testing.
Project Results
The reposetory for the project can be found here.
- An C++ API for communication with Hyperledger Sawtooth Consensus Engine.
- A blockchain simulator with the use of Sawtooth Consensus Engine.
- A consensus component (that uses Sawtooth Consensus Engine) was implemented for the Iroha project.