Can AI Help Bridge the Blockchain Trilemma?

Introducing AI-Enhanced Smart Contracts

Jason Feng
Thornapple River Capital
10 min readApr 5, 2023

--

Unsplash

About the Author: Jason is an Investment Fellow at Thornapple. He brings both operating and investing experience through his tenure at several tech companies as a data scientist and across a variety of venture capital firms as an investor. Prior to this, he was an MBA VC Associate at Sweater Ventures, where he invested in early-stage consumer-facing startups. Jason earned his MBA/Ai from the Kellogg School of Business and McCormick School of Engineering at Northwestern University. Personally, Jason is a big fan of basketball, and his NBA team is the Denver Nuggets.

Introduction

In my last post, I highlighted how Big Tech will monetize on the AI gold rush through centralization. That being said, there are applications in which artificial intelligence can also be used to advance decentralization. A significant use case of this is in the world of cryptocurrencies.

Once heralded as the “future of finance,” a replacement for the US dollar, and a potential world reserve currency, crypto and blockchain were seen as the technologies that would democratize money. Blockchain, or the public ledger, is used for the recording and tracking of transactions in a network; its distributed ledger technology allows for immutable records of transactions creating greater transparency, trust, truth, security, and efficiency. But with recent volatility in crypto assets and high-profile protocol failures, this future has been called into question.

In this post, I will cover how artificial intelligence can address those doubts as well as help bridge the blockchain trilemma (or at least partially). I will discuss the convergence of these two cutting-edge digital technologies specifically by examining smart contracts. Founders and investors should be aware of the scale that AI-enhanced smart contracts could bring to blockchain applications.

The Blockchain Trilemma

As a recent graduate of business school, I am all too familiar with the juggling act of sleep, social life, and success. Often, one of these things has to be sacrificed for the others resulting in the meme that students can’t have it all and have to choose 2 out of 3 in the triangle of school life. Another example of this is the Project Management Triangle that quality is driven by time, cost, and scope. In both these cases, the solution is prioritization. The Blockchain Trilemma, however, is not so easily addressed.

Vitalik Buterin, co-founder of Ethereum, coined the term the Blockchain Trilemma to showcase the properties that blockchains try to have of scalability, decentralization, and security. In this trilemma, traditional blockchains can only achieve 2 out of 3. Buterin states that traditional blockchains achieve decentralization and security but that they are not scalable because every participant needs to verify every transaction. Therefore, he also refers to the Blockchain Trilemma as the scalability trilemma.

The Blockchain Trilemma
  • Decentralization: Blockchain’s Distributed Ledger allows for it to store and share data globally because control is distributed across all participants in the network. As the blockchain grows, however, the complexity and depth of hashing increases making transactions more computationally intensive (for proof of work; though an argument can be made that proof of stake is a bit less truly decentralized given large holders).
  • Security: To reach consensus, a majority of a distributed network’s nodes have to agree. The fewer nodes, the easier it is for hackers or bad actors to take control of 51% of the network granting hackers the ability to verify fraudulent transactions. This is referred to as a 51% attack. Other common attacks include phishing (attaining credentials), routing (interception of data), and Sybil attacks (flooding the network with false identities). However, blockchain is generally considered near-tamperproof because of the consensus protocol (new blocks must have verification of hash matching its block) and linking of hashes in the chain (each block has to include the previous block’s hash).
  • Scalability: As complexity and adoption increase, cryptocurrencies’ ability to handle that increased workload comes into question in terms of costs and speed. For blockchain to be more widely used, the technology must be able to handle a high volume of transactions. For example, Visa does 24,000 transactions per second while current popular blockchain protocols can only handle a tiny fraction of that.

To address scalability, blockchains have been turning to Layer 1 or Layer 2 solutions. The image below by 101 Blockchains showcases the differences between Layers 1 and 2. Base protocol blockchains include Bitcoin and Ethereum, for example. So, an example of a Layer 1 scale solution would be Ethereum’s change to the Proof-of-Stake (PoS) consensus protocol.

On the other hand, Layer 2 solutions are built on top of base blockchains but interact outside of the native chain. Examples of Layer 2 scaling solutions include nested blockchains, sidechains, and state channels. Layer 2 solutions generally involve the base network and smart contracts to resolve disputes and achieve consensus on the underlying chain.

Smart contracts, however, are not just Layer 2 solutions as they can also exist on Layer 1 such as on Ethereum. Smart contracts form the base of decentralized applications (DApps), which power the broad usability and diversity of protocols like Ethereum. Thus, this article will focus on how smart contracts can help address the scalability issue. More specifically, I will discuss how AI-enhanced smart contracts can be used to solve the Blockchain Trilemma.

What is a Smart Contract?

Before that, let me briefly explain what a smart contract is. Just like any type of contract, a smart contract also establishes the terms of an agreement. In this case, however, a smart contract is carried out as code running on blockchain. In essence, they are computer programs that execute when predetermined conditions are met. Smart contract code generally follows “if/when…then…” statements. You can think of the mechanics of a smart contract like that of a vending machine: select a product, the vending machine specifies the cost, you insert that amount, the machine verifies the payment, and finally, the machine gives out the product.

The most popular platform for smart contracts is currently Ethereum. Here’s how a smart contract work would work on Ethereum:

1. Smart contracts are written, constructed, and stored on the Ethereum blockchain.

2. Each node stores all existing smart contracts.

3. The smart contract code is executed by all nodes for verification to reach consensus when funds are received from a user.

4. The user pays a gas fee to execute the smart contract.

