Dissecting Smart Contract Platform Ecosystem

CoinHatcher
CoinHatcher
Published in
13 min readFeb 23, 2019

Smart contract platform is one of the most well-funded segments in the blockchain world. Different platforms are based on different approaches, but all share one single goal: to reach consensus in a fast and secure way.

Having too many platforms to choose from might be discouraging. So we take a stab at outlining trade-offs each platform makes. We hope that by the end of this piece, you will be able to choose which one suits your use case best.

Note that we’ll focus only on “live” ones and will consistently add more as new platforms are launched on mainnet.

Warning: this is a meaty piece (no, really). If you are short on time, do read-only bold texts. If you want details, give it some time to digest.

Problems with distributed computing systems

A consensus algorithm is a process that a network comes into an agreement which set of records is legitimate, and, thus, should be accepted by the network. This is really hard to achieve in distributed computing systems until Satoshi Nakamoto made it possible with the advent of Bitcoin. Why? Let’s revisit Rome for an answer.

Distributed computing systems have what it’s called the Byzantine Generals’ Problem which occurs anytime we try to determine the TRUE outcome of a vote. Imagine 9 Generals for the Byzantine empire have encircled the city of Rome with their armies. In order to successfully take Rome, the generals must attack or strategically retreat in unison. If any general acts opposite to the consensus decision, the armies will be routed and defeated. The decision to attack or retreat is put to a daily vote and whichever option receives >50% of the vote is what the generals agree to do. Since each General is commanding their army in separate geographic locations around the city they utilize couriers to carry their vote to the other generals.

This system has a few inherent flaws:

  • Any number of the Byzantine Generals could be bribed by the Romans to betray the Byzantine army, these would be Traitorous Generals.
  • Any general could make an inappropriate decision as to whether they should attack or retreat, these are Improperly Functioning Generals.
  • The couriers carrying the votes of the generals could be bribed by the Romans to alter the votes in a traitorous way.
  • The couriers could fail to deliver their message or deliver the wrong message.

This scenario is an analogy for the problem faced by distributed computing systems: How do we reach consensus when faced with untrustworthy or malfunctioning actors that threaten to destabilize the system?

The framework

When thinking about how to resolve such a problem, we need to look at how distributed computing systems achieve consensus among multiple network members. One of the framework to assess how different consensus algorithms work is the Scalability Trilemma (coined by Vitalik Buterin) which states that distributed systems can only achieve 2 out of the following 3 pillars:

  • Security: The ability of the blockchain to stay immutable and withstand network attacks, such as the Byzantine problem or a 51% attack.
  • Decentralization: The level of censorship-resistance and the number of participants that can produce blocks.
  • Scalability: The number of transactions at any given time that the network can process.

We bucket smart contract platforms into two broad categories based on their consensus algorithms: a proof-based consensus, a voting-based consensus, and a hybrid model. A proof-based consensus requires nodes that join the network as a verifier to “prove” that they are more qualified than other nodes to do the work, such as creating a new block. A voting-based consensus requires nodes to exchange their verification results before making a final decision. Finally, a hybrid model combines some features of the two.

1. Proof-based consensus

We’ll focus on proof-of-work (PoW) and proof-of-stake (PoS). We will leave out platforms that are merely variants to PoW and PoS, for example, NEM’s Proof of Importance which is just PoS that assigns different weight to nodes.

1.1 Proof-of-Work (PoW)

Platforms: Bitcoin, Ethereum

PoW assumes that those who invest a lot of economic resources into mining equipments will not risk their investment to attack the network.

PoW requires nodes to solve a puzzle with adjusted difficulty to get the right to append a new block to the blockchain. At the start, nodes will aggregate verified transactions into a block. Then, nodes will guess a secret value, “the nonce”, combine it with the information on the block, add a Hash function, and compare the result of the Hash function with to a difficulty threshold.

If the result is below the threshold, the nonce is accepted and the node will broadcast the block to the network. If the nonce if rejected, the node will make another guess and use a Hash function over and over again until it finds the correct value. Because the threshold is dynamic (depending on the combined computing power of the entire network), the block is timed to be created every 10 minutes.

The effort of guessing the nonce is why this consensus algorithm is called “PoW” and the act of finding the right nonce is called “mining”.

Trade-offs

Since it is possible that two miners could find a block at the same time, a fork (blockchain split) can happen. This could lead a malicious actor to “double spend” by creating a fork and try to reverse a transaction that has been verified by other nodes. This is also called a 51% attack and is possible only if the hashing power is highly centralized, such as those created by mining pools. So it’s important to note that not all platforms that use PoW will be safe from this risk, such as Ethereum Classic (ETC) which recently had a 51% attack.

Another problem is that PoW does not scale. Bitcoin is timed to have a new block every 10 minutes. Although Ethereum tries to solve this and allows a new block to be created every 15 seconds, PoW is still not suitable for use cases that need high throughput.

While PoW can be decentralized and secured (so long as the hashing power is decentralized), it cannot scale.

1.2 Proof-of-Stake (PoS)

Platforms: Ethereum, Qtum, Wanchain, Cardano

PoS assumes that those who invest into the ecosystem will not risk their economic interests.

Just like how you would not destroy the value of the US dollar if you hold a large amount of it. We’ll look at Ethereum in detail as it is the most active platform to date.

Ethereum plans to transition into a pure stake-based consensus, dubbed Casper, in which anyone can place a bet (stake tokens) to earn the right to propose and validate a new block. The validator is chosen randomly at a specific time interval to create a block. If the block gets appended, the validators will get a reward proportionate to their stake.

However, if a validator acts in a malicious manner and tries to reverse a transaction (“nothing at stake” problem), they will immediately be reprimanded and all of their stakes are going to get slashed. Additionally, validators’ stake also gets slashed when they are offline to ensure that nodes are aware of their downtime, hence preserving network security.

Trade-offs

In PoS, a 51% attack is very difficult as an attacker would need to own at least 51% of the stake which is not economically sensible. What could make PoS less attractive is that it’s difficult to prevent mining pools from delegating stakes to a single miner as a pool operator (a concentration of tokens in a small number of addresses).

PoS is generally secure and more scalable than PoW, but it can be less decentralized if tokens can be delegated to others.

2. Voting-based consensus

Platforms: Stellar, Ontology, NEO, ICON

A voting-based consensus mechanism typically takes a form of BFT. Nodes have to jointly verify the transaction, communicate with each other, and decide to append a new block to the chain. BFT requires that at least ⅔ of nodes or a set of nodes have to agree to reach consensus.

2.1 Stellar

Stellar creates an open membership network under Federated Byzantine Agreement (FBA). Under FBA, there is no central list of validators. Rather, each validator chooses who they want to trust to create a quorum slice. Each quorum slices overlaps to create a quorum, or network-wide consensus, on a transaction. Without a central authority who creates the list, FBA thus allows for an open membership network.

2.2 Ontology

Ontology uses Verifiable Byzantine Fault Tolerance (VBFT) to achieve consensus. It’s a combination of PoS, Verifiable Number Function(VRF) and BFT (excuse the buzzwords). Through VRF, three sets of nodes are selected to go through a consensus process: consensus candidate nodes, block verification nodes, and confirmation nodes. Then consensus is completed by candidate nodes independently propose a block; verification nodes collect blocks from the network, verify them, and vote on the highest priority candidate blocks; confirmation nodes verify the verification nodes’ voting result and determine the final consensus results.

Trade-offs

We’re not convinced that Ontology’s randomness in choosing consensus-participating nodes will result in more security. To us, this is trading security in favor of scalability, while decentralization seems to be the same as BFT.

2.3 NEO

NEO adopts Byzantine Fault Tolerant Delegation (dBFT). Traditionally, BFT requires ⅔ of nodes in the network to reach consensus. dBFT only require ⅔ consensus from a set of nodes. There are two types of NEO nodes: one is a bookkeeping node (responsible for the consensus communication with other bookkeeping nodes to generate new blocks), and another is an “ordinary node” (does not participate in the consensus, but can verify and accept new blocks). About 7 bookkeeping nodes are selected through voting to perform consensus and generate new blocks, and then the new blocks are released to the whole network to reach a consensus across the network.

Trade-offs

To sum up, consensus mechanisms under BFT require at least 2/3 of ALL validators participating in the consensus to agree with a block before it can proceed. That means as number of validator grows, the overhead for node communication increases substantially. Since dBFT limits the number of nodes to 7, it is way more efficient, but also more centralized.

3. Hybrid models

Platforms: EOS, Tron, Tezos, Aeternity

Delegated PoS (dPoS)

In contrast to PoS in which tokenholders vote for the validity of the block, DPoS tokenholders vote for a block producer (BP) without giving up control of their property. A group of BPs that receive the largest number of votes will be able to collectively organize the generation of blocks. Let’s say 10 individuals, each owning just 1% of tokens, will have the same amount of influence as one individual owning 10% of tokens.

BP compete only at the stage of selecting a group of producers so DPoS works much faster than most consensus algorithms. And, this is why EOS and Tron can process high throughput and are extremely scalable.

3.1 EOS

EOS tokenholders stake some EOS tokens to continuously vote for top 21 Block Producers (BPs) who act as validators. Once the block is signed by at least 15 out of 21 BPs (⅔) it will be considered irreversible. It is impossible for the same producer to sign two blocks with the same timestamp or the same block height. Typical dPoS blockchains have 100% BP participation and a transaction is considered confirmed with 99.9% certainty after an average of 0.25 seconds from the time of broadcast.

3.2 Tron

Tron’s consensus mechanism, TPoS, is merely a variant of DPoS. Tron tokenholders stake their tokens (referred to as “freeze”) at a 1:1 ratio to accumulate “TRON Power” which can be unfrozen (and convert back to Tron tokens) three days after. TRON Power is used to vote for 27 Super Representatives who act as validators. Every 6 hours a new cycle of voting data is collected and representatives not doing their job can lose Super Representative status.

