Verifiable AI for NEAR smart contracts

The model lives inside the chain.

Chainmind runs a language model inside NEAR smart contracts. Every validator computes the same answer, so contracts can use AI without trusting an oracle, an API or special hardware.

Running in your browser stories260K · int8 · seed 1

Once upon a time, there was a little boy named Tim. Tim loved to discover new friends. One day, he went to the park to play at it.

Live on NEAR testnet · mind-mwdofvuu.leston.testnet Sealed · sha256 663eb9fb…3227cb48 NEAR Hackathon 2026

Why it exists

Today, a smart contract that wants an AI's opinion has to trust someone. An oracle. An API company. A secure server. Chainmind removes the someone.

Nobody can fake itThe answer is computed in consensus, as final as a token transfer.
Nobody can change itSealed weights, pinned forever by their SHA-256 hash.
Anyone can check itThe same prompt and seed give the same words on any machine.
How it works

One transaction. Five steps. Every validator.

The contract is ordinary WebAssembly. When you call generate, each validator runs all of this, and they all land on the same words.

Real total from testnet: 194.4 Tgas for a 48-token story. The split between steps is approximate.

  1. 01 · ≈16 Tgas

    Load the weights

    The contract reads the sealed model from its own storage: int8 matrices, the tokenizer and position tables.

  2. 02

    Read your prompt

    Your words are split into pieces from a 512-piece vocabulary, exactly how the model was trained.

  3. 03 · ≈3.6 Tgas per token

    Run the transformer

    Five layers, eight attention heads, 64 numbers wide. Integer matrix maths keeps it cheap and exact.

  4. 04

    Pick each next word

    The next token is drawn from the model's odds using the block's random seed, or yours if you pass one.

  5. 05 · 194.4 Tgas total

    Return and record

    The text comes back with the transaction and stays in the chain's history. If gas gets low, it stops early and returns what it has.

    Measured on NEAR testnet
Determinism

Three machines.
One story.

AI usually gives slightly different answers on different hardware. Chainmind uses integer matrix products, its own exponent function and a fully specified random generator. Prompt "The cat", seed 7, 32 tokens:

NEAR VMnearcore runtime
mainnet gas rules
Waiting
Laptopx86-64
native build
Waiting
Your browser72 KB wasm
computed live
Waiting
32 of 32 tokens identical.The third column is computed by your browser.
260,032parameters on chain
299 KBmodel, sealed forever
70tokens per transaction
3.6Tgas per token
0.02NEAR for a 48-token story
3machines, identical output
Stories are the first model

What you can build when AI can't be rigged

Chainmind is a building block. Other contracts call it like a shared library, and anyone can audit the answer.

Fair game AI

Characters, dungeons and loot generated by a sealed model and a public seed. Players can prove the game isn't rigged.

Track 09 · Games

NFTs with provable origin

Mint an NFT whose text was written by the chain itself, with the model hash and block stored inside as proof.

Track 10 · NFTs

Risk scoring in DeFi

A lending contract asks a sealed risk model before approving a loan, and anyone can see why it said no.

Track 01 · DeFi

Agent safety checks

A small classifier screens an AI agent's payment before the contract releases funds.

Track 06 · Security

Contests and disputes

A fixed public model judges entries, with no hidden human or company in the loop.

Tracks 11 · 12

Many of these need a small classifier or scorer rather than a storyteller, and those are far cheaper than writing text: one prediction instead of 70 tokens. A sealed model also can't be quietly retrained or deleted, which makes the chain a permanent home for AI artifacts.

Live demo

Run the sealed model yourself

This is the exact model stored on chain, running in your browser with the same engine the contract uses. Same prompt, temperature and seed: same words as the validators.

The little robot Loading the model…
Live on testnet · mind-mwdofvuu.leston.testnet

Use it in one line

From a free question to calling it from your own contract. The commands use NEAR's command-line tool, near-cli-rs.

Terminal


        
Limits, measured

Built for small models where trust matters more than size

This will never run a chatbot like ChatGPT. It's for scoring, classifying, deciding and generating game content, and many useful models are that small.

Per call300 Tgas

About 70 tokens from this 260,032-parameter model.

Bigger modelsLinear

Work per token grows with size. 10× bigger fits only a few tokens per call.

Storage10 NEAR/MB

Staked at about 1 NEAR per 100 KB while the model lives on chain.

SpeedSeconds

The answer comes back with the transaction.

1 token
19.9 Tgas
8 tokens
43.4 Tgas
32 tokens
130.1 Tgas
64 tokens
260.6 Tgas
256 asked
69 · 282.7

Measured in nearcore's own VM, protocol 88, mainnet gas rules. Asked for 256 tokens, it wrote 69 and stopped itself before the 300 Tgas line.

Today · live

Small models inside one call

A 260K-parameter model sealed on testnet, writing up to 70 tokens per transaction with the same output everywhere.

Next · in design

One model across shards

Put each layer in its own contract and chain the calls. NEAR is sharded, so the layers can share the work.

Research

Checking big models on chain

Run a large model off chain and post its answer with a deposit. In a dispute, the contract recomputes only the layer in question, which needs maths that matches bit for bit.

For scale: SmolLM2-135M, one of the smallest models Ollama runs, is about 520 times this model. By our estimate it would lock around 1,350 NEAR of storage and need about ten chained calls per token. That's why big models are better checked on chain than run there.

The Endless Story

Ask the chain for the next chapter.

Chapter 0 · leston.testnetOnce upon a time, there was a little boy named Timmy. Timmy loved to run and play with his toys. One day, Timmy's mom made some journey and cle…

Chapter 1Waiting for you.