5. The user receives the digital assets.

Since smart contracts do not require brokers or intermediaries, they result in greater autonomy and cost savings. Additionally, smart contracts store all information, duplicate it on the blockchain, are encrypted, automate tasks allowing for efficiency and speed, and reduce manual errors. Lastly, as mentioned in the previous section, smart contracts are powerful because they allow for the creation of dApps. There are, however, limitations to smart contracts such as those mentioned by Emmanuel Awosika: reliance on external data sources (developers rely on oracles — applications that pull data and put it on-chain for smart contracts), rigidity (immutable), confidentiality of information (private contractual information can easily become public), legal status (no actual legal protections), security flaws (bugs, attacks, loopholes), and simplistic operation (cannot address ambiguous terms).

How AI can help Bridge the Blockchain Trilemma

So, we know that blockchain has a scalability issue and that smart contracts are powerful in DeFi (decentralized finance) and other blockchain applications, but where does AI come into play?

Well, first off, the AI and smart contracts market will be a massive opportunity. In fact, it is estimated to be worth $415B by 2029 with a compound annual growth rate of 53.4%. Secondly, to address some of the limitations of smart contracts and blockchain’s scalability issue, I believe that AI can be introduced to, and can enhance, smart contracts by making them easier to create and scale, guaranteeing security and safety, and preventing fraud and anomalies.

Creation and Scalability of Smart Contracts

By utilizing AI, smart contracts will be easier for anyone to create and thus achieve greater scale. As shown below, people are already using AI to write smart contracts in minutes. Eventually, no longer will developers with specific programming language knowledge such as Solidity, Rust, Vyper, Yul, or JavaScript be needed to create smart contracts. Granted, DApps with good UIs can also do this for the specific purposes of those DApps, but AI can more generally enable smart contract creation, especially with more customization. The same goes for lawyers or intermediaries as smart contract users could rely more on automation. Additionally, smart contracts will have less of a need to question the accuracy of oracles and instead utilize AI to query and verify real-world data from various angles. The impact of AI smart contracts will be new users, increased utilization, and lowered costs as more contracts and transactions move to blockchain.

Guarantee of Safety

According to Adrian Hofmann, the “main concerns for [smart contracts] are that it is hard to guarantee the security of smart contracts and the lack of powerful tools that support the development and testing of the smart contracts.” Given the immutability of smart contracts, once they are deployed, they can be exploited if there are errors in the source code. AI can reduce the chances of those user errors by generating code, debugging code, and performing code audits. Startups such as AnChain.AI are ensuring security by auditing smart contracts through its Contract Auditing Sandbox product.

AnChain.AI

Fraud and Anomaly Detection

Although blockchain is seen as more secure than traditional banking or financial systems, there are still malicious actors that exploit smart contracts or attack blockchains amounting to over $20B in crypto crimes in 2022. Given the anonymity of blockchain, criminals partake in money laundering, crypto fraud, financial theft, scams, ransomware, terrorism financing, and human trafficking. AI, however, is exceptionally good at pattern recognition and so it can be used to prevent fraudulent activity by detecting unusual transactions in smart contracts. Therefore, AI can be used to identify suspicious transactions quickly, continue to monitor risks, and improve identity verification. Chainalysis does all of that by “powering compliance, regulatory, and investigative software to detect and prevent illicit activities on the blockchain.”

Chainalysis’s Reactor product: investigation software to examine criminal activity as well as legitimate activity

Key Takeaways for Founders and Investors

While many have speculated about the end of the crypto hype cycle and have turned to AI as the new frontier, I believe that AI can reinvigorate crypto enthusiasm. By combining these technologies, AI can enhance the capabilities of blockchain.

But to realize this AI + blockchain future, we should start with the merging of smart contracts and AI to act as the steppingstone for that evolution. These enhanced contracts will be safer, more efficient, and cheaper while also allowing for more powerful Layer 2 solutions and dApps to be built on top. Eventually, AI can be introduced to all component parts of blockchain.

Founders

So, if you’re a founder thinking of an AI and blockchain startup, I’d advise against Layer 1 scalability solutions for the following reasons:

1. It’ll be difficult to displace chains like Ethereum, especially after the 2.0 fork and through sheer inertia.

2. Although AI might help reach scalability, in the interim of building out the chain, your Layer 1 chain would be more susceptible to attacks.

3. Lastly, building out a Layer 1 solution could be much more intensive (in terms of creating a new base chain with the necessary computational power, consensus protocols, and speed) than layering on top of existing solutions.

Therefore, I recommend focusing on smart contracts or Layer 2 solutions with AI-enhanced smart contracts. For example, some startup concepts that would work towards this future could include an AI-powered smart contract code generator, a smart contract code auditor, ready-to-use AI oracles, or on-chain AI platforms.

Investors

On the venture side, I’d again advise against Layer 1 solutions and recommend Layer 2 smart contracts and dApps focused on addressing scalability. Once we can make progress on the “scalability” edge of the Blockchain Trilemma, I think we will be much closer to that future of democratized finance in which we’d see mass adoption of blockchain.

But for now, keep an eye out for the regulatory environment for smart contracts. It’ll be important to see how the legal landscape shakes out for something that is not currently enforceable. This could massively hinder or quicken the pace at which we achieve an AI + blockchain future.

In the meantime, if you’re building a company like this or investing in them, reach out to us at Thornapple River Capital. We’d love to chat.

--

--

Jason Feng
Thornapple River Capital

Thornapple River Capital Investment Fellow | Kellogg/McCormick MBA and AI Graduate