Exploring Architectures for Blockchain Scalability

0/ One view in crypto is that a single blockchain (like Bitcoin or Ethereum) will someday emerge victorious and proceed to dominate all use cases. I disagree. It’s more likely that many networks will emerge as winners in their own subdomains of the crypto sphere. A monster thread. 

1/ First, the basics: Cryptonetworks have the potential to evolve into the infrastructure of the next generation internet. Once this revolution has played out, there will exist applications as complex as Facebook that are decentralized and open source.

2/ Such applications will be owned and governed directly by their respective communities, rather than by single companies or institutions. In this new paradigm, developers, investors, and even users will all be stakeholders of the networks that they participate in.

3/ And, because crypto-assets make it possible to directly capture some of the value that is created by open source, this vision is economically sustainable and self-reinforcing in a way that open source alone has never been.

4/ The right cryptoeconomic incentives can encourage anyone in the world to contribute — be it with resources, ideas, code, or product. This, combined with crypto’s open source nature, has the potential to organize human cooperation at an unprecedented scale.

5/ For all of this to work, however, we need a kind of “world computer” that can run a special type of program — a program whose correct execution does not depend on the trustworthiness of any one entity, not even those who control the computers that run it.

6/ Certain blockchains today have the ability to play the role of such a computer. The programs running on top of them (known today as “smart contracts”) are cryptographically and game theoretically guaranteed by the underlying blockchain to execute *as written*.

7/ Ethereum pioneered the first truly global, decentralized world computer by generalizing the ideas behind Bitcoin. Ever since its conception in 2014, it has unquestionably become one of the most important projects in the space.

8/ The smart contracts that run on top of it today have proven to be powerful building blocks. Their trustless verifiability is the core reason why they can credibly disintermediate the organizations that today sit in the middle of many of our interactions.

9/ The growing world of decentralized finance (DeFi), for example, has demonstrated that smart contracts on Ethereum can better encode a lot of the inefficient and error-prone logic that today runs inside of human brains within financial institutions.