Super Representative nodes, dubbed super-nodes, are publicly elected and their work is verified by every other node in the network to ensure they do not act maliciously. SR nodes are responsible for packaging transactions into blocks and submitting those blocks into the blockchain (1 node creates and 26 others validate). The technical requirements for a super-node are extremely high (64 CPU cores, 1TB RAM, 1TB+ hard drive, and a 10Gbps minimum backplane), ensuring that super-nodes are capable of handling all transactions, but also means that the network will be centralized.

Trade-offs

DPOS is highly centralized and vulnerable to rent-seeking cartels and votes bribery. Not too long ago, we all heard EOS scandal that Huobi, one of the largest and oldest exchange, accepted money for its support of certain entities in the charge of ensuring EOS network’s “distributed” decision-making. Vitalik has been a vocal opponent of dPoS and argues,

“Because the delegate rewards in EOS are now so high (5% annual inflation, about $400m per year), the competition on who gets to run nodes has essentially become yet another frontier of US-China geopolitical economic warfare.”

Consensus algorithms might not be the only thing that is broken on EOS, but its governance protocol might as well. EOS’ 21 BPs are like a communist party which can even lock up accounts they believe to be operating maliciously (lock someone in jail) or have a law that is never ratified (EOS has a constitution that forbids buying votes, but it’s never been ratified).

3.3 Tezos (dPoS and BFT)

Like a regular DPoS model, dPoS-BFT is divided into two stages: selecting BPs and achieving consensus. Stage one, tokens can be “delegated” to another party since not everyone holding tokens is interested in being a baker. bakers cannot spend the delegated tokens. However, if and when one of these tokens is randomly selected to bake a block, that right will belong to the baker. Stage two, each block is produced (“baked”) by a random stakeholder and notarized (“endorsed”) by 32 other random stakeholders.

A baker becomes aware of its right to bake blocks a few weeks in advance. When it does so, it is expected to create a safety deposit that will be held for a few weeks. This safety deposit is referred to as a “bond”. In contrast to other PoS where the deposit is a single static set amount staked by a BP, Tezos’ deposit dynamically changes depending on the number of blocks a baker is set to create.

After a set of validators (called “bakers” in Tezos) is created, bakers will take turns to verify the transactions and produce a new block. Every baker also participates in endorsing and vice versa. If the baker cheats and attempts to propagate blocks on different branches, it will lose its deposit. If a baker creates blocks on a losing branch, it merely forfeits its reward. If the baker successfully creates and propagates a valid block, it gets a block reward and transaction fees.

Endorsing is a lot like baking, but instead of creating an entire block, a few bakers are randomly called upon to endorse a block, which means to witness that they saw a block and checked that it was valid. Endorsers also put up safety deposits and receive rewards.

Trade-offs

Much like dPoS, Tezos favors scalability and security at the expense of decentralization. Though Tezos is more decentralized than EOS and Tron, both in terms of consensus algorithm and governance. First, it allows up to 80,000 validators, and it doesn’t involve elections. Second, it is self-amending, meaning stakeholders can vote on amendments to the Tezos protocol and even changes to the voting procedure itself.

Summary

The key thing that dictates how each smart contract platform will perform depends on its consensus algorithms. Consensus requires that “something” must agree in order for the consensus to proceed.

  • If “something” is the number of tokens one owns, it becomes a PoS.
  • If “something” is the number of tokens a set of nodes own, it becomes dPoS.
  • If “something” is a combination of weird things, you get to coin a new fancy Proof-of-X!

But, it really does not mean much. The only thing that you should remember is that proof-based model does not require ⅔ of anything to agree on reality, the longest chain is the only reality. This makes it not scalable because it takes a long time to be very confident that what you know is the longest chain (or that finality is reached). For BFT once, >= 2/3 agree, it’s final so it’s very fast and scalable.

Another that you should consider is the community or supporting tools provided by the platform. Platforms are still open-sourced in nature and would thrive only with network effects. Only the ones that people care about will prevail in the long-run.

Today, there are a few platforms that stand out:

  • Ethereum’s decentralized nature makes it a good fit for decentralized finance applications, dubbed “DeFi”, and digital identity because Ethereum enables the verification of data in an open and transparent way.
  • EOS core use case is a decentralized marketplace for exchanges of assets. EOS’s main advantages are parallel processing capabilities, lack of transaction fees (no gas), and decentralized operating system. Still, like most blockchains, the largest user market on EOS is gambling, with over 67% of users making transactions on the platform for gambling.
  • Tron was meant to be a decentralized marketplace for entertainment. Each individual platform does not retain its own subscription service and paywall, resulting in a relatively open market where content providers get paid without deductions from traditional media platforms.

Across these three most popular platforms, Tron is gaining the most traction with the highest daily active users (5.6k) vs EOS (5k) and Ethereum (786). The majority of usage is still around gaming and gambling. Despite being accused of plagiarism during its launch, Tron has proven to beat the odds.

We believe that the true benefits of blockchain lies in decentralization and are hopeful to see a new platform that can achieve both decentralization and scalability. Check out the upcoming ones in the table below!

--

--