• This repository has been archived on 20/Sep/2023
  • Stars
    star
    157
  • Rank 238,322 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MirBFT is a consensus library implementing the Mir consensus protocol.

MirBFT Library

⚠️ ⚠️ ⚠️

This project has been archived by the project maintainers as the development has been moved to https://github.com/filecoin-project/mir.

This open-source project is part of Hyperledger Labs.

It aims at developing a production-quality implementation of:

  • a general framework for easily implementing distributed protocols
  • the ISS Byzantine fault tolerant consensus protocol.

MirBFT is intended to be used as a scalable and efficient consensus layer in Filecoin subnets and, potentially, as a Byzantine fault tolerant ordering service in Hyperledger Fabric.

Overview

MirBFT is a library that provides a general framework for implementing distributed algorithms in a network transport, storage, and cryptographic algorithm agnostic way. MirBFT hopes to be a building block of a next generation of distributed systems, being used by many applications.

Insanely Scalable State Machine Replication

The first algorithm to be implemented in MirBFT is called ISS (Insanely Scalable SMR), a state-of-the-art atomic broadcast protocol which can be utilized by any distributed system.

ISS improves on traditional atomic broadcast protocols like PBFT and Raft, which always have a single active leader that proposes batches of requests for ordering, by allowing multiple leaders to do so concurrently, without giving up total order guarantees. The multi-leader nature of ISS leads to exceptional performance, especially on wide area networks, but should be suitable for LAN deployments as well.

Structure and Usage

MirBFT is a framework for implementing distributed algorithms (also referred to as distributed protocols) meant to run on a distributed system. The basic unit of a distributed system is a node. Each node locally executes (its portion of) an algorithm, sending and receiving messages to and from other nodes over a communication network.

MirBFT models a node of such a distributed system and presents the consumer (the programmer using MirBFT) with a Node abstraction. The Node receives requests, processes them (while coordinating with other Nodes using the distributed protocol), and eventually delivers them to a (consumer-defined) application. Fundamentally, MirBFT's purpose can be summed up simply as receiving requests from the consumer and delivering them to an application as prescribed by some protocol. Te ISS protocol, for example, being a total order broadcast protocol, guarantees that all requests received by the nodes will be delivered to the application in the same order.

Note that the application need not necessarily be an end-user application - any program using MirBFT is, an application from MirBFT's point of view. While the application logic is (except for the included sample demos) always expected to be provided by the MirBFT consumer, this need not be the case for the protocol. While the consumer is free to provide a custom protocol component, MirBFT will provide out-of-the-box implementations of different distributed protocols for the consumer to select (the first of them being ISS).

We now describe how the above (providing an application, selecting a protocol, etc.) works in practice. This is where MirBFT's modular design comes into play. The Node abstraction mentioned above is implemented as a Go struct that contains multiple modules. In short, when instantiating a Node, the consumer of MirBFT provides implementations of these modules to MirBFT. For example, instantiating a node might look as follows:

    // Example Node instantiation adapted from samples/chat-demo/main.go
    node, err := mirbft.NewNode(/*some more arguments*/ &modules.Modules{
        Net:      grpcNetworking,
        // ...
        Protocol: issProtocol,
        App:      NewChatApp(reqStore),
        Crypto:   ecdsaCrypto,
    })

Here the consumer provides modules for networking (implements sending and receiving messages over the network, in this case using gRPC), the protocol logic (using the ISS protocol), the application (implementing the logic of a chat app), and a cryptographic module (able to produce and verify digital signatures using the ECDSA algorithm). There are more modules a Node is using, some of them always have to be provided, some can be left out and MirBFT will fall back to default built-in implementations. Some modules, even though they always need to be explicitly provided at Node instantiation, are part of MirBFT and can themselves be instantiated easily using MirBFT library functions.

Inside the Node, the modules interact using Events. Each module independently consumes, processes, and outputs Events. This approach bears resemblance to the actor model, where Events exchanged between modules correspond to messages exchanged between actors.

The Node implements an event loop, where all Events created by modules are stored in a buffer and, based on their types, distributed to their corresponding modules for processing. For example, when the networking module receives a protocol message over the network, it generates a MessageReceived Event (containing the received message) that the Node implementation routes to the protocol module, which processes the message, potentially outputting SendMessage Events that the Node implementation routes back to the networking module.

The architecture described above enables a powerful debugging approach. All Events in the event loop can, in debug mode, be recorded, inspected, or even replayed to the Node using a debugging interface.

The high-level architecture of a Node is depicted in the figure below. For more details, see the module interfaces and a more detailed description of each module in the Documentation. High-level architecture of a MirBFT Node

Relation to the Mir-BFT algorithm

The term Mir-BFT was introduced as a name for a scalable atomic broadcast algorithm - the Mir-BFT algorithm. The MirBFT library initially started as an implementation of that (old) algorithm - thus the shared name - but the algorithm implemented within the library has since been replaced by its modular and superior successor, ISS. Thus, we refer to the library / framework as MirBFT, and to the algorithm it currently implements as ISS. Since MirBFT is designed to be modular and versatile, ISS is just one (the first) of the algorithms implemented in ISS.

Current Status

This library is in development and not usable yet. This document describes what the library should become rather than what it currently is. This document itself is more than likely to still change. You are more than welcome to contribute to accelerating the development of the MirBFT library. Have a look at the Contributions section if you want to help out!

Build Status GoDoc

Compiling and running tests

The MirBFT library relies on Protocol Buffers. The protoc compiler and the corresponding Go plugin need to be installed. Moreover, some dependencies require gcc to be installed as well. On Ubuntu Linux, those can be installed using

sudo snap install --classic go
sudo snap install --classic protobuf
sudo apt install gcc

Once instaled, the Protocol Buffer files need to be generated by executing

go generate ./protos

in the mirbft root repository directory. This command also has to be executed each time the .proto files in the protos folder change.

Now the tests can be run by executing

go test

The dependencies should be downloaded and installed automatically.

Documentation

For a description of the design and inner workings of the library, see MirBFT Library Architecture.

For a small demo application, see /samples/chat-demo

Contributing

Contributions are more than welcome!

If you want to contribute, have a look at our Contributor's guide and at the open issues. If you have any questions (specific or general), do not hesitate to drop an email to the active maintainer(s).

Public Bi-Weekly Community Call

There is a public community call once every two weeks. The current status, any issues, future plans, and anything relevant to the project will be discussed. Whether you have any questions that you want to ask or you have a proposal to discuss, or whether you just want to listen in, feel free to join!

Meeting information:

Research prototypes

The research branch contains code developed independently as a research prototype of the (old) Mir BFT protocol and was used to produce experimental results for the (old) Mir BFT research paper.

The research-iss branch contains code developed independently as a research prototype of the ISS protocol and was used to produce experimental results for the EuroSys22 research paper.

Summary of references

Active maintainer(s)

Initial committers

Sponsor

Angelo de Caro ([email protected]).

License

The MirBFT library source code is made available under the Apache License, version 2.0 (Apache-2.0), located in the LICENSE file.

Acknowledgments

This work has been supported in part by the European Union's Horizon 2020 research and innovation programme under grant agreement No. 780477 PRIViLEDGE.

More Repositories

1

blockchain-explorer

JavaScript
1,394
star
2

Scorex

Scorex 2.0 Core
Scala
545
star
3

minifabric

Do fabric network the right and easy way.
Jinja
299
star
4

blockchain-carbon-accounting

This project implements blockchain applications for climate action and accounting, including emissions calculations, carbon trading, and validation of climate claims. It is part of the Linux Foundation's Hyperledger Climate Action and Accounting SIG.
TypeScript
181
star
5

university-course

A Hyperledger Lab focused developing materials for a university course.
TeX
179
star
6

fablo

Fablo is a simple tool to generate the Hyperledger Fabric blockchain network and run it on Docker. It supports RAFT and solo consensus protocols, multiple organizations and channels, chaincode installation and upgrade.
Shell
179
star
7

convector

Smart Contract Systems the easy way. Open source development framework.
TypeScript
145
star
8

yui-ibc-solidity

IBC in Solidity
Solidity
132
star
9

private-data-objects

The Private Data Objects lab provides technology for confidentiality-preserving, off-chain smart contracts.
C++
112
star
10

fabric-operations-console

A UI for managing Fabric peers, orderers, and CAs
JavaScript
103
star
11

hyperledger-labs.github.io

Hyperledger Labs
100
star
12

SmartBFT

