Semantic Drift Derivative Protocol on GenLayer.
MNEME lets people trade on how the meaning of a concept drifts over time. Instead of referencing a price feed or a deterministic oracle, it asks a committee of AI validators to read a concept's source and reach consensus on how far its interpretation has moved. That consensus value, the Semantic Drift Index (SDI), is what derivatives settle against. The whole thing runs on GenLayer's Bradbury testnet, where non-deterministic LLM evaluation is itself the consensus mechanism.
- An anchor pins a concept (a definition, a domain, and a reference URL) on-chain.
- Each epoch, validators independently fetch the source, run a sanitized prompt, and score the concept's Semantic Drift Index (0 to 100%). They agree through GenLayer's equivalence principle (numerical tolerance plus semantic checks), not byte equality.
- A Semantic Drift Swap (SDS) is a bilateral contract on an anchor: a buyer pays premium, a seller underwrites and locks collateral, and the swap pays out if the anchor's SDI crosses the buyer's strike.
- Every evaluation appends a node to the anchor's Semantic Memory Tree (SMT), so the full history of how a meaning moved is auditable on-chain.
- Register anchor. Pin a concept plus a reference URL. The contract seeds an SMT root and records you as creator.
- Evaluate epoch. Five validators fetch the URL, run sanitized LLM prompts, and reach equivalence-principle consensus on the SDI. The result is written as a new SMT node.
- Open and underwrite. A buyer opens a swap with a strike SDI; a seller underwrites it, locking collateral. Premium accrues each epoch.
- Settle. When the SDI crosses the strike, the swap auto-triggers. Anyone can call settle to compute the payout (linear, quadratic, or binary).
Semantic drift is a judgment, not a fact you can look up. There is no external oracle for "has the meaning of stablecoin shifted," because producing that judgment is the work itself. GenLayer makes the LLM evaluation the consensus, with equivalence defined by semantic tolerance rather than exact match, so the contract can store, replay, and build on accumulated semantic state across epochs. That is not expressible on a deterministic VM.
Live state read from the deployed contract. An SDI of 0% means no drift has been recorded yet (the concept has not been evaluated, or the validators found no meaningful shift this round).
| Anchor | Concept | Domain | SDI | Evals |
|---|---|---|---|---|
| anchor:1 | stablecoin | DeFi | 6.00% | 2 |
| anchor:2 | NFT | Web3 | 0.00% | 0 |
| anchor:3 | artificial intelligence | AI | 2.00% | 1 |
| anchor:4 | equivalence principle | GenLayer | 5.00% | 2 |
| anchor:5 | intelligent contract | GenLayer | 0.00% | 1 |
Intelligent contract (contracts/Mneme.py)
- Python GenLayer contract running in the GenVM.
- Non-deterministic evaluation via
gl.nondet.web.render(fetch the source) andgl.nondet.exec_prompt(score the drift), wrapped ingl.vm.run_nondet_unsafe(leader_fn, validator_fn)so validators apply numeric tolerance and semantic boundary checks instead of byte equality. - Storage in native GenLayer types only (
TreeMap,DynArray); the SMT is an append-only tree of evaluation nodes. u256everywhere for cross-chain interop: basis points (0 to 10,000) for SDI/strike/drift, atto-units (value times 10^18) for money.- Greybox prompt sanitization before every LLM call, and prefixed error classes (
[EXPECTED],[EXTERNAL],[TRANSIENT],[LLM_ERROR]) so validators converge on failure paths.
Network
- GenLayer Bradbury testnet.
Frontend (frontend/)
- Next.js 16 (App Router) and React 19, TypeScript.
- Tailwind CSS v4 for styling, with an OKLCH token system.
genlayer-jsfor all contract reads and writes (built onviem), every value is fetched live from chain with no mock state.- Wallet layer: Privy (
@privy-io/react-auth) embedded wallets plus MetaMask, pinned to the Bradbury chain. - TanStack Query for client state, Radix UI primitives,
sonnertoasts,lucide-reacticons.
Contracts tooling
- GenLayer CLI for deployment.
gltest(Python) for end-to-end contract tests intests/.
contracts/ GenLayer intelligent contracts (Mneme.py)
config/ Network configuration
deploy/ Deployment scripts
frontend/ Next.js app (components, lib/contracts client, lib/genlayer wallet)
tests/ gltest end-to-end tests
Prerequisites: Node.js, the GenLayer CLI (npm install -g genlayer), and a GenLayer Studio or testnet endpoint.
- Deploy the contract. Select the network with
genlayer network, thengenlayer deploy(runsdeploy/deployScript.ts). - Configure the frontend. Copy
frontend/.env.exampletofrontend/.envand setNEXT_PUBLIC_CONTRACT_ADDRESSto your deployed address plus the Bradbury RPC values. - Run the frontend.
Open the local URL printed by the dev server.
cd frontend npm install npm run dev - Run contract tests. With a GenLayer Studio running, execute
gltestfrom the repo root.
- Source: github.com/YoneCode/MneMe
- Updates: @YoneCode
- GenLayer docs: docs.genlayer.com
See LICENSE.