What's the best blockchain platform?

Blockchain is a new word for innovation. When bitcoin was created nobody thought that it would just be the beginning. I’m not talking here about the numerous ICOs that come and go but about entire blockchain platforms that have emerged over time. They provide services that fill the gap within the existing ecosystem. So, which one is the best blockchain platform?

Blockchain — what do we need it for?

Before we dive into the best blockchain platform topic, let’s review the basics. Blockchain is basically a ledger, but one that is distributed. Based on advanced cryptography concepts, blockchain assures that the state of a ledger is persistent and trustworthy at all times. Every participatory node of blockchain has a copy. It doesn’t require a third party authority to tell what in a ledger is true or false.

That’s why we need blockchain. Because thanks to it we can, as a society, get rid of mechanisms that could be replaced by an algorithm. It allows to get rid of manipulations, avoid not fulfilling agreement statements and intrigues which are often a burden to humankind.

Why scalability matters

Let’s put it simply. Scalability is all about network’s growth and how many transactions can the network handle at a given time. blockchains are great, but why, for example, won’t Amazon introduce bitcoin payments?

The answer is simple. Amazon has around 600 transactions per second in its peek, bitcoin handles 7 transactions per second, Ethereum handles around 20 transactions per second. So, there is a big gap here. Visa handles about 2000 transactions per second. It might be said it isn’t a fair comparison when you include all the factors, its life and the numbers is what we all care about. Scalability of blockchain largely depends on the consensus mechanism.

What is a consensus mechanism?

A consensus mechanism is necessary for blockchain network to agree on what needs to be written in blockchain. Some aspects of consensus mechanism in the blockchain world are:

Proof of Work

  • each block in blockchain is verified by peers who are solving a mathematical problem. The mathematical problem is complicated, useless and not solvable by any other means than by blunt force. So, we need large computation power and this process is called mining. A chain with the highest number of workers is the most trustworthy one. Proof of work is used both by bitcoin and Ethereum. Proof of work has a good reputation as a slow consensus algorithm.

Proof-of-Stake (PoS)

  • it’s more efficient than the previous one. Soon, Ethereum will adopt it. Blocks aren’t created by miners but minters betting their tokens to the valid blocks. A block with the highest number of token votes wins.

Delegated Proof-of-Stake (DPoS)

  • token holders vote on their representatives that will be responsible for validating the blocks. EOS is implementing this consensus algorithm

Byzantine Fault Tolerance (BFT)

  • is known to work fast.
    • Practical Byzantine Fault Tolerance (PBFT) used in Hyperledger (pluggable). It’s fast but it can only be used in private, permissioned networks
    • Federated Byzantine Agreement (FBA). This one is used by Stellar and Ripple.

Raft

  • this algorithm is based on choosing a leader who is followed by followers. The leader determines validity. Raft is a very fast mechanism.

Comparison of blockchain platforms

Ethereum

Ethereum is one of the most popular blockchains. It’s a public network in which every user can participate freely. Many entrepreneurs choose it as the best blockchain platform for their ICOs. All transactions in Ethereum are public and can be seen by others. As I have mentioned before, it uses Proof of work consensus algorithm which imposes scalability on issues that it deals with. Ethereum network is so popular thanks to the smart contracts that are used in executing custom logic on its blockchain. Smart contracts are written in Solidity. Deployment and each execution of a smart contract written to the blockchain will cost you gas, which in turn exchanged into ether. Ether is the cryptocurrency of the Ethereum blockchain.

R3 Corda

R3 Corda is a semi-private permissioned blockchain which primary targets solving financial cases. Each network has a doorman service that has a set of KYC rules that must be provided to join the network. If a peer is accepted, a certificate is granted that will help identification inside the network. By default, information about transactions is only shared with those who participate in the transaction.

There is no single central store of data. Instead, each node maintains a separate database. As a result, each peer only sees a subset of facts on the ledger, and no peer is aware of all the facts in a ledger. In Corda, transactions to be accepted must achieve two types of consensus: validity and uniqueness. The so called Notaries take care of it – they can be either centralized nodes or distributed using a pluggable consensus algorithm like RAFT or BFT or any other. Smart contracts in Corda implement any JVM language, however, Kotlin and Java are most promoted. The contracts can attach a Legal prose document which can be relied upon in the case of legal disputes in the real world.

Smart contracts in Corda consist of three elements:

  • State objects – stores the data that are checked by the contract. Represent state of a ledger. Exist in output and input.
  • Commands – additional data for transaction they are parametrizing the contract. Passed as input to contract.
  • Verify function – validation function as it validates the transaction. If the transaction is returned then it’s successful if exception occurs we have failure

Contracts only validate the transactions in a pure and stateless way, they verify functions they don’t connect with the outside world. Transaction contains all input and output states. Contracts are packaged to CorrDapp (Corda distributed application) with other objects. Other objects that CorDapp can consists are Services (Oracles and Notaries) and Flows. Flows are contained in the so called FlowLogic class and are used for handling business flow scenarios.

Oracle services provide the data from the outside world to the ledger. The already mentioned Notaries run consensus algorithm and prevent the same transaction from being run twice. Notaries can also validate a transaction if they wish to. CorrDapps are packaged to a jar and deployed on node basis.

Quorum

Quorum is a permissioned network designed to process financial transactions. It’s sometimes discussed as the best blockchain platform for enterprises. Actually, it’s advertised as an enterprise-focused version of Ethereum. It also tries to stay as close as possible to the existing Ethereum codebase.

