Agent Integration
Give your AI agent the ability to analyze Bitcoin transactions for privacy exposure. CLI tool with JSON output, MCP server for structured tool calls, or import the engine directly.
Quick Start
npm install -g am-i-exposedRequires Node.js 20+. Or use npx am-i-exposed without installing.
Available Tools
scan_transaction
Run 25 privacy heuristics on a transaction. Detects CoinJoin, change outputs, wallet fingerprints, entity matches, and more.
am-i-exposed scan tx 323df21f...dec2 --jsonscan_address
Check address reuse, UTXO hygiene, spending patterns, entity identification, and temporal correlation.
am-i-exposed scan address bc1q... --jsonscan_psbt
Analyze an unsigned transaction BEFORE broadcasting. Zero network access needed. The key tool for privacy-aware transaction crafting.
am-i-exposed scan psbt /tmp/proposed-tx.psbt --jsonscan_wallet
Wallet-level privacy audit via xpub/zpub/descriptor. Derives addresses, scans activity, checks reuse and UTXO hygiene.
am-i-exposed scan xpub zpub6r... --json --gap-limit 30compute_boltzmann
Compute Boltzmann entropy, wallet efficiency, and the full link probability matrix. Auto-detects WabiSabi and JoinMarket for turbo mode.
am-i-exposed boltzmann 323df21f...dec2 --jsonJSON Output
All commands with --json return a consistent envelope:
{
"score": 95,
"grade": "A+",
"txType": "whirlpool-coinjoin",
"findings": [
{
"id": "h4-whirlpool",
"severity": "good",
"title": "Whirlpool CoinJoin detected",
"scoreImpact": 30,
"confidence": "deterministic"
}
],
"recommendation": {
"urgency": "when-convenient",
"headline": "Maintain UTXO separation"
}
}MCP Server
For AI agents that support Model Context Protocol - structured tool calls over stdio instead of parsing CLI output.
am-i-exposed mcpClaude Desktop configuration:
{
"mcpServers": {
"bitcoin-privacy": {
"command": "npx",
"args": ["-y", "am-i-exposed", "mcp"]
}
}
}Exposes the same 5 tools with typed input schemas (zod validation). Compatible with Claude Desktop, Claude Code, Cline, and other MCP clients.
Agent Workflows
Pre-broadcast privacy check
- Craft a transaction in your wallet, export as PSBT
- Run: am-i-exposed scan psbt <file> --json
- Check .grade - if D or F, modify coin selection
- Repeat until grade is B or better, then sign and broadcast
Wallet health audit
- Export your xpub/zpub from wallet software
- Run: am-i-exposed scan xpub <key> --json --gap-limit 30
- Check reusedAddresses (should be 0) and dustUtxos (should be 0)
- Review findings for consolidation history and script type mixing
Transaction forensics
- Run: am-i-exposed scan tx <txid> --json
- Check grade and txType for quick assessment
- For deeper analysis: am-i-exposed chain-trace <txid> --depth 3 --json
- Review entity proximity and taint findings
Performance
| Mode | Time | Notes |
|---|---|---|
| Normal scan | ~10s | Full context (parent txs + output addresses) |
| --fast | ~6s | Skip context fetching, all heuristics still run |
| Cached (repeat) | ~1.5s | SQLite cache, instant on second scan |
| PSBT (offline) | <1s | Zero network access needed |
| Boltzmann | 2-15ms | Rust/WASM, turbo modes for WabiSabi/JoinMarket |
Privacy
- No addresses or transactions are logged or persisted by the CLI
- Entity detection uses bundled data files (~92 MB), no external APIs
- PSBT analysis requires zero network access
- Only mempool.space API is used for blockchain data (or your custom endpoint)
- All analysis runs locally on your machine
- Self-host with
--apiflag pointed at your own mempool instance