What is GenLayer? [The Fundamentals-Part I]

GenLayer is an Blockchain that extends the capabilities of traditional blockchains with AI. This innovation is enabled by Smart Contracts that are not only self-executing and self-enforcing but also incorporate the whole knowledge of the Internet. What might sound complicated at first glance is not.

First things first: What’s GenLayer all about?

If you think of blockchains, what comes to your mind are the endless options currently on the market: Starting with Ethereum, the pioneering platform for smart contracts, the landscape extends to fast and efficient networks like Solana, and even to more complex ecosystems such as ICP or NEAR.

All these solutions focus on different niches of the crypto universe in their own way. Solana f.i. has ultra-fast and cheap transactions. Ethereum has multiple Layer 2 solutions, which help scale the underlying Proof of Stake Chain and increase throughput. In some way or another, they try to solve the blockchain trilemma: Decentralization, Scalability and Security. But only some of them have thought of adapting their core innovation driver to the needs of the new AI age: Their smart contracts.

Blockchain Trilemma. Source: pintu.co.id

GenLayer, on the other hand, has adapted to the needs of the new machine age — a blockchain introducing the power of AI. At its core it enables the expansion of smart contract functionalities by connecting them to Large Language Models (LLMs) as we have never seen before. Easy to claim, right? So, let’s dive deeper!

The Logical Evolution of Smart Contracts

Around the year 1990, computer scientist Nick Szabo invented a new technology called smart contracts. Although all crypto enthusiasts nowadays know what a smart contract is, it was merely a concept IT geeks were familiar with at this time.

Szabo himself proposed to compare smart contracts to a vending machine. You put a coin in and via a simple mechanism, it dispenses the product and your change, all while your coins are protected from outside attackers within the machine’s frame. He argued that we could include such a smart contract in anything controlled by digital means.

It took us almost 25 years until Ethereum founder Vitalik Buterin took that concept and added its functionality to a blockchain. It was the perfect synergy of two technologically novel solutions. As the first blockchain, Bitcoin solved the double-spending problem, and smart contracts made it possible to execute transactions when certain conditions were met. The era of smart contract blockchains had begun.

Szabo was a visionary who imagined his smart contracts as pillars for collateral, bonding and the delineation of property rights. Basically, most of the use cases we see in the majority of decentralized applications (dApps) nowadays. You can already take out a loan by deploying collateral in DeFi protocols, such as Aave, MakerDAO, Balancer, and many more. NFTs enabled us to display digital property rights and even reward the creators through royalties for their intellectual property rights.

The AI-powered Blockchain era

New blockchains nowadays try to solve the blockchain trilemma without any new adaptations to the backbone of their usefulness: Smart Contracts.

The major problem is that they can’t communicate with the outside world. Although they specialize in processing data from inside a blockchain, they can process data from the internet. Or draw an analogy to the vending machine: It can’t process data outside of the vending machine.

Ever heard of a smart contract reading and analyzing news? Us neither.

One example of the smart contracts’ “blindness” are oracles. Oracles are external services that provide smart contracts with data from the outside world, enabling these contracts to execute based on real-world events and information. They bridge blockchain networks and external systems, allowing smart contracts to react to off-chain or “internet” data.

Smart Contracts Need Oracles to Communicate With the Outside World. Source: Toptal.com

AI, namely LLMs, are good at processing your instructions, called prompts, and finding information on the internet.

Now if you combine Smart Contracts and LLMs: et voila. That’s GenLayer’s so called “Intelligent Contracts”. The core of our AI-powered Blockchain.

GenLayer’s Intelligent Contracts can do anything a smart contract can, such as executing simple transactions once certain conditions are met. Additionally, they have the same capacities traditional LLMs have: Finding information on the Internet and processing your instructions in plain English. Oracles f.i. become obsolete with GenLayer as it can natively bring information on-chain by connecting to LLMs.

Intelligent Contracts Capabilities

Intelligent Contracts bridge the gap between static blockchain operations and dynamic, real-world data. By integrating LLMs directly into their framework, these contracts autonomously interpret and act upon data from the internet without needing external inputs from oracles. This ability transforms them from transaction executors to active, informed participants in the blockchain. They can adapt to changing conditions or information, making decisions based on real-time data.

Ok, so what? We already have lending, borrowing, liquidity staking and much more. Yes, but what Intelligent Contracts enable is to either a) create a way more efficient protocol or b) create completely new protocols:

  • Want to create an intelligent contract that automatically pays out insurance to users in case of a drought?
  • Determine the lending rate of Aave adapted to the changing interest rate of the world’s leading central banks?
  • Detect a DeFi hack by monitoring news sites and explorers?
  • Identify your identity directly on-chain by checking if the correct message has been linked to your social media account.

Not a problem with Intelligent Contracts.

How Does This Fit Into the Decentralized Web3 Ethos?

Short answer: It’s a perfect fit. The long answer sheds more light on the subject, though:

As the name suggests, a blockchain is a chain of blocks, cryptographically hashed transactions, bundled together in a block and executed through either validators or miners in the network. And that’s what already distinguishes GenLayer from anyone else.

It is a decentralized platform, such as f.i. a blockchain, but rather than processing blocks, Genlayer’s execution environment works with individual transactions. The concepts it borrows from blockchains are: A consensus mechanism, an execution environment and the foundation of smart contracts or, in this case, intelligent contracts.

TLDR: GenLayer is a blockchain in which the validators agree on individual transactions instead of blocks including transactions.

The Engine Powering the Fusion of AI and Blockchain

Every “blockchain” needs an execution environment. Ethereum has developed the world’s most famous decentralized execution environment, EVM. You have surely heard about it here and there, as the main goal of any blockchain, especially in the early years, was to either create an EVM-compatible chain to reap the fruits of Ethereum’s liquidity or to create a new blockchain from scratch.

Think of the execution environment like this:

GenLayer or the EVM can be linked to a universal theater stage, where scripts (smart contracts) are performed by actors (transactions) under the strict guidance of the theater’s rules (consensus mechanism), bringing the story (blockchain applications) to life for the audience (users and developers).

GenVM is the execution environment of GenLayer, which empowers the Intelligent Contracts to work in the above-described way. GenVM also takes care of who owns what, after every transaction or intelligent contract execution, as it keeps track of the state.

State changes in crypto refer to the updates or modifications made to the blockchain when transactions occur, altering the ownership or balance of cryptocurrencies. Essentially, they are the blockchain’s way of tracking who owns what after every transaction or smart contract execution.

A has an account balance of 1 ETH and B of 0 ETH. A sends B 1 ETH. The new state on the blockchain would represent this transaction accordingly, displaying A’s balance as 0 ETH and B’s as 1 ETH.

Powering a new age of decentralized Apps with Optimistic Democracy

A decentralized platform wouldn’t be anything without its consensus mechanism. GenLayer’s is called Optimistic Democracy and enables our LLM validators to agree on a certain transaction or output. As you can imagine, achieving consensus among “casual” validators is hard enough, not to mention LLMs.

In GenLayer’s Optimistic Democracy consensus model, the consensus mechanism’s role diverges from traditional blockchains due to the non-deterministic nature of Intelligent Contract executions, which may vary due to different validators using various LLMs and the influence of external web data.

A non-deterministic question would be: Which blockchain is the best on the world? Certainly you will receive a lot of differing answers for this question. Therefore GenLayer can’t just operate with the classic consensus models currently existing.

Optimistic Democracy differs greatly from what we know from first-mover Ethereum’s EVM. In a nutshell, it works like this: Whenever a transaction is broadcasted to the validators, one of them is chosen as the leader. This LLM validator then proposes its answer to the other LLM validators and if they agree on that outcome, it gets executed on GenLayer. More on that in Part II of “What is GenLayer.”

Conclusion

In this article, you have explored the reason for why GenLayer is building a new blockchain, how it’s leveraging AI with Intelligent Contracts and the consensus mechanism Optimistic Democracy.

Ready to dive deeper into GenLayer and explore how this new consenus mechanism works in depth?

Then follow us to “What is GenLayer [The Fundamentals-Part II]”

Join us on our mission!

Website | Blog | Discord | X (prev. Twitter) | Telegram | Simulator | Docs | Whitepaper