Verification of Hyperledger Fabric based on the concept of MOLD

GAME
GAME
Published in
10 min readJul 4, 2018

MOLD aims to realize decentralized game platform in the next generation by constructing the original blockchain specialized for games. Following the previous article comparing blockchain consensus algorithms, this time we will consider Hyperledger Fabric, which is a representative example of a blockchain with immediate finality, based on the PBFT consensus algorithm.

In addition, MOLD has an ambitious to make these things come true

・Management of individual digital assets in non-centralized mechanism
・Free and quick transactions of digital assets at P2P
・An environment where game developers are more likely to enjoy profits

Based on these points above, we also gain insight into the differences from the features of Hyperledger Fabric.

table of contents
・About the Hyperledger project
・How Hyperledger Fabric’s transaction works
・Simple comparison between MOLD and Hyperledger Fabric
・Membership system and dispersibility
・The definition of asset
・TPS survey of Hyperledger Fabric
・Summary

About the Hyperledger project

In the Hyperledger project, the Linux Foundation, which is a non-profit collaborative entity supporting the spread of LinuxOS, and the IT companies around the world cooperate to establish blockchain technology as a open source project
. Several Hyperledger blockchain projects have already started, including the Hyperledger Fabric that started in December 2015.

Hyperledger Fabric has been developed in order to utilize the special quality of the distributed ledger such as the transparency and the reliability which blockchain technology realizes as a technical basis of social various solutions, especially in response to various use cases in business, and has the following properties.

・Cryptocurrency does not exist
・Strict Permission type
・PBFT system

As Hyperledger Fabric does not assume an unspecified number of network participants like Bitcoin or Ethereum, there is no need to create a mechanism to give incentives like PoW. Therefore, it does not create a common cryptographic currency that will become a reward. Instead, strict certification is required to participate in the network, as it implements membership services that are responsible for registering participants, issuing certificates, and setting authority and being able to trust each other . In Hyperledger Fabric, the PBFT consensus algorithm is adopted for block generation by specific participants.

How Hyperledger Fabric’s transaction works

Transactions often refer to transaction histories of cryptocurrency in many cases. However, in the Hyperledger Fabric, transactions refer to predefined actions that participants can take for assets defined on the network.

In the ledger of Hyperledger Fabric, transaction log (transaction history) and state are recorded.

Data in Tx Log can be newly created or searched, but it can not be tampered with, which can not update or delete previous transactions. On the other hand, in State, it is described in the JSON format of the key-value structure, and it is also possible to update or delete it. In Hyperledger fablic, Txn Log uses simple LevelDB, while State uses CouchDB, which allows more complicated queries to be added. The ledger will be managed by a node group called Peer.

the structure of transaction:http://www.cnblogs.com/studyzy/p/7101136.html

Flow of creating transaction

When a chaincode defining assets, transactions and events, etc is instantiated, it is expanded to the network by Peers in the channel. Also, when chaincode is deployed to the network, Endorsement Policy is also specified such as the setting of peers as endorser, and the valid transaction criteria(for example, the number of peer approvals or logical operators required to be considered valid). Transactions received from client by Fabric API are checked for validity by Endorsement Policy and transactions that are deemed valid are broadcasted to network via Orderer responsible for block generation. After that, when the transfer of the renewed transaction (the state) is recorded in each ledger held by Peer, network participants can refer to the history and state transition of the transaction recorded in the ledger at any time.

the flow of transaction:http://hyperledger-fabric.readthedocs.io/en/release-1.1/arch-deep-dive.html

Simple comparison between MOLD and Hyperledger Fabric

the comparison of MOLD and Hyperledger Fabric

The basic idea of Hyperledger Fabric and MOLD are totally different, but there are some informative points such as consensus algorithm and definition of asset.

Importance of finality

In the case of MOLD which is a decentralized game platform, high level immediate settlement is required for practical use. In other words, it is necessary to form an consensus algorithm that can achieve a promising promptness of finality.

