Loops HouseBitLens

NEAR HACKATHON
Team
1 member- NAOwner
Nadhir
Overview
Problem: people, and now AI agents, sign transactions to NEAR contracts they cannot read. There is usually no source code and no audit, only bytecode, and one unprotected admin method is enough to drain a contract.
What we built: BitLens, a security scanner for NEAR contracts that works from the deployed bytecode alone. Give it an account: it fetches the WASM over NEAR RPC (view_code, read-only) and builds a risk card (can the contract send NEAR, add keys, redeploy itself, which NEP standards, which admin-looking methods). Then it attacks the real bytecode in a local NEAR runtime (near-contract-sim, nearcore) with an owner, a victim and an attacker: unauthorized admin calls, same-block double withdrawals, failed-transfer refunds, callbacks out of gas, stale yield/resume timeouts. Each defence comes back HELD, BROKEN or INCONCLUSIVE, with the receipt chain and NEAR deltas as evidence, and an animated replay of the attack.
For AI agents, BitLens is an MCP server (stdio or HTTPS). Its check_transaction tool judges the transaction an agent is about to sign and answers allow / confirm / block with the attack that proves it; BitLens never signs. Users can also type an attack in plain English: an LLM on NEAR AI Cloud turns it into a validated test scenario (JSON, never code) that the same simulator runs.
How NEAR fits: contract code comes from NEAR RPC, attacks run in NEAR's own runtime with real receipts, gas, callbacks and yield/resume, NEP standard signatures shape the calls, and NEAR AI powers text-to-test.
Demo: https://bitlens-web.vercel.app · Code: https://github.com/NaDasai/bitlens