hackquest logo

RealBot

Trustless DeFi trading agent verification using STARK proofs on Arbitrum Stylus. Generates browser-side STARK proofs of Sharpe ratio from real GMX V2 trades and verifies them on-chain — no trusted set

视频

项目图片 1
项目图片 2

技术栈

Web3
Next
Rust
DeFi
ARB
Solidity

描述

Problem

DeFi trading agents and bots report their own performance, but there is no way to verify these claims. Self-reported returns are easy to fake — anyone can claim a 200% APY. Centralized leaderboards require trust in the platform operator. Users have no mathematical guarantee to independently verify a bot's Sharpe ratio or any other performance metric.

Solution

RealBot solves this by generating STARK proofs of Sharpe ratio computations from real GMX V2 trade data on Arbitrum One and verifying them on-chain via an Arbitrum Stylus smart contract. The result is a trustless, mathematically verified performance score that no one can forge — no trusted setup, no backend server, fully transparent.

How It Works

RealBot follows a three-step pipeline: Fetch → Prove → Verify.

  1. Fetch Real Trades — Pull actual trade history (PositionIncrease/Decrease events) from GMX V2 on Arbitrum One mainnet.

  2. Generate STARK Proof — The browser generates a STARK proof of the Sharpe ratio computation entirely client-side using WASM. Proof generation takes ~380ms with no backend required.

  3. Verify On-Chain — Submit the ABI-encoded proof to the Stylus verifier contract on Arbitrum Sepolia. Full verification completes in a single transaction at ~1.25M gas.

Key Features

  • STARK-verified Sharpe ratio with no trusted setup — transparent, post-quantum secure

  • Real GMX V2 mainnet trade data — not simulated, pulled from Arbitrum One

  • Browser WASM prover — proof generation runs entirely client-side, zero infrastructure cost

  • Arbitrum Stylus verifier — Rust/WASM on-chain contract leveraging native Keccak256 precompile

  • Multi-receipt commitment binding — binds proof to specific trade receipts via hash chain, preventing proof reuse or data substitution

  • Live gas benchmark — run actual on-chain verification and compare measured gas against STARK/SNARK reference data

Why STARK over SNARK

RealBot chose STARK because it eliminates the need for a trusted setup ceremony, which is critical for trustless verification. STARK proof generation is 48x faster (380ms browser vs 18.5s server) enabling instant UX feedback. The prover runs entirely in the user's browser via WASM, requiring zero backend infrastructure — no server to deploy, scale, or pay for. STARK security relies only on hash function collision resistance (Keccak256), making it post-quantum safe. While SNARK (Groth16) saves ~4.5x on-chain gas, the total cost of verification including off-chain infrastructure is lower with STARK for this use case.

Technical Architecture

The Sharpe Ratio AIR (Algebraic Intermediate Representation) uses 6 trace columns covering return, return squared, cumulative return, cumulative squared, trade count, and dataset commitment. The system enforces 5 transition constraints for cumulative sum integrity and value immutability, plus 4 boundary constraints including the final Sharpe equation verification. The cryptographic stack uses Keccak256 hashing (native Stylus precompile), BN254 scalar field in Montgomery form, and FRI with Keccak256 Merkle trees for polynomial commitment.

Why Stylus for STARK Verification

STARK proofs are hash-heavy — the verifier re-hashes Merkle paths, FRI commitments, and Fiat-Shamir challenges hundreds of times per proof. Arbitrum Stylus compiles Rust to WASM and runs it natively, giving major advantages over Solidity/EVM: native 64-bit register operations instead of 256-bit stack operations, ~80x lower loop overhead, and most importantly, the Keccak256 native precompile eliminates the biggest bottleneck. A single verification requires 200+ Keccak256 hashes and 500+ field multiplications — Stylus makes this feasible at ~1.25M gas in a single transaction.

Deployed Contract

STARK Verifier v6 is deployed on Arbitrum Sepolia at 0x365344c7057eee248c986e4170e143f0449d943e , supporting Sharpe ratio STARK verification with commitment binding.

Vision: Trust Layer for the Agent-to-Agent Economy

As autonomous agents increasingly transact with each other (A2A), trustless performance verification becomes critical infrastructure. ERC-8004 (Trustless Agents) defines an Identity, Reputation, and Validation Registry for cross-organizational agent discovery and trust — but the registry itself is only a framework. It needs concrete validators that provide mathematically unforgeable guarantees. RealBot's STARK verifier fills this role: any agent can request on-chain proof that a trading agent's claimed Sharpe ratio is correct, backed by cryptographic proof rather than reputation or self-reporting. Today, RealBot verifies DeFi trading bots. Tomorrow, it serves as the trust layer for the emerging agent economy.

Today, RealBot verifies DeFi trading bots. Tomorrow, it serves as the trust layer for the emerging agent economy. We believe projects like RealBot, combined with Stylus's native WASM execution, position Arbitrum as the most capable L2 ecosystem for this agent-driven future.

本次黑客松进展

The full end-to-end pipeline is working: Fetch → Prove → Verify. The Stylus STARK verifier contract is deployed on Arbitrum Sepolia with 88 passing tests. The off-chain Rust prover compiles to WASM and runs in the browser with 54 passing tests. The Next.js frontend features a 4-tab dashboard including proof pipeline visualization, gas comparison benchmarks, and live wallet-based proof generation. The Solidity EvaluationRegistry is built and tested with Foundry. All components are integrated — users can connect a wallet, enter a trader address, fetch real GMX V2 trades, generate a STARK proof in ~380ms, and verify it on-chain in a single transaction.

队长
Hhoddukzoa
项目链接
赛道
DeFiInfra