Skip to content
joachimberPublic

About

Meme genetics lab for Four.meme on BSC — Purrfect Claw TEE-signed deploy · Four.meme AI Sprint hackathon

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

memome

Meme genetics lab for Four.meme on BSC. Splice two four.meme tokens, get three genetically-recombined children with survival scores, deploy the one you like through a TEE-signed transaction.

Built for the Four.meme AI Sprint hackathon, Pieverse's Purrfect Claw Web3 Skills bounty.

What it does

memome treats every four.meme token as a carrier of four chromosomes:

  • VIS — visual motifs, sigils, sticker iconography
  • NAR — narrative, bio, lore fragments
  • TIM — peak hour + half-life (how long its volume survives a pump)
  • COM — community, chain-iness, degen score

Pick two tokens. memome extracts their genomes, runs a dominance-weighted crossover, adds bounded mutation, and synthesizes three distinct child tokens — each with its own name, ticker, sigil, lore, hue, and a survival score grounded in the parents' real on-chain metrics (market cap, 24h volume, community overlap).

Hit deploy on the one you like and memome runs the real four.meme auth dance:

  1. POST four.meme /nonce/generate → login challenge
  2. POST purr.pieverse.io /v1/instances/{id}/wallet/sign → challenge is signed inside the TEE (private key never leaves the enclave)
  3. POST four.meme /user/login/dex → session token
  4. (gated) purr fourmeme create-token --execute → token is live on BSC

Bounty fit

Requirement How memome meets it
Web3 skill published to Pieverse Skill Store skills/memome-breeder/SKILL.md — registered via PR to Pieverse-Eng/purrfect-skills vendor-skills-registry
Must use Purrfect Claw's native TEE wallet app/api/deploy/route.ts calls the real POST /v1/instances/{id}/wallet/sign endpoint; private key never leaves the enclave
Live demo on Purrfect Claw trial instance Web UI deployed on Vercel; breeds + auth-signs against the real Purrfect Claw + four.meme endpoints
GitHub repo with documentation This repo. SKILL.md, architecture notes, setup instructions below

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                        memome · Next.js 15 app                       │
│                                                                      │
│  ┌─────────────┐   ┌─────────────┐   ┌─────────────┐   ┌──────────┐ │
│  │   /lab      │ → │   breed     │ → │   reveal    │ → │   tree   │ │
│  │ pick 2 tkns │   │ DNA + flux  │   │ 3 children  │   │ lineage  │ │
│  └─────────────┘   └─────────────┘   └─────────────┘   └──────────┘ │
└─────────────────────────────────────────────────────────────────────┘
       ↓ /api/tokens              ↓ /api/breed              ↓ /api/deploy
       ↓                          ↓ /api/explain            ↓
┌─────────────────────┐    ┌─────────────────────┐    ┌─────────────────────┐
│  DexScreener BSC    │    │  Venice.AI          │    │  four.meme /nonce   │
│  /latest/dex/search │    │  qwen3-235b text    │    │      ↓              │
│  → live pairs       │    │  z-image-turbo      │    │  purr.pieverse.io   │
│                     │    │                     │    │  /wallet/sign (TEE) │
│                     │    │                     │    │      ↓              │
│                     │    │                     │    │  four.meme /login   │
│                     │    │                     │    │  → session token    │
│                     │    │                     │    │      ↓              │
│                     │    │                     │    │  purr fourmeme      │
│                     │    │                     │    │  create-token       │
└─────────────────────┘    └─────────────────────┘    └─────────────────────┘

Key files

File What it does
lib/dna.ts Gene extraction, crossover, mutation, survival scoring, child synthesis
lib/fourmeme.ts Live BSC pair fetcher via DexScreener (search, chain filter, dedupe, 5-min cache)
lib/venice.ts Venice.AI client (qwen3-235b text + z-image-turbo image)
app/api/tokens/route.ts Surfaces 12 live BSC four.meme tokens ranked by 24h volume
app/api/breed/route.ts Runs crossover + mutation, then enriches children with LLM-generated names/lore/taglines
app/api/deploy/route.ts Real four.meme auth dance + TEE wallet signing
app/api/explain/route.ts Plain-English breakdown of a child via qwen3-235b — why this survival score, what's inherited, what's novel, honest risk flags
components/ChildReveal.tsx Per-child card: inheritance map, explain panel, genome inspector with origin badges, deploy timeline
components/PhyloTree.tsx Interactive lineage graph, pan + zoom, localStorage-persisted
skills/memome-breeder/SKILL.md Agent-loadable skill for Purrfect Claw — documents the genetic breeding intent + purr fourmeme create-token handoff

