Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
9276eaa
fix: split testnet into Asimov/Bradbury, link to networks page
MuncleUscles Apr 7, 2026
ad79e45
fix: update features index — replace Balances with Value Transfers + …
MuncleUscles Apr 7, 2026
a9b78ad
fix: unique emoji for Special Methods
MuncleUscles Apr 7, 2026
4ea121c
fix: replace verbose Challenges/Mitigations with concise Trade-offs
MuncleUscles Apr 7, 2026
60de0dd
fix: better emoji for Types card
MuncleUscles Apr 7, 2026
98fc78f
fix: rewrite welcome page — align with landing page, fix double title…
MuncleUscles Apr 7, 2026
e995c20
docs: consolidate protocol overview — 7 pages → 4
MuncleUscles Apr 7, 2026
9fe2e1f
docs: rewrite use cases — concrete categories, ERC-8183, rules verifi…
MuncleUscles Apr 7, 2026
a5b647b
fix: address PR feedback — icons, GenVM description, comparison table…
MuncleUscles Apr 7, 2026
b2cc0fe
docs: promote image/visual processing as top-level capability, add in…
MuncleUscles Apr 7, 2026
daa2348
fix: make Feature List clickable in sidebar, add Image Processing page
MuncleUscles Apr 7, 2026
47729ff
fix: clarify version comment explanation in first-contract
MuncleUscles Apr 7, 2026
13f953c
fix: pass raw bytes to images param, not Image(pil=None)
MuncleUscles Apr 7, 2026
da51347
fix: clarify image model callout — network handles it, Studio needs c…
MuncleUscles Apr 7, 2026
31ccdcc
fix: GPT-4o → GPT-5
MuncleUscles Apr 7, 2026
34df446
docs: rewrite FAQ — fix L1→L2, update terminology, add new features, …
MuncleUscles Apr 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 41 additions & 42 deletions pages/FAQ.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,95 +5,94 @@ title: "FAQ"
# FAQ

<details>
<summary>1. What is GenLayer?</summary>
GenLayer is an AI-native Layer 1 blockchain designed to run **Intelligent Contracts**—smart contracts enhanced with Large Language Models (LLMs)—enabling them to process natural language, fetch web data in real time, and execute data-driven logic.
<summary>What is GenLayer?</summary>

GenLayer is a blockchain where validator nodes powered by diverse AI models reach consensus on subjective decisions. It's built as an L2 on zkSync Elastic Chain, anchoring to Ethereum's security. Contracts on GenLayer — called **Intelligent Contracts** — can interpret language, process images, fetch live web data, and make subjective decisions. See [What is GenLayer](/understand-genlayer-protocol/what-is-genlayer).
</details>

<details>
<summary>2. How is GenLayer different from traditional blockchains?</summary>
<summary>How is GenLayer different from other blockchains?</summary>

