Using Layer-2 Technologies to Improve Smart Contract Scalability 

By | February 3, 2023

Blockchain-based smart contracts have the potential to replace traditional contracts with decentralized contract enforcement in a way that does not involve a third-party intermediary. While smart contracts inherit key advantages from the base-layer blockchain infrastructure, such as decentralization, immutability, and transparency, they are also subject to the same trilemma that blockchains face: scalability, security, and decentralization cannot be simultaneously achieved. Specifically, due to the high cost of interacting with the blockchain, the lack of scalability has been seen as a major bottleneck for the wide adoption of smart contracts. There are two reasons why the lack of scalability can be problematic. First, for the wider adoption of smart contracts, the adoption cost cannot be higher than the transaction costs associated with an intermediary that the technology tries to save. Second, the lack of scalability is often empirically correlated with more concentration in the system, which defeats blockchain’s original promise of decentralization. 

Various layer-2 solutions have been proposed to improve scalability, but empirical evidence on how well they work is scarce, if not non-existent. Our recent paper studies prominent scaling solutions, known as off-chain scaling solutions, with a particular emphasis on their implications on market outcomes. This off-chain scaling solution can be considered a layer-2 technology because it takes the interaction on the base-layer blockchain off the blockchain. At a high level, our results show that this scaling solution leads to a dramatic reduction in operating costs and an increase in decentralization in the ecosystem without compromising data integrity. These results show how blockchain and smart contracting technologies can evolve to achieve decentralized, accurate, and scalable trust. 

Institutional Background 

Smart contracts constitute the foundation of multiple Web3 innovations, including decentralized autonomous organizations (DAOs), decentralized finance (DeFi), decentralized applications (DApps), and non-fungible tokens (NFT). A smart contract is a contingent program on a blockchain that automatically executes mutually agreed contracts once prespecified conditions are met. Smart contracts inherit desirable properties of the blockchain infrastructure, including decentralization, immutability, and transparency. As a result, smart contracts bypass traditional trust-enforcing intermediaries and can reduce transaction costs. 

Smart contracts typically depend on external information. For instance, for risk-hedging needs, a DeFi contract needs to be contingent on a future event in the real world, such as the weather in New York City at a given time. Smart contracts get external information through access to data feeds. Chainlink, the empirical setting of this study, is a leading company that provides such data feeds to smart contracts. The data feeds are decentralized in that each service provider on Chainlink votes on what they think the data value should be. The Chainlink protocol will then aggregate the individual votes, for example, by taking the median of them and updating this data feed on the blockchain, which is then ready to be used by requesting smart contracts. 

Layer-2 Technologies as Scaling Solutions 

We focused on a policy change by Chainlink in March 2021. Before the policy change, Chainlink aggregated the individual votes and provided data feeds to smart contracts on the original blockchain. After the policy change, however, Chainlink instead performed data aggregation off-chain via a cryptographically proven peer-to-peer network, though still using an incentive-compatible algorithm.  

Figure 1. Chainlink Data Aggregation Models: On-chain Aggregation (left) and Off-chain Aggregation (right). Source: Chainlink Blog. 

Figure 1 illustrates these two data aggregation models. The left panel shows the on-chain aggregation model, using data feed ETH/USD as an example. For each round, all service providers are expected to submit their answers to the blockchain within a given time frame, and the data aggregation takes place on-chain, which calculates the median of all valid on-chain reports as decentralized consensus. In the on-chain aggregation model, the number of on-chain updates equals the number of service providers. The right panel depicts the off-chain aggregation model exemplified by LINK/USD. Service providers communicate their answers off-chain without any cost from interacting with the blockchain for each round. The protocol then randomly assigns a service provider to transmit all reports on-chain. Off-chain aggregation reduces on-chain updates per round to one (from the total number of service providers), thereby reducing the costs from interaction with the blockchain. 

 For identification, we exploit the transition period during which Chainlink ran two parallel systems for the same data feed: the original system where data aggregation takes place on-chain and the second system where data aggregation happens off-chain. This setting creates an almost ideal opportunity in terms of identification because we observe the same data feed in both the treatment and control groups, which directly addresses the missing data problem in causal inference, as described in Rubin. We performed various robustness tests in the paper and validated our identification strategy’s assumptions. Because both the Ethereum chain and the Binance (BSC) chain, the two major blockchains that Chainlink was serving during the sample period, were in the transition period between May and September 2021, we used this period as our estimation sample. 

One direct effect of this policy change is reduced operating costs. As discussed, almost all operating costs come from service providers’ interaction with the blockchain. In the treatment system with off-chain aggregation, there is only one transmission per round, while in the control system, there are multiple transmissions per round. Consistent with this process, our regression analyses show that the cost-saving from off-chain aggregation is about 76% of the total cost, equivalently $260 million in savings per year. In addition to cost savings, we also show that this cost reduction did not compromise the accuracy of the data feeds; instead, accuracy improved slightly. The reason for this improved data integrity is that Chainlink can financially support more service providers to work in a round of jobs, and the decentralized voting nature of the data feed implies that more votes typically mean a more accurate data feed. We find that the number of service providers per round increases from 9 to 16 on average, and the improvement in data integrity is fully mediated by the number of service providers. 

What are the market-level implications of the improved scalability? We find that the market becomes less concentrated after the policy change in terms of the Herfindahl-Hirschman index (HHI), and in particular, a 50% drop in the HHI. The reduced market concentration is consistent with our regression results on the increased number of service providers in a round due to the better scalability of the treatment system. 

Conclusion 

Our study is one of the first to empirically study the economic implications of blockchain decentralization, security, and scalability because of a layer-2, off-chain scaling solution. We show that partially migrating the consensus formation process off the blockchain leads to a large cost saving without sacrificing service quality. More importantly, we find that decentralization improved due to better scalability and that higher decentralization is correlated with more accurate data feeds. While our empirical setting is Chainlink, our results likely generalize to general blockchain settings or other decentralized networks. We are seeing a burgeoning number of applications involving similar off-chain scaling solutions, including the Bitcoin lightning network and the off-chain voting system (using the snapshot software) in Decentraland. Lastly, we argue that our results align with a classical result in technology diffusion that complementary technologies (in our setting, layer-2 technologies) need to be built to unlock the full potential of a general-purpose technology. Our results provide initial evidence that as blockchain and smart contracting technologies evolve, the original promise of decentralization and its benefit may emerge.  

 

References 

 

Will Cong is the Rudd Family Professor of Management and an Associate Professor of Finance at SC Johnson College of Business, Cornell.  

Xiang Hui is an Assistant Professor at Olin Business School, Washington University at St. Louis. 

Catherine Tucker is the Sloan Distinguished Professor of Management and a Professor of Marketing at the Sloan School of Management, MIT.  

Luofeng Zhou is a Research Associate at Columbia Business School, Columbia University.  

 

This post was adapted from their paper, “Scaling Smart Contracts via Layer-2 Technologies: Some Empirical Evidence,” available on SSRN

Leave a Reply

Your email address will not be published. Required fields are marked *