In the Bitcoin protocol, in order to create and connect blocks, 10 minutes is set for the entire node network to listen for, verify, and spread transactions through the peer-to-peer connection. However, probabilistically, to obtain the confirmation that the block does not cover, you need to wait until 6 more blocks will be generated. In the field such as settlement where it is important to obtain the finality, practical application is difficult using Bitcoin PoW protocol.

Ethereum is a protocol that sets a 15 seconds synchronization time. While 15 seconds is much faster than 10 minutes and has the merit of bringing high throughput to the Ethereum network, there is not enough time for the transaction to propagate through the network as a whole. When two or more minor succeed mining at the same time, it will increase the isolated block (called uncle block). Therefore, in Ethereum, similar to the Bitcoin protocol, uncertainty still remains in the finality.

On the other hand, in PBFT, which will be introduced in HyperLedger Fabric in the future, one of the participants will be the primary (leader), send a request to all participants about the order of generation of blocks, and they vote whether they agree to it or not. Unlike PoW and PoS, this system has finality and determined block never reversed as they make a decision after majority vote.

Therefore, in terms of acquiring the finality, PBFT consensus building algorithm is worth to searching.

Membership system and dispersibility

MOLD aims to build decentralized game platform. In doing so, it is essential to create a mechanism that anyone can freely participate in MOLD’s network. In the case of Hyperledger Fabric, the network participants, under the approval of the administrator Peer, need to be issued an x509 certificate and a signing key using a tool called cryptogen. Then they will be able to join the channel which is a unique network for limited people. This is an effective system when narrowing network participants to a specific person, but in the case where it is conceivable that many users use the platform like MOLD, such a strict Permission system won’t work well. Also, strict hierarchical relationships such as administrator Peer and network Peer conflict with MOLD’s idea, which aims to create a decentralized game platform by the community itself.

The definition of asset

Hyperledger Fabric defines asset on Chaincode. By assigning the asset ID, the asset becomes one and only asset, that is, Non-fungible. On the other hand, by specifying the quantity of asset ID, it is possible to generate fungible assets in quantity limitation.

Issuing fungible tokens and non-fungible tokens can be said to be necessary on the MOLD platform to aim for the tokenization of in-game items.

Reference: About item token of MOLD excerpt from whitepaper

There are two types of tokens. Fungible (can be substituted) and NonFungible
(cannot be substituted) tokens. The former, of which can be exemplified
as a potion common throughout the game, supports the ERC-20 token
over the Ethereum. A game item as a Fungible token could each be substituted,
an example being 1 token owned by Molca holding the same value as 1 token
owned by Molna. However, most games include unique items with variables in
value to make such in-game universes more exciting. For such in-game items
with unique Levels, attack powers and skill sets, these status parameters will
each be stored in-game as meta data and be turned into Non-Fungible tokens.
This, corresponding to the ERC-721 token over the Ethereum, becomes an irreplaceable
kind of a token. In this case, if 1 token owned by Molca and 1 token
owned by Molna were to be exchanged, it could not be considered as having
an equivalent value. In either case regarding any item tokens, the user has
ownership as a digital asset over the MOLD, making it possible to simplify the
transaction using MOLDEX, etc (detailed in next chapter). In addition, MOLD
will facilitate SDK (detailed in Chapter 4.4.6) as a system for easily allowing
both tokens to be issued by the game developers.

TPS verification of Hyperledger Fabric

Here we will examine the processing speed on the Hyperledger Fabric with the PBFT consensus algorithm. TPS means transactions per second, and MOLD requires speed above a certain level in utilizing moldcoin as in-game currency.

I will verify the speed of transaction in Currently the latest version of Hyperledger Fabric using Hyperledger Caliper which is a tool that can take benchmark on a Hyperledger project. In this test, TPS can be measured using the result of executing the method called “open” and “query” defined in chaincode.

Operating environment