10/ As it turns out, highly formulaic contracts about things like fundraising, trading, lending, derivatives, payments, and insurance are often better expressed in code than in legalese (:

11/ And, of course, it makes perfect sense that DeFi has emerged as the first crypto category to get some traction on top of Ethereum. DeFi’s requirements are well matched to Ethereum’s features and limitations.

12/ Having to wait a minute or two to take out a loan from @compoundfinance, for example, might not be ideal, but it’s still orders of magnitude better than having to deal with a bank. Ethereum’s performance limitations don’t really get in the way of that use case.

13/ On the other hand, Ethereum’s strengths (its relative simplicity, uniform security model, and established track record) are the exact set of features that you would want as a developer if you’re building a high stakes financial application.

14/ Other kinds of applications, however, will require different things from a blockchain.

15/ Let’s work through an example of a radically different approach to building a blockchain. But first, remember that none of the following should be taken as investment advice (for more info, see a16z.com/disclosures).

16/ @a16z’s recent investment in @withflow_, a blockchain with an ingenious architecture, is a bet that the tradeoff space that blockchains inhabit is far too large and high dimensional for a single blockchain to span all of it.

17/ The team behind it is @dapper_labs. They have deep experience building crypto-enabled games (this is the team that built @CryptoKitties). The resulting architecture for Flow is optimized for mainstream consumer applications with a focus on games.

18/ So, what exactly is different about it?

19/ The contrarian hypothesis at the heart of Flow’s architecture is that sharding is not the only viable approach to scaling a blockchain.

20/ The term “sharding” in crypto (and all of distributed systems) refers to the subdivision of a system into various smaller subsystems (“shards”) such that the total amount of work to be done can be split across them. Think of it as the divide and conquer approach to scalability.

21/ A sharded architecture for a blockchain implies that each node is responsible for validating only a subset of the transactions validated by the whole network. This is in contrast to the way most blockchains work today, where every node must validate every transaction.

22/ One problem with sharding is that it creates greater complexity for developers. In a sharded world, even simple applications have to deal with the fact that different shards progress independently, so they are not automatically in sync with one another — they are asynchronous.

23/ This makes it harder to write applications that span shard boundaries or that build on top of other applications (perhaps built by other developers) that reside on different shards; it gets in the way of software composability.

24/ All of that complexity might be warranted (or even necessary) for certain applications, but consumer apps like games (that depend on greater responsiveness and are often lower stakes) might be better served by a single shard architecture.

25/ So, is there a region in the tradeoff space that allows for that?

26/ Just about every distributed computer system in history that has reached global scale has had to rely on sharding to some extent. No single router on the internet forwards every data packet. No single Google datacenter stores the entire index for the web.

27/ Nevertheless, while this may suggest that sharding will inevitably be part of the solution someday, we have only begun to explore the extent to which blockchains can scale without it. Flow has made great strides in that direction. How does it work?

28/ For context, blockchain based networks tend to be subject to a tradeoff that is known as the scalability trilemma. It claims that blockchains can optimize for only two of the following three properties.

29/ a/ Decentralization — The number of independent nodes that collectively have control over the network.

30/ b/ Scalability — The network’s throughput (number of instructions processed per second).

31/ c/ Security — The network’s ability to withstand attacks from adversaries with resources that are commensurate with those of the whole network combined.

32/ The @dapper_labs team has conceived of an architecture for a blockchain wherein the separation of labor between nodes is vertical (across the different validation stages for each transaction) rather than horizontal (across different transactions, as with sharding).

33/ In other words, every node still participates in the validation of every transaction, but they do so only at one of the stages of validation. They can therefore specialize for — and greatly increase the efficiency of — their particular stage of focus.
34/ Crucially, this allows each class of node to fall into its own region of the Scalability Trilemma. The system as a whole can thereby get the best of all worlds.
35/ The team’s insight is that it is possible to split a traditional node in a blockchain like Ethereum into four different kinds of nodes, each with its own distinct role.
36/ a/ Consensus Nodes are responsible for consensus in the network — that is, they decide what transactions make it onto the blockchain and in what order.
37/ b/ Execution Nodes perform the computation associated with each transaction once their presence and order on the blockchain has been finalized by the Consensus Nodes.
38/ c/ Verification Nodes are responsible for keeping the Execution Nodes in check.
39/ d/ And finally, Collection Nodes form a peer-to-peer network that offers the network connectivity and data availability.
40/ Consensus and Verification Nodes together are the foundation of security in the Flow network. They leverage cryptoeconomic incentives to hold the rest of the network accountable. Collection and Execution Nodes, on the other hand, allow the network to scale.
41/ The beauty of this separation is that Consensus and Verification Nodes, whose role is the most critical for the integrity of the network, can optimize for the security + decentralization side of the triangle in the trilemma.
42/ Execution and Collection Nodes, conversely, do work that is fully deterministic (making them less vulnerable to attack). Their work is also verified and held accountable by the other node types. They can therefore safely optimize for security + scalability.
43/ In fact, in order for the system to scale, Execution Nodes will likely be professionally managed datacenters — highly performant and well connected to the internet, albeit less decentralized than the other node types.
44/ This clever separation of concerns is what allows Flow to bend the rules of the trilemma and scale beyond other blockchains but without sharding. It’s a great example of a system that, through ingenious architectural choices, lands in a different region of the tradeoff space.
45/ Applications that greatly benefit from the developer ergonomics of a single shard and that depend on high throughput might find a comfortable home on Flow in the same way that DeFi has on Ethereum. To learn more about Flow, check out: withflow.org
46/ The architectural design space in crypto is broader than most people think. The landscape of applications to be built on top is broader still. It’s hard to imagine that one blockchain with its singular set of choices could come close to spanning the entire crypto universe. {fin}