Smart contracts are written in Solidity and can be either private or public (visible to all peers in the network). The same is true for transactions – we can have public ones that are processed as normal Ethereum transactions and we can have private ones. Private Smart contracts/transactions are created by using a private parameter on the message which contains public keys of participants. This will allow you to see transactions or execute smart contracts.

Quorum and smart contracts

When designing smart contracts with Quorum, you can use the same tools similar to the one while developing contracts in Ethereum. Concerning the public-private division, you must think in advance because you can’t change to private contract once you make it public. Additionally, you must know that while designing a private contract you can’t modify public contracts because not all nodes will have the possibility to execute the private transaction. They will end up in a different state for that public contract.

Quorum nodes will connect only with other Quorum nodes which you can specify by using Network/Peer permissions management. Higher performance is available thanks to using RAFT or Istanbul BFT Consensus algorithms. Additionally, the pricing of gas has been removed, although Gas itself remains. Quorum itself is build from Quorum node (a modified geth client) and Constellation which additionally consist of Transaction manager and Enclave they work together to ensure submitting information in a secure way providing transaction privacy.

Hyperledger Fabric

Hyperledger Fabric is a private permissioned blockchain deployed within or across organizations. Every member in the blockchain is certified. To receive access the user must be authorized first. Hyperledger Fabric supports private transactions by creating multiple ledgers called channels. By default, a network will run without any consensus algorithm which supports pluggable consensus algorithm. But, you can plug in Practical Byzantine Fault Tolerance or even a custom-made one if you wish to.

Smart contracts (called Chaincode) in HyperLedger fabric are written using Golang or Node.js. Chaincode is running in the Docker container – so it’s isolated from any other processes. If you want the chaincode on two channels, then you must deploy it twice. In some cases, Hyperledger might be the best blockchain platform for in-company business use. I also wrote about this here: Hyperledger vs Ethereum.

Stellar

Stellar is a public blockchain, focused on managing assets. There is no possibility for private transactions on Stellar. Therefore, it’s not the best blockchain platform if that’s what you’re looking for. It has its own cryptocurrency called Lumen which is a native asset of all other assets that are created by users. Assets are exchanged in the network by providing a trustline between issuer of an asset (called anchor) and buyer. In addition, to support the issuing and movement of assets, the Stellar network also acts as a decentralized distributed exchange.

Stellar uses its own consensus mechanism called Stellar consensus protocol. Smart contracts are made by invoking API methods on Stellar Horizon servers or using sdk (it translates to the same API calls). Stellar smart contracts aren’t complete and they operate around asset ownership. However, for some contracts this is exactly what you need. Also, it’ll be around 10000 times cheaper than the Ethereum solution.

Ripple (XRP)

XRP is similar to bitcoin but it magnifies faster than bitcoin can scale to provide similar number transactions per second to Visa. Each transaction lasts about 4 seconds and is deterministic. What’s more, each transaction in XRP is validated by validators and everybody can become a validator. It’s also saved in the blockchain ledger. XRP has its own consensus mechanism. Ripple has a decentralized exchange and arbitrary assets. Ripple has been criticized for not being truly decentralized, or for using only a few core validation nodes.

Best blockchain platform?

Private or public

Public Blockchains are exposed to the world and everybody can read and access them. They have also proven that their security mechanisms work. With private networks, we are sure that the information is revealed only to sensitive parties. Private networks aren’t fully tested, at least not as the public one, so some security gaps may appear in future. Private networks tend to be faster as their consensus algorithm works in a rather friendly environment with a limited number of users.

Smart Contracts.

Ethereum, R3 Corda, Quorum, Hyperledger Fabric each have a mechanism for implementing Turing-complete Smart contracts. Corda contracts are set of stateless functions and only verify the transactions. In Stellar, we can only have simple contracts they are not Turing-complete. Ripple has no notion of smart contracts.

Choosing the best blockchain platform:

Ethereum R3 Corda Quorum Hyperledger Fabric Stellar Ripple
Private / public network public private private private public public
Consensus protocol POW (in future PoS) Pluggable
( RAFT or BFT or custom )
Pluggable (Raft or Instanbul BFT ) Pluggable (No-op or Practical Byzantine Fault Tolerance or custom ) Stellar consensus protocol (variation of FBA) Ripple Protocol Consensus (variation of FBA)
Smart contracts supported yes yes yes yes Not directly (by defining transactions, Escrow accounts etc) no
Smart contracts language solidity java/kotlin solidity Golang or node.js REST API/nodejs/java
Cryptocurrency Ether – (can be modeled in chaincode) Lumen XRP
Transaction cost Yes (high) No no no Yes (low) Yes (low)

What do I choose?

So, as you can see there is no single solution to fit all needs. There’s no best blockchain platform for everyone. Ethereum (at least for now) is unique and it would be hard to find a replacement for it. Platforms known as an Ethereum killers (NEO, EOS) aren’t fully flagged products yet. Only time can tell if they ever will be. In case of public assets management, there are two platforms Ripple and Stellar. When it comes to Ripple, it’s more popular for its cryptocurrency transactions but not that many users know that it possesses many Stellar’s features.

When it comes to private/permissioned blockchains, Quorum and S3 Corda were developed to serve in financial specific domains. Quorum is recently stating in its official documentation that it can serve other domains as well (of course if it makes sense). S3 Corda has capability to Legally bound its contracts by attaching legal prose which is unique in the blockchain world. Fabric has a multimodular architecture and any domain can be implemented in Fabric, it also has a nice framework for developing blockchains called Composer. To use a blockchain, you must have a certain need that will boost your business. The final best blockchain platform choice is best left to experts.