Hyperledger Fabric v1.1
Network:simple-fabric-network

Measuring method

Measure and record TPS 5 times for each method when 300 transactions are generated and when 500 transactions are generated. Open method is to create account, and query method is to query account information. Then obtain an average. Carry out this process in the following six networks.

2org1peer:2 organizations network and 1 peer in each organization
2org2peer:2 organizations network and 2 peer in each organization 2org3peer:2 organizations network and 3 peer in each organization 3org1peer:3 organizations network and 1 peer in each organization 3org2peer:3 organizations network and 2 peer in each organization 3org3peer:3 organizations network and 3 peer in each organization

Caution

The value of TPS varies greatly depending on the PC to use and the operating environment, so this benchmark is only one indication.

organization:2org-1peer

Number of trials:300

open method
round 1:14tps
round 2:15tps
round 3:17tps

query method
round 1:55tps
round 2:49tps

organization:3org-1peer
Number of traials:500

open method
round 1:13tps
round 2:14tps
round 3:15tps

query method
round 1:44tps
round 2:47tps

Measurement result

The TPS of the two methods in each organization can be summarized as follows.

comparison of TPS

Change in TPS in open method

When TPS on the open method is summarized in graph, as the Peer number increases, decrease of TPS can be observed both 2org and 3org.

Change in TPS in query method

In the query method, we were able to observe a noticeable decrease in TPS at 3org.

Caution

For the sake of convenience, the two organizations are shown together in the table.

Consideration

According to the result, it can be confirmed that the processing accuracy of the transaction in the Hyperledger Fabric is 15 TPS to 50 TPS depending on what kind of transaction is defined on the chain code.

Comparing the TPS of famous blockchains like Bitcoin and Ethereum below, it turns out that the transaction processing speed of Hyperledger Fabric is a little faster.

Bitcoin TPS reference:https://blockchain.info/charts
Ethereum TPS reference:https://etherscan.io/

However, it is known that when the Peer number is increased, the block generation speed becomes slow. As you can see from the table above, when increasing the Peer number in open method transaction experience, the result TPS is almost same level as Ethereum. In theory, since Hyperledger Fabric limits the number of Validators, TPS should be higher than publicchains such as Bitcoin and Etherum in which an unspecified number of participants exist, but in this experiment, the characteristics of the PBFT consensus algorithm is not very much utilized in the result.

Summary

In Hyperledger Fabric’s structure, there are places where MOLD’s original blockchain can be referenced, but in order to realize the world view of MOLD, it is still necessary to make modifications including consensus algorithms and the structure of digital asset. Particularly in Hyperledger Fabric, because it is a strict Permission type, a centralized network will be built and free participation in the network will be difficult. When developing many games and raising fund through game ICO on the MOLD platform, it is important to lower the entry barriers of game developers as much as possible. In addition, by introducing the PBFT system and narrowing down the number of participants, although it is possible to confirm the increase in TPS when compared with Bitcoin and Ethereum, it can not be said that the TPS of the transaction is still sufficient on the MOLD platform that maintains dispersibility and requires immediate settlement property. On the MOLD platform, incentives for Validator are also indispensable for maintaining the network. In the case of Hyperledger Fabric, it can be said that it takes time to approve and transaction processing accuracy drops sharply when the number of peers in the network is increased. In addition, according to the specification of the current Hyperledger Fabric, Oerderer which broadcasts the block to the network is uniquely defined, and it seems kind of a centralized element. Therefore, it will be necessary to improve PBFT, restricting the number of validators, and increasing the speed of transaction processing, in a decentralized way by changing the proposer of block every time.

— — — — — — — — — — — — — — — -
Cosmos Gaming Hub Project(Former MOLD project)
CEO & Co-Founder

Takumi Asano

For all game enthusiasts

--

--

GAME
GAME
Editor for

Cosmos Gaming Hub is a fair and secure distributed gaming platform which supports the development of new games and simplifies the trading of digital assets.