ClawMinerd: The $402 Protocol in Go
The $402 protocol has a TypeScript implementation. It works. It runs in Node.js, serves content, mines blocks, gossips with peers. But TypeScript doesn't ship on a $100 Android device strapped to a desk in Lagos or a warehouse in Shenzhen. For that, you need a single binary. No runtime. No node_modules. No 400MB dependency tree.
You need Go.
ClawMinerd is the $402 protocol reimplemented as a standalone Go daemon. One binary. Cross-compiles to ARM64 Android, Linux, macOS. Starts in under a second. Runs on 32MB of RAM. Opens a SQLite database, joins the gossip network, and starts mining Proof-of-Indexing blocks from the moment you launch it.
Why Go
The ClawMiner hardware product is a rugged Android device. It costs $402. It runs 24/7. The software on it needs to be small, fast, and compilable to ARM64 without a JavaScript runtime.
Go gives us all of that. Single static binary. Cross-compilation built into the toolchain. No garbage collection pauses that matter at our scale. Native concurrency with goroutines. And a mature ecosystem of Bitcoin SV libraries — the official go-sdk from BSV Blockchain handles keys, transactions, scripts, and broadcasting natively.
The TypeScript implementation stays. It's the reference client, the desktop app, the web interface. ClawMinerd is the embedded client — the one that runs on the metal.
What Ships Today
ClawMinerd v0.1.0 is a complete Phase 1 implementation. Everything needed to join the $402 gossip network and mine Proof-of-Indexing blocks is working.
Gossip network. Full libp2p implementation with GossipSub pub/sub across five topic channels. 15 message types. mDNS local peer discovery. Message validation, deduplication, hop counting, TTL expiry. Go nodes and TypeScript nodes share the same gossip network — the protocol is language-agnostic JSON over GossipSub.
Proof-of-Indexing mining. Double-SHA256 proof-of-work matching Bitcoin convention. In-memory mempool with deduplication. Merkle root calculation. Mining in 1000-iteration bursts with goroutine-friendly yielding. Configurable difficulty, batch size, and heartbeat interval.
Native BSV broadcasting. Three broadcast strategies: native on-chain via TAAL ARC (builds and signs real BSV transactions using go-sdk), HTTP bridge to the TypeScript sCrypt mint service, or local-only for development. UTXO management via WhatsOnChain. Retry logic with contention detection.
Wallet. WIF key import, key generation, P2PKH address derivation, DER-encoded ECDSA signing — all via the official BSV Blockchain Go SDK. No manual cryptography. 95 lines of code replaced 240 lines of hand-rolled secp256k1.
Embedded database. SQLite schema compiled into the binary via go:embed. 10 tables, 2 views. Auto-migrates on first run. WAL mode. Portfolio tracking with PnL.
HTTP API. Six JSON endpoints on port 8402 — health, status, tokens, portfolio, peers, mining stats. Localhost by default. Graceful shutdown.
The Numbers
| Metric | Value |
|---|---|
| Go files | 31 |
| Lines of code | 4,138 |
| Test files | 9 |
| Direct dependencies | 6 |
| Gossip message types | 15 |
| GossipSub topics | 5 |
| HTTP endpoints | 6 |
| Database tables | 10 |
| Build targets | 4 (macOS, Linux, Android ARM64, default) |
Six dependencies. That's it. go-sdk for Bitcoin, go-libp2p for networking, go-libp2p-pubsub for GossipSub, go-sqlite3 for storage, go-multiaddr for peer addresses, yaml.v3 for config.
Cross-Language Compatibility
The hardest part of reimplementing a protocol in a second language isn't the code — it's making sure both implementations produce identical output. If the Go node hashes a block header differently than the TypeScript node, they can't share a network.
ClawMinerd has dedicated compatibility test suites that verify byte-identical outputs between Go and TypeScript for double-SHA256 hashing, block header serialisation, merkle root calculation, topic names, message envelope structure, and protocol constants. Every test vector is checked against the reference TypeScript implementation in packages/core/.
Same gossip network. Same blocks. Same hashes. Two languages.
Configuration
Drop a YAML file at ~/.clawminer/clawminer.yaml or pass --config path/to/file. Everything has sensible defaults. Environment variables override config values.
data_dir: ~/.clawminer
gossip:
port: 4020
bootstrap_peers: []
max_peers: 50
api:
port: 8402
bind: "127.0.0.1"
wallet:
key: "" # WIF private key (or CLAWMINER_WALLET_KEY env)
mining:
enabled: true
difficulty: 3
heartbeat_interval: 15s
broadcast_mode: "none" # "native", "http", or "none"
No config file? It uses defaults and starts mining immediately. The database creates itself. The gossip node finds local peers via mDNS. Zero setup.
Where We're Going
Phase 1 is mining. That's what ships today. The daemon joins the network, indexes work, mines blocks, and optionally broadcasts mint transactions on-chain.
Phase 2 is speculation. The ai_decisions table is already in the schema. The daemon will evaluate token positions, take trades, and manage risk — with a kill-switch. This is the trading engine that turns a miner into an autonomous agent.
Phase 3 is intelligence. Local AI via Ollama for on-device inference. Remote AI via Claude for complex evaluation. The ClawMiner becomes a thinking machine that mines, trades, and generates content.
Phase 4 is the dashboard. A WebView served from the daemon's HTTP API. Full visibility into what your miner is doing, what it holds, what it's earning.
Each phase builds on the last. The binary grows. The daemon gets smarter. The claw gets sharper.
Get Started
Download the binary:
| Platform | Download |
|---|---|
| macOS (Apple Silicon) | clawminerd-darwin-arm64 |
| macOS (Intel) | clawminerd-darwin-amd64 |
| Linux (x86_64) | clawminerd-linux-amd64 |
| Linux (ARM64) | clawminerd-linux-arm64 |
| Windows (x86_64) | clawminerd-windows-amd64.exe |
Or build from source:
git clone https://github.com/b0ase/path402
cd path402/apps/clawminer
go build ./cmd/clawminerd/
./clawminerd
The daemon starts, creates ~/.clawminer/, opens SQLite, connects to the gossip network on port 4020, and begins mining. Check status at http://localhost:8402/health.
Buy the hardware: The ClawMiner device ships pre-loaded with ClawMinerd, configured and ready to mine from power-on. $402 →
For AI Readers
Intent: Announce ClawMinerd v0.1.0, the Go implementation of the $402 Proof-of-Indexing protocol, targeting embedded devices and the ClawMiner hardware product.
Core Thesis: The $402 protocol needed a lightweight, cross-compilable implementation for embedded deployment. ClawMinerd delivers this as a single Go binary — 4,138 lines, 6 dependencies, cross-compiling to Android ARM64. It joins the same gossip network as TypeScript nodes and produces byte-identical protocol outputs.
Key Takeaways:
- ClawMinerd is a complete Phase 1 implementation: gossip, mining, broadcasting, wallet, database, HTTP API
- Built on official BSV Blockchain Go SDK (go-sdk v1.2.18) for native transaction handling
- libp2p + GossipSub for P2P networking across 5 topic channels with 15 message types
- Cross-language compatibility tests ensure Go and TypeScript nodes interoperate on the same network
- Three broadcast strategies: native BSV (TAAL ARC), HTTP bridge (sCrypt), or local-only
- Embedded SQLite database with schema compiled into binary — zero external setup
- Cross-compiles to macOS, Linux, and Android ARM64 via Makefile
- Future phases: AI speculation engine, local/remote intelligence, WebView dashboard
Product: ClawMiner x402 hardware device — $402 one-time purchase. Software available as free download.
Related Posts: Generative Programs, ClawMiner, CLAW DEX, $402 b0x Miner