____ __ _____ __ _
/ __ \___ ____/ / / ___// /______(_)___ ____
/ /_/ / _ \/ __ / \__ \/ __/ ___/ / __ \/ __ `/
/ _, _/ __/ /_/ / ___/ / /_/ / / / / / / /_/ /
/_/ |_|\___/\__,_/ /____/\__/_/ /_/_/ /_/\__, /
/____/
Map wallet networks as interactive 3D graphs. RedString is a forensic investigation CLI that wraps the Nansen CLI to perform BFS traversal of on-chain wallet connections, enrich nodes with financial intelligence, and render self-contained WebGL visualizations.
Built for the Nansen CLI Build Challenge โ Week 4
- ๐ต๏ธ BFS Graph Traversal โ Discover wallet networks with configurable depth (1โ3) and width (5โ20)
- ๐ฐ Financial Enrichment โ Labels, balances, 30d PnL, DeFi protocol exposure per node
- ๐ 3D WebGL Visualization โ Self-contained HTML with auto-orbit cameras, particle effects, and screenshot export
- ๐ OSINT Integration โ Off-chain intelligence via Nansen web search
- โก Disk Cache โ SHA256-keyed persistent cache to minimize API costs (configurable TTLs)
- ๐ Telemetry Receipt โ Forensic audit trail of every API call with latency tracking
- ๐ญ Mock Mode โ Full offline development with synthetic data (
NANSEN_MOCK=true)
redstring investigate 0xdead... --depth 2 --width 10
โ
โโโโ BFS Engine (graph-builder.ts)
โ โโโ profiler trace โ connections
โ โโโ profiler counterparties โ fallback
โ โโโ enrichNode โ labels, balance, PnL, DeFi
โ
โโโโ OSINT Layer (osint.ts)
โ โโโ web search โ off-chain intelligence
โ
โโโโ Terminal Report (terminal-report.ts)
โ โโโ Palantir-aesthetic forensic summary
โ
โโโโ HTML Renderer (html-renderer.ts)
โ โโโ 3D force-directed graph (3d-force-graph)
โ
โโโโ Telemetry (telemetry.ts)
โโโ API call receipt with cache hit rates
- Node.js โฅ 18
- Nansen CLI installed and authenticated (
npm i -g @nansen/cli)
# Clone
git clone https://github.com/edycutjong/nansen-redstring.git
cd nansen-redstring
# Install dependencies
npm install
# Run in mock mode (no API key needed)
NANSEN_MOCK=true npx tsx src/index.ts investigate 0xdead...beef
# Run with live Nansen API
npx tsx src/index.ts investigate 0xdead...beef --depth 2 --width 10npm run build
npm link
redstring investigate 0xdead...beefCore forensic command. Traces wallet connections via BFS and renders a 3D graph.
| Flag | Description | Default |
|---|---|---|
-d, --depth <n> |
BFS traversal depth (1โ3) | 2 |
-w, --width <n> |
Max counterparties per node (5โ20) | 10 |
-c, --chain <chain> |
Blockchain network | ethereum |
-m, --min-volume <usd> |
Minimum USD volume filter | 0 |
--osint |
Include off-chain web search | false |
--no-cache |
Bypass disk cache | false |
--no-open |
Skip auto-opening browser | false |
--json |
Output raw graph JSON | false |
-o, --output <dir> |
Output directory for HTML | cwd |
Head-to-head wallet comparison. Shows correlation score, common counterparties, and shared tokens.
| Flag | Description | Default |
|---|---|---|
-c, --chain <chain> |
Blockchain network | ethereum |
--json |
Output raw JSON | false |
Deep wallet profile โ labels, balance, PnL, DeFi positions, and recent transactions.
| Flag | Description | Default |
|---|---|---|
-c, --chain <chain> |
Blockchain network | ethereum |
--json |
Output raw JSON | false |
| Shortcut | Action |
|---|---|
S |
Screenshot (PNG export) |
R |
Reset camera position |
L |
Toggle node labels |
| Mouse drag | Rotate view |
| Scroll | Zoom in/out |
| Click node | Open detail panel |
| Color | Meaning |
|---|---|
| ๐ด Neon Crimson | Seed / Target wallet |
| ๐ก Cyber Gold | Smart Money |
| ๐ต Neon Cyan | Labeled entity (Exchange, DEX, etc.) |
| โซ Dim Slate | Unknown wallet |
| ๐ Muted Gray | Contract |
![]() Investigate |
![]() Profile |
![]() Compare |
![]() Compare (Full) |
![]() Telemetry Receipt |
|
# Type check
npm run typecheck
# Lint
npm run lint
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Full CI pipeline (typecheck + lint + test:coverage)
npm run ci| Alias | Address | Why |
|---|---|---|
| jaredfromsubway.eth | 0xae2Fc483527B8EF99EB5D9B44875F005ba1FaE13 |
MEV bot operator |
| Wintermute | 0x0000000000000000000000000000000000000000 |
Market maker |
| Nomad Exploiter | 0x56D8B635A7C88Fd1104D23d632AF4003B16d0BF6 |
Bridge exploit |
| Variable | Description |
|---|---|
NANSEN_MOCK |
Enable synthetic data mode (true/false) |
NANSEN_DEBUG |
Enable verbose API error logging (true/false) |
src/
โโโ index.ts # CLI entry point (Commander.js)
โโโ commands/
โ โโโ investigate.ts # BFS investigation command
โ โโโ compare.ts # Wallet comparison command
โ โโโ profile.ts # Deep wallet profile command
โโโ lib/
โ โโโ graph-builder.ts # BFS traversal engine
โ โโโ nansen.ts # Nansen CLI wrapper + caching
โ โโโ html-renderer.ts # 3D WebGL HTML generator
โ โโโ enricher.ts # Node financial enrichment
โ โโโ osint.ts # Off-chain intelligence
โ โโโ disk-cache.ts # SHA256-keyed persistent cache
โ โโโ telemetry.ts # API call tracking
โ โโโ terminal-report.ts # Terminal formatting
โ โโโ mock.ts # Synthetic data generator
โโโ types/
โโโ graph.ts # GraphNode, GraphEdge, GraphData
โโโ investigation.ts # InvestigationOptions, results
โโโ wallet.ts # Raw API response shapes
MIT ยฉ edycutjong