Most blockchains rely solely on deterministic logic and external oracles to interact with off-chain data. **GenLayer integrates AI at the protocol level**, allowing on-chain contracts to directly interpret text prompts, perform complex computations, and adapt to real-world events without relying on external oracles.
Traditional smart contracts can only execute deterministic logic and rely on external oracles for off-chain data. GenLayer integrates AI at the protocol levelcontracts natively access LLMs, the web, and image processing. No oracles, no intermediaries. See [What is GenLayer](/understand-genlayer-protocol/what-is-genlayer#how-it-compares).
</details>

<details>
<summary>3. What is “Optimistic Democracy” consensus?</summary>
<summary>What language are Intelligent Contracts written in?</summary>

**Optimistic Democracy** is GenLayer’s enhanced Delegated Proof of Stake (dPoS) mechanism. It randomly selects a **Lead-Validator** to process transactions and multiple **Co-Validators** to verify the results. The system is designed to handle non-deterministic (AI-driven) outputs securely by requiring a majority agreement.
**Python.** Intelligent Contracts are Python classes extending `gl.Contract`. No Solidity required. See [Your First Contract](/developers/intelligent-contracts/first-contract).
</details>

<details>
<summary>4. Why does GenLayer use Large Language Models (LLMs)?</summary>
<summary>What is Optimistic Democracy?</summary>

LLMs give Intelligent Contracts the ability to interpret and process complex human language, as well as to analyze data in ways traditional code-based smart contracts cannot. This opens up new use cases, such as AI-driven DAOs, predictive analytics, and autonomous oracles.
GenLayer's consensus mechanism. A leader validator executes the transaction and proposes a result. Other validators independently verify it and vote. If a majority agrees, the transaction is accepted. Anyone can appeal within a finality window, triggering re-evaluation by a larger validator set. See [How GenLayer Works](/understand-genlayer-protocol/optimistic-democracy-how-genlayer-works).
</details>

<details>
<summary>5. Can I still run normal, deterministic transactions on GenLayer?</summary>
<summary>How do validators handle non-deterministic AI results?</summary>

Absolutely. GenLayer supports **standard blockchain transactions** and deterministic logic alongside AI-driven logic. Developers can write regular smart contracts or Intelligent Contracts depending on their needs.
Since LLMs and web data produce varying outputs, GenLayer provides multiple strategies: strict equality (for deterministic operations), LLM-based comparison (validators compare outputs against criteria), and custom validation functions (developers define their own leader/validator logic). See [Non-determinism](/developers/intelligent-contracts/features/non-determinism).
</details>

<details>
<summary>6. Do I have to be an AI expert to build on GenLayer?</summary>
<summary>Can contracts process images?</summary>

Not necessarily. While some knowledge of AI or LLMs can help, GenLayer provides a **Python-based SDK** and user-friendly tools (like the GenLayer Studio) to simplify contract creation. You can harness AI capabilities without deep machine learning expertise.
Yes. Pass images to LLMs via `gl.nondet.exec_prompt(images=[...])`. Contracts can also capture web page screenshots with `gl.nondet.web.render(url, mode='screenshot')` and analyze them. See [Image Processing](/developers/intelligent-contracts/features/image-processing).
</details>

<details>
<summary>7. How do validators handle AI computation?</summary>
<summary>Can contracts send and receive GEN (native token)?</summary>

Each validator runs both **Validator Software** (for networking, block production, and transaction management) **and** an **AI Model Integration** via API. When a contract calls an AI-dependent function, the validator executes that function locally, **then** verifies the output through the consensus process.
Yes. Use `@gl.public.write.payable` to receive value, `gl.message.value` to access the amount sent, and `emit_transfer()` to send value to other contracts or EOAs. See [Value Transfers](/developers/intelligent-contracts/features/value-transfers).
</details>

<details>
<summary>8. What happens if validators disagree on an AI result?</summary>
<summary>Do I need to be an AI expert?</summary>

In **Optimistic Democracy**, disagreements trigger a **majority vote**. If a validator strongly believes the proposed result is incorrect, they can challenge or appeal the outcome within the **Finality Window**. An appeal bond is posted to discourage frivolous or malicious appeals.
No. The GenLayer SDK handles LLM calls and consensus. You write Python and call `gl.nondet.exec_prompt()` with a prompt. Validators handle model execution. GenLayer Studio provides a browser-based IDE for writing, deploying, and testing contracts.
</details>

<details>
<summary>9. How do I get started as a developer?</summary>

<summary>Can I run normal deterministic transactions?</summary>

1. Install the **GenLayer CLI** and set up your local environment.
2. Explore the **GenLayer Studio** to write, deploy, and test your Intelligent Contracts.
3. Check out the **genlayer-project-boilerplate** for end-to-end testing setups and best practices.
4. Use **GenLayerJS** or other tools for front-end integration.
Yes. GenLayer fully supports deterministic logic — standard state updates, value transfers, and contract interactions all work without any AI components. You can mix deterministic and non-deterministic operations in the same contract.
</details>

<details>
<summary>10. Can I use any LLM provider?</summary>
<summary>What are ghost contracts?</summary>

GenLayer is designed to **integrate with multiple LLM providers**, such as GPT, LLaMA, and others. During the `genlayer init` process, you can configure your preferred LLM, including its API keys and model parameters. You can also customize or switch providers as needed.
Every Intelligent Contract has a corresponding ghost contract on the GenLayer Chain (EVM layer) at the same address. Ghost contracts hold the contract's GEN balance, relay transactions to consensus, and execute external messages. See [Ghost Contracts](/developers/intelligent-contracts/features/messages#ghost-contracts).
</details>

<details>
<summary>11. How is the network secured?</summary>
<summary>What can I build?</summary>

Security is driven by a **delegated staking** model plus the **Optimistic Democracy** consensus process:
- Token holders delegate **stake** to validators, incentivizing honest behavior.
- **Multi-Validator Verification** mitigates errors by checking each other’s results.
- **Appeals** provide a failsafe, penalizing dishonest validators via slashing.
Anything requiring subjective judgment: dispute resolution, prediction markets, insurance claims, content verification, compliance automation, AI-governed DAOs, and more. See [Use Cases](/understand-genlayer-protocol/typical-use-cases) and [projects building on GenLayer](https://portal.genlayer.foundation/#/).
</details>

<details>
<summary>12. What are the typical use cases for GenLayer?</summary>
<summary>How do I get started?</summary>

1. Try [GenLayer Studio](https://studio.genlayer.com) in the browser — no setup needed
2. Or install the [GenLayer CLI](/api-references/genlayer-cli) for local development
3. Follow [Your First Contract](/developers/intelligent-contracts/first-contract)
4. Use [genlayer-js](/api-references/genlayer-js) or [genlayer-py](/api-references/genlayer-py) for app integration
</details>

<details>
<summary>How is the network secured?</summary>

- **Prediction Markets**: AI-powered event outcomes
- **Performance-Based Contracting**: Automatic escrow and payments tied to real-time metrics
- **Network States**: Decentralized governance frameworks
- **Dispute Resolution**: Low-cost, AI-driven arbitration
- **AI-Driven DAOs**: Autonomous organizations that react to off-chain data
Through delegated proof of stake and Optimistic Democracy:
- Token holders delegate stake to validators, incentivizing honest behavior
- Multiple validators independently verify each transaction
- Appeals provide a failsafe — dishonest validators get slashed
- The system anchors to Ethereum via zkSync for finality
</details>

<details>
<summary>13. How can I contribute to GenLayer?</summary>
<summary>How can I contribute?</summary>

You can:
- Join the community on **Discord** or **Telegram**
- Contribute code and documentation in GenLayer’s GitHub repositories
- Provide feedback and suggestions to improve the GenLayer ecosystem
- Help grow the community by sharing GenLayer with potential developers and AI enthusiasts
- Join the community on [Discord](https://discord.gg/8Jm4v89VAu) or [Telegram](https://t.me/genlayer)
- Contribute to the [GitHub repositories](https://github.com/genlayerlabs)
- [We're hiring](https://x.com/GenLayer/jobs)
</details>
28 changes: 28 additions & 0 deletions pages/developers/intelligent-contracts/features.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Card, Cards } from 'nextra-theme-docs'

# Intelligent Contract Features

## Deterministic Features
<Cards>
<Card title="🔢 Types" href="types" />
<Card title="💾 Storage" href="features/storage" />
<Card title="⚠️ Error Handling" href="features/error-handling" />
<Card title="🆕 Upgradability" href="features/upgradability" />
<Card title="💸 Value Transfers" href="features/value-transfers" />
<Card title="📨 Messages" href="features/messages" />
<Card title="🧠 Interacting with Intelligent Contracts" href="features/interacting-with-intelligent-contracts" />
<Card title="🔗 Interacting with EVM Contracts" href="features/interacting-with-evm-contracts" />
<Card title="⚡ Special Methods" href="features/special-methods" />
<Card title="➡️ Vector Storage" href="features/vector-storage" />
<Card title="🕵️ Debugging" href="features/debugging" />
<Card title="🎲 Random" href="features/random" />
</Cards>

## Non-Deterministic Features

<Cards>
<Card title="🌀 Non-determinism" href="features/non-determinism" />
<Card title="🤖 Calling LLMs" href="features/calling-llms" />
<Card title="🖼️ Image Processing" href="features/image-processing" />
<Card title="🌏 Web Access" href="features/web-access" />
</Cards>
2 changes: 1 addition & 1 deletion pages/developers/intelligent-contracts/features/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"features": "Features",
"storage": "Storage",
"error-handling": "Error Handling",
"upgradability": "Upgradability",
Expand All @@ -13,5 +12,6 @@
"random": "Random",
"non-determinism": "Non-determinism",
"calling-llms": "Calling LLMs",
"image-processing": "Image Processing",
"web-access": "Web Access"
}
11 changes: 6 additions & 5 deletions pages/developers/intelligent-contracts/features/features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import { Card, Cards } from 'nextra-theme-docs'

## Deterministic Features
<Cards>
<Card title="😵‍💫 Types" href="../types" />
<Card title="🔢 Types" href="../types" />
<Card title="💾 Storage" href="storage" />
<Card title="🐛 Error Handling" href="error-handling" />
<Card title="⚠️ Error Handling" href="error-handling" />
<Card title="🆕 Upgradability" href="upgradability" />
<Card title="🪙 Balances" href="balances" />
<Card title="💸 Value Transfers" href="value-transfers" />
<Card title="📨 Messages" href="messages" />
<Card title="🧠 Interacting with Intelligent Contracts" href="interacting-with-intelligent-contracts" />
<Card title="🐒 Interacting with EVM Contracts" href="interacting-with-evm-contracts" />
<Card title="🔗 Interacting with EVM Contracts" href="interacting-with-evm-contracts" />
<Card title="⚡ Special Methods" href="special-methods" />
<Card title="➡️ Vector Storage" href="vector-storage" />
<Card title="🕵️ Debugging" href="debugging" />
<Card title="🕵️ Special Methods" href="special-methods" />
<Card title="🎲 Random" href="random" />
</Cards>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { Callout } from "nextra-theme-docs";

# Image Processing

Intelligent Contracts can process images through LLMs — pass screenshots, photos, or any visual data alongside a prompt for analysis.

## Sending Images to LLMs

Use the `images` parameter in `gl.nondet.exec_prompt()`:

```python
from genlayer import *

class ReceiptVerifier(gl.Contract):
verified: bool

def __init__(self):
self.verified = False

@gl.public.write
def verify_receipt(self, image_data: bytes, expected_amount: str) -> None:
def leader_fn():
return gl.nondet.exec_prompt(
f"Does this receipt show a payment of {expected_amount}? "
"Respond as JSON: {{\"matches\": true/false, \"actual_amount\": \"...\"}}",
images=[image_data], # accepts raw bytes directly
response_format="json",
)

def validator_fn(leaders_res) -> bool:
if not isinstance(leaders_res, gl.vm.Return):
return False
my_result = leader_fn()
return my_result["matches"] == leaders_res.calldata["matches"]

result = gl.vm.run_nondet_unsafe(leader_fn, validator_fn)
self.verified = result["matches"]
```

The `images` parameter accepts a sequence of raw `bytes` (e.g., PNG/JPEG data) or `gl.nondet.Image` objects.

## Capturing Screenshots from the Web

Combine [web access](/developers/intelligent-contracts/features/web-access) with image processing to screenshot a webpage and analyze it:

```python
def check_website_status():
url = "https://example.com/status-page"
screenshot = gl.nondet.web.render(url, mode='screenshot')

return gl.nondet.exec_prompt(
"Is this status page showing all systems operational? "
"Respond as JSON: {{\"all_operational\": true/false}}",
images=[screenshot],
response_format="json",
)

result = gl.eq_principle.strict_eq(check_website_status)
```

## Use Cases

- **Visual evidence verification** — insurance claims with photo proof, damage assessment
- **Document analysis** — receipts, invoices, certificates
- **Web monitoring** — screenshot a page and verify its content matches expectations
- **Brand & content compliance** — check if visual content meets guidelines
- **UI verification** — screenshot an app and verify it renders correctly

<Callout type="info">
Image processing requires vision-capable LLM models. On the GenLayer network, validators handle model selection — your contract just sends images. In Studio running locally, ensure your configured validators use a model that supports image inputs (e.g., GPT-5, Claude Sonnet).
</Callout>
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ graph TD
|---|---|
| Studio (Localnet) | Built-in faucet — 💧 button in the account selector |
| Studionet | Built-in faucet — 💧 button in the account selector |
| Testnet | [testnet-faucet.genlayer.foundation](https://testnet-faucet.genlayer.foundation/) |
| Testnet Asimov | [testnet-faucet.genlayer.foundation](https://testnet-faucet.genlayer.foundation/) |
| Testnet Bradbury | [testnet-faucet.genlayer.foundation](https://testnet-faucet.genlayer.foundation/) |

See [Networks](/developers/networks) for full details on each environment.

## Calling Payable Methods from JavaScript

Expand Down
2 changes: 1 addition & 1 deletion pages/developers/intelligent-contracts/first-contract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ First of all, you need to place a magic comment with the version of GenVM you wi
```py
# { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" }
```
It is similar to Solidity's `pragma solidity`, and `test` after a colon is a version. When GenLayer releases, it will be changed to some exact hash of a version, which will be frozen forever.
It is similar to Solidity's `pragma solidity`. The hash after the colon identifies the exact version of the Python runtime to use, ensuring your contract always runs against the same environment.

### Importing the Standard Library
After the version comment, you can import the GenLayer standard library:
Expand Down
32 changes: 5 additions & 27 deletions pages/developers/intelligent-contracts/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,32 +74,10 @@ Development of Intelligent Contracts leverages Python's robust ecosystem, provid

The platform supports the data structures needed to handle complex business logic and requirements.

## Challenges and Mitigations
## Trade-offs

### Non-Deterministic Operations
**Challenge**

The primary challenge in handling non-deterministic operations is maintaining consistency across multiple validators when operations may naturally produce varying results. This is particularly evident when dealing with LLM outputs or real-time data processing.

**Mitigation**

To address this, GenLayer provides the Equivalence Principle as a flexible framework for developers to decide how the validators will try to reach consensus. This system allows for both strict output matching and more nuanced validation approaches where validators can assess results within acceptable parameters, ensuring reliable contract execution even with non-deterministic elements.

### External Data Reliability
**Challenge**

Integrating external data sources introduces potential points of failure and data inconsistency risks that must be carefully managed. External APIs may experience downtime, return inconsistent results, or become deprecated over time.

**Mitigation**

To combat these challenges, Intelligent Contracts employ a robust multi-validator verification system where multiple independent validators must confirm external data integrity.

### Performance Considerations

**Challenge**

The integration of LLM operations and complex data processing can introduce significant computational overhead, potentially impacting contract execution speed and cost efficiency.

**Mitigation**
Intelligent Contracts introduce non-determinism and external dependencies that traditional smart contracts avoid. Key considerations:

To tackle these performance challenges, GenLayer implements optimized validation processes that balance thoroughness with efficiency. The platform provides configurable consensus mechanisms that allow developers to fine-tune the validation process based on their specific needs, whether prioritizing speed or verification thoroughness.
- **Non-deterministic outputs** — LLM responses and web data vary across validators. The [Equivalence Principle](/developers/intelligent-contracts/features/non-determinism) lets you define how validators compare results to reach consensus.
- **External data reliability** — Web sources can be inconsistent or unavailable. Multiple validators independently fetch and cross-validate data as part of [Optimistic Democracy](/understand-genlayer-protocol/optimistic-democracy-how-genlayer-works).
- **Compute cost** — LLM calls and web requests add latency and cost compared to purely deterministic contracts. Design contracts to minimize non-deterministic calls where possible.
Loading
Loading