Implementation of the SmartBFT consensus library (https://arxiv.org/abs/2107.06922)
Go
88
star
13

fabric-token-sdk

The Fabric Token SDK is a set of API and services that lets developers create token-based distributed application on Hyperledger Fabric.
Go
80
star
14

microfab

Microfab is a containerized Hyperledger Fabric runtime for use in development environments
Go
73
star
15

fabric-docs-cn

This lab has graduated to the overall Fabric project.
71
star
16

TrustID

Decentralized Identity solution compatible with different Hyperledger platforms.
TypeScript
67
star
17

open-enterprise-agent

Open Enterprise Cloud Agent
Scala
62
star
18

minbft

Implementation of MinBFT consensus protocol.
Go
60
star
19

fabric-operator

Hyperledger Fabric Kubernetes Operator
Go
57
star
20

business-partner-agent

The Business Partner Agent is a SSI wallet and controller based on aries cloud agent python.
Java
55
star
21

weaver-dlt-interoperability

A platform, a protocol suite, and a set of tools, to enable interoperation for data sharing and asset movements between independent networks built on heterogeneous blockchain, or more generally, distributed ledger, technologies, in a manner that preserves the core blockchain tenets of decentralization and security.
Go
52
star
22

fabric-smart-client

The Fabric Smart Client is a new Fabric Client that lets you focus on the business processes and simplifies the development of Fabric-based distributed application.
Go
51
star
23

go-perun

🌔 Perun's Blockchain-Agnostic State Channels Framework in Go.
Go
47
star
24

hyperledger-fabric-based-access-control

A Hyperledger Fabric Based Access Control system to mediate access control flow from centralized applications.
HTML
41
star
25

nephos

Python library and Helm charts for deployment of Hyperledger Fabric to Kubernetes.
Python
37
star
26

nft-auction

NFT Auction application lets user to create NFTs and auction them off to other users in a marketplace model using Hyperledger Fabric
JavaScript
37
star
27

yui-fabric-ibc

IBC implementation in Hyperledger Fabric
Go
34
star
28

eThaler

Model a sample CBDC in TTF and implement in Besu
Java
34
star
29

cc-tools

The cc-tools package provides a relational-like framework for programming Hyperledger Fabric chaincodes.
Go
33
star
30

cordentity

The Cordentity app integrates Indy capabilities into the Corda platform.
Kotlin
32
star
31

yui-relayer

IBC Relayer implementations for heterogeneous blockchains
Go
32
star
32

orion-server

Go
30
star
33

yui-docs

Solidity
29
star
34

fabex

Block explorer for Hyperledger Fabric
Go
28
star
35

fabric-chaincode-wasm

Hyperledger Fabric Chaincode using WebAssembly
Go
28
star
36

fabric-chrome-extension

Hyperledger Fabric Chrome Extension
JavaScript
28
star
37

fabric-builder-k8s

Kubernetes chaincode builder for Hyperledger Fabric
Go
27
star
38

pubsub-interop

A blockchain interoperability solution for permissioned blockchain networks based on a publish/subscribe pattern.
HTML
26
star
39

cc-tools-demo

Basic example of how to use cc-tools to easily program a Hyperledger Fabric chaincode.
Shell
25
star
40

zeto

Privacy-preserving implementations of fungible and non-fungible tokens, using UTXO as the underlying transaction model
Solidity
24
star
41

fabric-opssc

Operations Smart Contract (OpsSC) for Hyperledger Fabric v2.x
Go
23
star
42

blockchain-analyzer

Analyze ledger data stored within a Hyperledger Fabric peer (key updates and operational data such as number of blocks and transactions).
Go
23
star
43

fabric-chaincode-haskell

Haskell support for smart contracts in Hyperledger Fabric
Haskell
23
star
44

pluggable-hcs

Go
20
star
45

yui-corda-ibc

IBC implementation in Corda
Kotlin
20
star
46

sawtooth-healthcare

This project focuses on interaction between Insurer, Insured Person (Patient), and Medical Facility
Python
20
star
47

harmonia

Regulated Network Interoperability
Java
20
star
48

acapy-java-client

Aries Cloud Agent Python Java Client Library
Java
18
star
49

agora-glass_pumpkin

agora-glass_pumpkin
Rust
18
star
50

perun-node

State channel node of the blockchain-agnostic state channels framework Perun.
Go
18
star
51

umbra

This lab is to make running Hyperledger distributed ledgers under the Mininet platform.
Python
18
star
52

fabric-debugger

A Hyperledger Fabric chaincode debugging plugin for VS code.
JavaScript
18
star
53

blockchain-verifier

bcverifier: Blockchain verification tool
TypeScript
16
star
54

fabric-machine

Xilinx Blockchain Machine for Hyperledger Fabric.
Go
14
star
55

crypto-lib

A lab for experimentation on creating shared cryptography modules for cross-project collaboration
Rust
14
star
56

aifaq

AI FAQ Proof-of-Concept project: it provides a chatbot that replies to the questions on Hyperledger Ecosystem
Jupyter Notebook
14
star
57

z-mix

z-mix will offer a generic way to create Zero-Knowledge proofs, proving statements about multiple cryptographic building blocks, containing signatures, commitments, and verifiable encryption.
Rust
14
star
58

private-transaction-families

Provides a mechanism for privacy over Hyperledger Sawtooth by enforcing a policy of access control to the ledger.
C
13
star
59

cckit

Programming toolkit for developing and testing Hyperledger Fabric applications, started as https://github.com/s7techlab/cckit
Go
13
star
60

agora-unknown_order

agora-unknown_order
Rust
12
star
61

hlf-connector

Integrate with Hyperledger Fabric using REST and Kafka with Block and Chaincode Event emitter.
Java
12
star
62

SParts

The Software Parts (SParts) lab delivers a Sawtooth-based ledger that provides both accountability and access to the open source components used in the construction of a software part. A software part is any software component (e.g., library, application, container or an entire operating system runtime) that is comprised of between 0% and 100% open source.
Go
12
star
63

fabric-block-archiving

Go
11
star
64

fabric-multi-channel-network-samples

This lab provides samples for multi channel network using Hyperledger Fabric.
Shell
11
star
65

keyhole-fabric-api-gateway

Client Access to Hyperledger Fabric Blockchain Network through Restful API's
JavaScript
11
star
66

PerformanceSandBox

Sandbox for Hyperledger Projects Performance research usage
Shell
11
star
67

orion-sdk-go

Go
10
star
68

cardea-mobile-agent

JavaScript
9
star
69

bdls-lab

BDLS
Go
9
star
70

perun-eth-contracts

🌔 Perun's Ethereum State Channel Contracts
TypeScript
9
star
71

hyperledger-community-management-tools

Tools used to manage and evaluate the Hyperledger Community
JavaScript
9
star
72

solidity2chaincode

This tool converts Solidity contract into Javascript chaincode through source-to-source translation for running them onto Hyperledger Fabric.
JavaScript
9
star
73

solang-vscode

A VSCode plugin for a Solidity to WASM compiler written in Rust
Rust
8
star
74

learning-tokens

Uses the composable Interwork Alliance Token Taxonomy Framework (IWA TTF) to produce a Learning Token
TypeScript
8
star
75

perun-doc

Blockchain-agnostic state channels framework
Python
8
star
76

cardea

8
star
77

modern-pharmacy-management

This Lab will focus on leveraging blockchain to transform and modernize prescriptions management by enabling flexibility and managing fraud
Shell
8
star
78

fabric-ansible-collection

Ansible collection for building Hyperledger Fabric networks
Python
8
star
79

chaincode-analyzer

Go
8
star
80

karma-charity-platform

Blockchain-based charity foundation platform
TypeScript
7
star
81

patient-consent

Python
7
star
82

aries-fabric-wrapper

TypeScript
7
star
83

fabric-chaincode-ocaml

OCaml support for smart contracts in Hyperledger Fabric
OCaml
7
star
84

weft

CLI tool to work with Hyperledger Fabric identities and connection profiles; enables conversion between the various forms used by different codebase.
TypeScript
7
star
85

besu-operator

Kubernetes operator to provide an easier way of packaging, deploying, and managing Hyperledger Besu network.
Go
7
star
86

did-webs-resolver

A reference implementation for the did:webs DID method specified here https://github.com/trustoverip/tswg-did-method-webs-specification. The original work for the reference impl started here https://github.com/WebOfTrust/did-keri-resolver
Python
7
star
87

fabric-consortium-management

Go
5
star
88

byzantine-config

GUI Utility that simplifies creating configuration blocks and generating user keys
JavaScript
5
star
89

perun-cosmwasm-backend

Go-Perun CosmWasm Backend
Go
5
star
90

dancap

A lab for exploring attestation portability
C++
5
star
91

cardea-mobile-secondary-verifier-agent

JavaScript
5
star
92

HL-Starterkit

Hyperledger CLI Starter Kit
Shell
5
star
93

documentation-template

Template for creating documentation for Hyperledger projects
HTML
5
star
94

fabric-topologies

Scripts and configurations to easily setup various Hyperledger Fabric topologies that exercise advanced Hyperledger Fabric capabilities.
Shell
4
star
95

perun-credential-payment

Trustless payment for verifiable credentials using go-perun.
Go
4
star
96

fabric-vms-provision

This entry will provide an example on how to provision, using Ansible, Hyperledger Fabric native binaries on multiple Softlayer vms. A build your second network example.
Python
4
star
97

aries-sdk-mendix

Aries SDK for Mendix low-code platform
SCSS
4
star
98

milk-donor

Donor Milk Transparency and Traceability
JavaScript
3
star
99

pdo-contracts

C++
3
star
100

business-partner-agent-chart

Smarty
2
star