# index.mdx
import Image from 'next/image'
import { Card, Cards } from 'nextra-theme-docs'
import CustomCard from '../components/card'
# Welcome to GenLayer
## The Intelligence Layer of the Internet.
GenLayer is a new class of DLT capable of non deterministic operations through a dynamic consensus mechanism, by leveraging the [Jury Theorem](https://en.wikipedia.org/wiki/Condorcet%27s_jury_theorem) ("wisdom of the crowd") and [Schelling Point](https://en.wikipedia.org/wiki/Focal_point_(game_theory)) mechanics.
In other words, GenLayer is the first Intelligent Blockchain. Enabling smart contracts to natively access the Internet and go beyond deterministic logic, to make subjective decisions.
- **Bitcoin is Trustless Money,**
- **Ethereum is Trustless Applications,**
- **GenLayer is Trustless Decision-Making.**
GenLayer's Intelligent Contracts can connect to the Internet, process natural language, and handle non-deterministic operations such as making subjective decisions, enabling a whole new generation of smart contract logic that is not possible under the limitations of current blockchain infrastructure.
See some of the usecases [here](/understand-genlayer-protocol/typical-use-cases).
Protocols and applications that can **understand, learn, and adapt to real-world events.**
## Get Started
Inspired by **[Condorcet's Jury Theorem](https://jury-theorem.genlayer.com/)** (click the link to check out our interactive model), Optimistic Democracy merges probabilistic AI systems with deterministic blockchain rules, ensuring secure and accurate consensus at scale.
1. **User Submits a Transaction**
A user sends a transaction request to the network (see the diagram's Step 1).
2. **Leader (Validator) Proposes Result**
The network selects a Leader, who processes the request and proposes an outcome (Step 2).
3. **Validators Recompute**
A group of Validators independently re-compute the transaction (Step 3). If the output aligns with the Leader's proposal, they approve; otherwise, they deny.
This multi-layer validation ensures majority agreement, adding a safety net for AI-driven computations.
# Validator Selection Mechanism
Token holders bolster network security by delegating tokens to validator candidates. A deterministic function f(x) then randomly designates Leader-Validator and Validators for each transaction. This process not only promotes fairness but also helps decentralize validation power, strengthening GenLayer's security and trustlessness.
# Validator Operational Framework
Each GenLayer validator node integrates:
- **Validator Software**
Handles core blockchain functions: networking, block production, and transaction management.
- **AI Model Integration**
Connects to Large Language Models (LLMs) or other AI services for complex reasoning, natural language processing, and real-time data retrieval.
Validators seamlessly manage both:
1. **Deterministic Transactions** typical of traditional blockchains.
2. **Non-Deterministic Transactions** that leverage AI-driven logic (e.g., searching the internet, analyzing data, making probabilistic inferences).
By splitting tasks between standard deterministic and advanced AI-powered transactions, GenLayer ensures high performance without compromising on security.
# Putting It All Together
With Optimistic Democracy guiding consensus and validators empowered by AI, GenLayer enables a new class of blockchain applications. From DAOs that self-govern based on real-time data to DeFi protocols that dynamically adjust parameters in response to market changes, developers can now build truly intelligent decentralized solutions.
# understand-genlayer-protocol/what-makes-genlayer-different.mdx
## What Makes GenLayer Different?
1. **AI-Powered**: Intelligent Contracts interpret and execute human-readable commands, unlocking data-driven decision-making in real time.
2. **Web Data Access**: GenLayer’s contracts natively fetch live data, surpassing traditional blockchains that rely on external oracles.
3. **Secure and Reliable**: The Optimistic Democracy consensus algorithm expertly validates non-deterministic outputs, ensuring both efficiency and robust security.
4. **Interoperability**: Designed for seamless interaction with other blockchains and conventional web services, GenLayer bridges multiple ecosystems.
5. **Python-Based SDK**: A Python-centric toolset lowers the barrier to entry, empowering a wide range of developers, data scientists, and AI specialists.
# understand-genlayer-protocol/optimistic-democracy-how-genlayer-works.mdx
# Optimistic Democracy: How GenLayer Works
Optimistic Democracy is GenLayer's consensus mechanism, rooted in [Condorcet's Jury Theorem](https://jury-theorem.genlayer.com/) (click the link to check out our interactive model), which affirms that collective decision-making becomes more accurate as independent validators vote. The process unfolds in distinct phases:
1. **Transaction Submission**: A user sends a transaction to the GenLayer network.
2. **Leader Proposes Result**: A validator is randomly chosen as the Leader validator. It processes the transaction and proposes a result.
3. **Validators Recompute**: A committee of validators re-compute the transaction. They either approve or deny based on whether the output aligns with the Leader's result (i.e. is equivalent).
4. **Result Accepted**: Once a majority approves, the result is provisionally accepted.
5. **Appeal**: If any participant disputes the outcome, they can appeal within the Finality Window by posting a bond.
6. **Additional Validation (If Appealed)**: A new set of validators may be chosen to re-evaluate the transaction. If the appeal is valid, they reward the appellant. Otherwise, the bond is forfeited.
7. **Final Decision**: After all appeals are resolved, the outcome becomes final.
# understand-genlayer-protocol/typical-use-cases.mdx
# Typical Use Cases
- **Prediction Markets**: Power decentralized trading on future events. Applications include financial market forecasting, sports betting, and entertainment predictions.
- **Performance-Based Contracting**: Automate escrows and payments contingent on verified performance metrics. Intelligent Contracts can track deliverables in real-time and instantly release funds.
- **Network States**: Launch decentralized governance frameworks for Network States, opening new horizons in collaborative decision-making and self-regulation.
- **Dispute Resolution**: It will serve as a decentralized, AI-driven arbitration system. Compared to conventional legal routes, it will reduce costs and expedite case handling.
- **AI-Driven DAOs**: Form next-gen decentralized autonomous organizations managed by AI algorithms. Empower real-time governance and data-informed investments.
For more potential applications, see **Build with GenLayer**.
## Ready to Build on GenLayer?
Whether you're looking to dive into Python-based smart contracts or explore AI-driven solutions, GenLayer provides the ideal foundation. Explore our [Developer Docs](https://docs.genlayer.com/developers) to start building.
# understand-genlayer-protocol/why-we-are-building-genlayer.mdx
# Why We Are Building GenLayer
Traditional smart contracts face critical limitations: they can’t natively interact with the outside world without oracles, and their instructions are constrained to code-based logic. By integrating AI at the protocol level, GenLayer’s Intelligent Contracts can:
1. **Process Natural Language**: Interpret and act upon human-readable text prompts.
2. **Access Real-Time Web Data**: Seamlessly fetch and utilize external data.
This synergy opens a world of new applications that merge on-chain trust with off-chain intelligence. Our vision is a dynamic protocol where intelligent entities—ranging from AI models to automated tools—can autonomously transact and reach real-world alignment.
GenLayer's Optimistic Democracy consensus underpins secure, efficient validation even when outputs are inherently non-deterministic. This makes the platform exceptionally adaptable and robust—primed for modern, AI-driven use cases.
# understand-genlayer-protocol/who-is-genlayer-for.mdx
# Who Is GenLayer For?
- **Existing dApps**: Transition away from costly human-based oracles to AI-powered Intelligent Contracts, slashing operational overhead and decision latency.
- **Builders**: Construct the impossible—dApps that benefit from AI-based reasoning, real-time web access, and automated decision-making.
- **Enterprises**: Streamline complex business logic and workflows with AI-driven automation that executes and enforces contractual agreements on-chain.
- **Researchers**: Experiment with next-generation decentralized governance and explore how AI can improve consensus, dispute resolution, and more.
- **Everyone**: Participate in the groundbreaking fusion of AI and blockchain, shaping the future of Web3 technology.
# understand-genlayer-protocol/what-are-intelligent-contracts.mdx
## What Are Intelligent Contracts?
Intelligent Contracts are AI-powered smart contracts designed to leverage Large Language Models (LLMs) for real-time web data retrieval and natural language processing. Unlike traditional smart contracts—limited by deterministic code and external oracles—Intelligent Contracts adapt their logic based on live data and evolving conditions. By natively integrating AI at the protocol level, Intelligent Contracts on GenLayer can understand and respond to complex, real-world scenarios, unlocking a new class of decentralized applications.
| **Feature** | **Traditional Smart Contracts** | **Intelligent Contracts** |
|---------------------------|--------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| **Definition** | Self-executing blockchain programs with terms defined in code | AI-driven contracts that access web data and process natural language in real time |
| **Capabilities** | Executes predefined on-chain actions based on code logic | Executes on-chain actions, can interpret external data, perform AI-driven reasoning, etc. |
| **Language Understanding**| Limited to code-based commands | Understands and acts on human-readable text prompts (natural language) |
| **Web Data Access** | Depends on external oracles for off-chain data | Integrates directly with real-time web data, removing the need for external oracles |
| **Data Handling** | Can only process data already on-chain | Fetches and utilizes off-chain data (APIs, market info, web resources, etc.) |
| **Programming Language** | Often uses specialized blockchain languages (e.g. Solidity) | Generally Python-based in GenLayer, making development more accessible to a broader audience |
| **Ease of Development** | Requires specialized blockchain knowledge and tooling | Accessible via familiar languages (Python) and the GenLayer Studio developer experience |
| **Flexibility** | Executes static operations based on predefined logic | Can adapt in real time to changing conditions, offering AI-driven functionality |
| **Consensus Mechanism** | Relies on standard blockchain consensus (e.g., Proof of Stake, Proof of Work) | Utilizes Optimistic Democracy for deterministic and non-deterministic contract outputs |
| **Use Cases** | Typically restricted to basic on-chain logic like token transfers or deterministic dApps | Enables advanced apps like AI-driven DAOs, predictive analytics, autonomous oracles, etc. |
By embedding AI-driven capabilities into the core of the blockchain, Intelligent Contracts deliver real-time adaptability, broader functionality, and deeper integration with the external world—significantly expanding the scope of what decentralized applications can achieve on GenLayer.
# understand-genlayer-protocol/core-concepts.mdx
import { Card, Cards } from 'nextra-theme-docs'
# Core Concepts
Dive into GenLayer’s fundamental building blocks. These core concepts elucidate how Intelligent Contracts remain secure, efficient, and reliable in a non-deterministic environment: