Lunaria
docs

Architecture

How the system fits together: the signal engine, the attestation, the stack.

System architecture

The client posts a signal to a Node route. The route runs a population of parallel model calls on the gpt-5.6 family, settles the result by consensus, hashes the transcript into a merkle root, and commits that root onchain on Robinhood Chain as transaction calldata (lib/commit.ts), returning a Blockscout link. The app sits behind Privy auth and a $luna access gate.

client
browser
post a signal · wallet · /verify
POST /api/signal
signal engine
node route
population
Luna agents
parallel, independent
escalation
Terra / Sol
on disagreement
judge
consensus + sha256 merkle
objective · real root
attest
commit onchain
robinhood chain (calldata) · blockscout
POST /api/signal runs the population in parallel, settles by consensus, hashes the transcript into a real merkle root, and commits that root to Robinhood Chain with a Blockscout link.

The signal pipeline

A signal runs stage by stage, from a task in to an attestation out. A population of agents runs the middle stages in parallel, and the result is reproducible: same outputs, same consensus, same root.

in
gradable signal
checkable answer
fan out
population
parallel agents
agree
consensus
majority + reliability
judge
grade
objective
hash
sha256 + merkle
real root
attest
commit epoch
robinhood chain · blockscout
POST /api/signal, end to end. The same task and grader interface scales to sandboxed signals.

The chain

Lunaria settles on Robinhood Chain ↗, a permissionless, EVM-compatible L2 built on Ethereum with the Arbitrum stack. Gas is paid in ETH, and Blockscout ↗ is the explorer every proof link resolves to. One env var, CHAIN_NETWORK, flips the whole app between mainnet and testnet; lib/chain.ts holds the constants so the client, the server commit, and the CLI scripts always agree.

mainnettestnet
chain id466346630
gasETHETH
public rpcrpc.mainnet.chain.robinhood.comrpc.testnet.chain.robinhood.com
explorerrobinhoodchain.blockscout.com ↗explorer.testnet.chain.robinhood.com ↗

The attestation itself needs no contract: each epoch's merkle root rides as calldata in a 0-ETH self-transfer signed by the network payer (BOUT_PAYER_KEY), so the proof is a plain transaction anyone can open and decode.

The stack

  • Next.js 16 (App Router) and React 19. The site is statically generated; the signal engine is a Node route.
  • viem for everything onchain: the ERC-20 $luna balance read, the calldata commit, and the verification scripts.
  • The mark is a blue dithered orb. Everything is set in Orbitron display over IBM Plex Mono, on a dotted star atlas, with three.js orbs for the population. Reduced-motion aware.
  • Inference runs the gpt-5.6 family (Luna / Terra / Sol) over an OpenAI-compatible endpoint, configured by env.
  • Auth is Privy: connect an external EVM wallet (MetaMask, Rabby, Coinbase) or sign in with email and get a secure embedded wallet. The app gates on holding $luna; the landing, docs, and /verify stay public. Signals persist in a Redis-backed store, so any signal is verifiable by id.
  • Onchain attestation is wired end to end: each epoch's merkle root is committed onchain on Robinhood Chain as transaction calldata (lib/commit.ts) with a Blockscout link. A dedicated attestation contract can replace the calldata commit later.