The Google Translate for Soroban β an open-source transparency tool for the Stellar/Soroban ecosystem.
Smart contracts on Stellar/Soroban emit events as cryptic, hex-encoded binary data. To the average user β or even most developers β these events are completely unreadable. Open-Audit solves this by:
- Fetching raw contract events from the Stellar network via Horizon/RPC.
- Translating them into plain English sentences using a community-maintained Translation Registry.
- Displaying the results in a clean, searchable dashboard anyone can use.
Example:
| Before (Raw) | After (Translated) |
|---|---|
0x000000000000000000000000... |
Public Key [GABC...1234] transferred 100 USDC to [GXYZ...5678] |
- Framework: Next.js 16.2.10 (App Router) + TypeScript
- Design System: Tailwind CSS + shadcn/ui
- Stellar Integration:
stellar-sdk - State Management: React Context + Server Components
- Node.js >= 20.9
- npm >= 9
git clone https://github.com/Open-audit-foundation/Open-Audit.git
cd open-audit
npm install
npm run devOpen http://localhost:3000 in your browser.
If you want the custom server with WebSocket support and /metrics, run:
npm run dev:wsCopy .env.example to .env.local and fill in the values:
cp .env.example .env.localSee .env.example for the full, commented list of
required and optional variables β it's organized into [REQUIRED]
and [OPTIONAL] sections with defaults and explanations for each.
Development:
npm run dev # Standard Next.js dev server
npm run dev:ws # Legacy monolithic server with WebSocket support
npm run test # Run the repository test suite
npm run build:cli # Build the standalone CLI
npm run cli:example # Exercise the CLI against the sample blueprintTesting & Quality:
npm run test # Run all tests
npm run test:parity # Native/TS XDR decoder parity + fallback tests
npm run lint # Run ESLint
npm run lint:registry # Validate translation registry
npm run format # Format code with PrettierNative XDR decoder (optional):
npm run build:native # Build the Rust N-API decoder (release)
npm run build:native:debug # Debug build
npm run build:native:docker # Build in a clean container
npm run bench:xdr # TS vs native throughput comparisonThe custom server exposes Prometheus metrics on http://localhost:3000/metrics when running npm run dev:ws.
You can configure OpenTelemetry to export spans to Jaeger by setting:
export JAEGER_ENDPOINT="http://localhost:14268/api/traces"
export OTEL_SERVICE_NAME="open-audit"The default Jaeger endpoint is http://localhost:14268/api/traces.
Open-Audit currently runs as a single-process monolithic architecture:
π Documentation:
- Architecture Guide - Repository and service architecture overview
Real-time health monitoring for all system components with sub-500ms response:
Worker Heartbeat β Redis β Health API β Status Dashboard
Features:
- β Real-time component health checks (Stellar RPC, Database, Redis, Worker)
- β Circuit breaker state monitoring
- β System metrics (events, translations, connections)
- β Beautiful auto-refreshing dashboard
- β Sub-500ms API response time
- β Graceful degradation
Components Monitored:
- Stellar RPC (with circuit breaker state)
- Database (Prisma connection)
- Redis cache
- Indexer worker (heartbeat-based)
π Documentation:
- Status Monitoring Guide - Complete monitoring documentation
Quick Start:
# Access status dashboard
open http://localhost:3000/status
# Check health via API
curl http://localhost:3000/api/status | jqWorker Heartbeat:
- Writes to Redis every 30 seconds
- Validates worker is alive (< 90s threshold)
- Includes metrics: processed count, error count, uptime
Bulletproof XDR parser protection against malicious contract payloads:
Untrusted XDR β Security Guards β Safe Parsing β Graceful Error Handling
Protection Against:
- β Stack overflow (deeply nested structures)
- β Out-of-memory attacks (large payloads)
- β Denial of service (infinite loops)
- β Malformed XDR exploitation
Security Mechanisms:
- Recursion depth limits (MAX=100 levels)
- Memory allocation guards (MAX=10 MB)
- Parsing timeout protection (MAX=5 seconds)
- Collection size limits (MAX=10,000 elements)
- Real-time attack detection
π Documentation:
- Security Hardening Guide - Complete security documentation
Quick Start:
import { secureParseScVal } from '@/lib/translator/secure-xdr-parser';
const result = secureParseScVal(hex);
if (result.success) {
// Use result.value safely
}A native N-API module (native/soroban-xdr-decode) accelerates secureParseScVal
for high-throughput scenarios. It is a drop-in performance path, not a second
parser contract: it enforces the exact same security guards as the TypeScript
implementation (recursion depth, allocation, timeout, collection size β same
limits, same error classes, same messages) and the TypeScript parser remains
the automatic fallback.
Zero configuration: if the addon has been built for the current platform it
is used automatically (for payloads large enough to benefit); if it is missing,
fails to load, or misbehaves at runtime, secureParseScVal transparently uses
the pure-TypeScript implementation. Set OPEN_AUDIT_DISABLE_NATIVE_XDR=1 to
force the TypeScript path (debugging/benchmarking only).
Building (requires a Rust toolchain, or Docker):
npm run build:native # release build for the current platform
npm run build:native:debug # debug build
npm run build:native:docker # build inside a clean container (no local Rust needed)Supported platforms: Linux x64/arm64 (glibc & musl), macOS x64/arm64, Windows x64. On anything else the build script exits with a message and the TypeScript parser is used β that is a fully supported configuration, not an error.
Verification: npm run test:parity runs every fuzz/security corpus input
(including all payloads from fuzz-xdr-parser.test.ts and
secure-xdr-parser.test.ts, deterministic mutation/random sweeps, UTF-8 edge
cases and guard-boundary payloads) against both implementations and asserts
identical results, and covers the automatic fallback with simulated
missing/crashing/lying addons.
Measured throughput (npm run bench:xdr, Node v20.20.2, linux-x64,
release build, interleaved best-of-3 rounds):
| workload | TS ops/s | native ops/s | speedup |
|---|---|---|---|
| typical transfer event (4 payloads) | 104,654 | 104,173 | 1.00x |
| medium nested struct (depth 5, 50 fields) | 8,204 | 19,634 | 2.39x |
| large vec (1,000 u32) | 1,081 | 3,568 | 3.30x |
| large map (5,000 entries) | 104 | 324 | 3.12x |
| attack: nested vec depth 150 | 1,928 | 24,781 | 12.86x |
| attack: vec with 20,000 elements | 292 | 1,401 | 4.80x |
| malformed: tiny truncated garbage | 10,877 | 11,128 | 1.02x |
| malformed: 4KB of garbage | 23,406 | 29,623 | 1.27x |
Small payloads (< ~50 bytes) intentionally stay on the TypeScript path β the N-API call overhead exceeds the work saved there, so the hybrid is never slower than pure TS. The largest wins are on hostile payloads, where rejection happens in Rust before the JavaScript XDR parser ever runs.
Single-process system (for simple deployments):
Stellar Network β Event Indexer β Translation Engine β WebSocket Server β Frontend Dashboard
server.ts.
npm run dev:wsFor new contributors wanting to understand the system's data flow and internal architecture, see the comprehensive ARCHITECTURE.md guide which includes:
- π Interactive Mermaid diagrams showing data flow
- π Component deep dives for each service
- π Step-by-step event journey from blockchain to UI
- π οΈ Development guides for adding new features
Quick Overview:
- Event Indexer (
lib/stellar/,src/worker/) β Polls Stellar RPC with resilient rate limiting - Translation Engine (
lib/translator/) β Converts XDR to human-readable text with security hardening - Redis Pub/Sub β Message broker for event distribution
- WebSocket Server (
server.ts) β Broadcasts events in real-time - Frontend Dashboard (
app/dashboard/,components/) β Interactive UI
open-audit/
βββ app/ # Next.js App Router pages
β βββ dashboard/ # Main dashboard page
β βββ api/ # API routes (health checks, etc.)
β βββ layout.tsx # Root layout with theme provider
β βββ page.tsx # Landing / redirect
βββ components/ # Reusable UI components
β βββ ui/ # shadcn/ui primitives
β βββ dashboard/ # Dashboard-specific components
β βββ theme/ # Dark mode toggle
βββ lib/
β βββ translator/ # π The Translation Registry core logic
β β βββ types.ts # RawEvent / TranslatedEvent interfaces
β β βββ registry.ts # Registry lookup function
β β βββ blueprints/ # Per-contract translation blueprints
β βββ stellar/ # Stellar SDK helpers
β β βββ indexer.ts # Event polling with rate limit handling
β β βββ client.ts # RPC client configuration
β βββ resilience/ # β‘ Rate limiting & circuit breaker
β β βββ token-bucket.ts # Token bucket rate limiter
β β βββ circuit-breaker.ts # Circuit breaker pattern
β β βββ resilient-client.ts # Resilient RPC client wrapper
β βββ hooks/ # React hooks for live data
β βββ utils.ts # Shared utilities
βββ src/
β βββ worker/ # Standalone indexer worker
β βββ indexer.ts
βββ scripts/
β βββ lint-registry.ts # Translation registry validation
β βββ test-websocket-client.js # WebSocket testing tool
βββ docs/
β βββ good-first-issues.json
βββ server.ts # Legacy monolithic server (deprecated)
βββ ARCHITECTURE.md # π Detailed architecture guide
βββ SECURITY_HARDENING_GUIDE.md # π Security documentation
βββ public/
The heart of Open-Audit is the Translation Registry in /lib/translator/. Each contract gets a blueprint β a mapping from raw event topics/data to a human-readable template.
To add support for a new contract, create a file in /lib/translator/blueprints/ and register it in registry.ts. See CONTRIBUTING.md for a step-by-step guide.
Instant offline testing for translation blueprints β no database, no network, no services required.
# Install and build
npm install
npm run build:cli
# Test a specification
node dist/cli/open-audit-cli.js test \
--hex 0x74726e7312345678 \
--spec ./blueprints/my-contract.json \
--verboseBenefits:
- β 17x faster iteration cycle vs. full system
- β Zero setup - Node.js only
- β Works offline
- β JSON & YAML support
- β CI/CD integration ready
π Documentation:
- CLI README - Complete command reference and examples
- CLI Quick Start - Get started in 30 seconds
Quick Example:
npm run cli:exampleOutput:
β
Translation Successful
Description: GABC...1234 transferred 100.00 USDC to GXYZ...5678
We welcome contributions of all sizes! See CONTRIBUTING.md to get started.
Good first issues are listed in /docs/good-first-issues.json.
MIT Β© Open-Audit Contributors