The TEE wallet integration

The whole point of Purrfect Claw is that private keys live inside a Trusted Execution Environment. memome talks to the TEE exclusively through purr.pieverse.io/v1/instances/{id}/wallet/sign:

// app/api/deploy/route.ts
const r = await fetch(`${PURR}/instances/${agentId}/wallet/sign`, {
  method: "POST",
  headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({ message: challengeMsg, chainType: "ethereum" })
});
const j = await r.json();
const signature = j.data.signature;  // 65-byte ECDSA sig, key never left the enclave

This signature is what four.meme's /login/dex endpoint validates to issue a session token. From the client's perspective, the flow looks identical to MetaMask — but there's no wallet extension, no seed phrase, no cold-storage ritual. An autonomous agent can sign login challenges and create tokens on its own.

The skill · memome-breeder

skills/memome-breeder/SKILL.md is the agent-loadable skill definition — same Markdown-with-YAML-frontmatter format as every other entry in Pieverse-Eng/purrfect-skills.

It documents:

  • Intent routing — when to dispatch breeding intents here vs. plain fourmeme create-token
  • Gene extraction model — four chromosomes (VIS / NAR / TIM / COM) with loci, values, dominance, origin tags
  • Crossover math — dominance-weighted interleave of parent loci
  • Mutation bounds — rate clamped to [0.05, 0.40], per-child variation spread
  • Survival formula — 40 + 0.25·avgDegen + 0.1·maxHalfLife + 2·log10(mcapA·mcapB) + noise − 4·max(0, mutatedCount − 2)
  • TEE signing handoff — purr wallet sign for login challenge, purr fourmeme create-token --execute for deploy
  • Failure modes — upstream errors are reported, never auto-retried

An agent loaded with this skill can parse breed $PEPE × $MEMES and produce a deployable four.meme token through the memome pipeline — either by hitting the HTTP endpoints directly or by driving purr from the CLI.

Setup

# 1. clone
git clone https://github.com/joachimber/memome.git
cd memome

# 2. install
npm install        # or pnpm install

# 3. env — fill in the four required keys
cp .env.example .env.local
# VENICE_API_KEY, PURR_API_KEY, PURR_AGENT_ID, NEXT_PUBLIC_PURR_WALLET

# 4. run
npm run dev        # next dev on :3000

Env vars

Variable Required Where to get it
VENICE_API_KEY yes https://venice.ai — API keys page
PURR_API_KEY yes Register an agent via POST purr.pieverse.io/v1/agents/register (see onboarding doc)
PURR_AGENT_ID yes Same registration response
NEXT_PUBLIC_PURR_WALLET yes wallet.address from the registration response
PURR_API_URL optional default https://purr.pieverse.io

Deploy

The app is deployed to Vercel via npx vercel deploy --prod. Env vars carry over as Vercel project secrets. Full deploy flow:

npx vercel link      # link to project
npx vercel env add VENICE_API_KEY production
npx vercel env add PURR_API_KEY production
npx vercel env add PURR_AGENT_ID production
npx vercel env add NEXT_PUBLIC_PURR_WALLET production
npx vercel deploy --prod

Demo flow · 90 seconds

  1. Land on hero — DNA helix spinning, "splice memes / breed them"
  2. Begin splicing → scrolls to parent picker (12 live BSC tokens via DexScreener)
  3. Tap two parents — slots glow cyan + plasma
  4. Initiate crossbreed → 6-step lab sequence animates DNA extraction → alignment → crossover → mutation → flux synthesis
  5. Three children appear with sigils, lore, survival scores
  6. Tap explain on any card → qwen3-235b panel renders: inherited-from-A, inherited-from-B, novel mutations, why-this-name, why-this-survival (with concrete parent numbers), honest risk flags
  7. Tap deploy → four.meme → 3-step timeline fires: real four.meme nonce, TEE wallet sign, four.meme session token
  8. Scroll → phylogenetic tree has the new children; state persists across sessions

Stack

  • Next.js 15 App Router · React 19 · TypeScript strict · Tailwind CSS 3
  • Venice.AI (qwen3-235b-a22b-instruct-2507 for text, z-image-turbo for image)
  • PurrfectClaw TEE wallet · four.meme public API · DexScreener BSC pairs
  • Pure SVG visualization — no chart libraries, no rounded corners, no shadcn

License

MIT. See LICENSE.

About

Meme genetics lab for Four.meme on BSC — Purrfect Claw TEE-signed deploy · Four.meme AI Sprint hackathon

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages