BitcoinWolfe
Open Source

A sovereign Bitcoin node, built in Rust

Full consensus validation, embedded Lightning, Nostr integration, and Lightning-gated APIs — in a single binary. Verify everything. Trust nothing.

Quick Start
$ git clone https://github.com/refined-element/BitcoinWolfe.git
$ cd BitcoinWolfe && cargo build --release
$ ./target/release/wolfe
INFO starting BitcoinWolfe v0.1.0 chain="mainnet"
INFO consensus engine initialized kernel_height=0
INFO RPC server listening addr="127.0.0.1:8332"
INFO P2P manager started listen="0.0.0.0:8333"
INFO Nostr bridge initialized relays=2
# Node is running. All systems operational.
Architecture

Ten crates. One binary.

Modular workspace where each crate does one thing well. Compile what you need, swap what you don't.

Consensus wolfe-consensus

Full block validation through libbitcoinkernel — the same engine that powers Bitcoin Core, extracted as a library.

libbitcoinkernel v0.2

Lightning wolfe-lightning

Embedded LDK node with channel management, BOLT11 invoices, payment routing, and L402 token generation.

LDK v0.2.2

Wallet wolfe-wallet

Descriptor-based BDK wallet with BIP39 seed generation, BIP84 native SegWit, PSBT workflows, and optional SQLCipher encryption.

BDK v1.1

P2P Network wolfe-p2p

Async peer management with BIP324 v2 encrypted transport, DNS seed discovery, and ban tracking.

BIP324 + Tokio

Nostr wolfe-nostr

Publish block announcements and fee oracle data to Nostr relays. NIP-98 event-based authentication for RPC access.

NIP-01 / NIP-98

RPC & REST wolfe-rpc

Bitcoin Core compatible JSON-RPC, REST endpoints, L402 Lightning-gated APIs, and dual auth (Basic + NIP-98).

Axum

Storage wolfe-store

ACID key-value persistence with redb. Headers, peer records, metadata, and Lightning state in separate databases.

redb

Mempool wolfe-mempool

Fee-rate sorted transaction pool with RBF support, size eviction, configurable OP_RETURN policy, and fee histogram.

Full RBF

Types wolfe-types

Shared types, configuration parsing, error definitions, and peer info snapshots used across all crates.

TOML Config

Node wolfe-node

Main binary and event loop orchestrator. Wires all crates together, handles shutdown, progress reporting, and block pruning.

Tokio Runtime

10

Workspace crates

30+

RPC methods

5

Networks supported

0

Trusted third parties

Everything you need. Nothing you don't.

Each feature earns its place. No bloat, no abstractions for their own sake.

Embedded Lightning node

Open channels, create invoices, route payments — all from the same binary. LDK runs in-process with direct access to the wallet for channel funding and on-chain sweeps. No separate daemon needed.

  • BOLT11 invoice creation and payment
  • Cooperative and force channel closes
  • Automatic wallet-funded channel opens
  • L402 micropayment API gating
  • Configurable channel size limits
// Open a Lightning channel $ curl -X POST localhost:8332 -d '{ "method": "ln_openchannel", "params": [ "02acb6...node_id", 100000, 0 ] }' // Create a BOLT11 invoice $ curl -X POST localhost:8332 -d '{ "method": "ln_invoice", "params": [50000, "coffee"] }'

L402 Lightning-gated APIs

Monetize your node's data with stateless micropayments. Clients pay a Lightning invoice to access premium endpoints — block data, fee estimates, mempool stats. No accounts. No subscriptions. Just sats.

  • HTTP 402 Payment Required flow
  • HMAC-SHA256 stateless tokens
  • Configurable price per request
  • Time-bounded token expiry
  • Secret derived from Lightning seed
# 1. Request gated endpoint GET /l402/api/fees → 402 Payment Required WWW-Authenticate: L402 macaroon="dG9rZW4..." invoice="lnbc100n1..." # 2. Pay the invoice via Lightning # 3. Access with token GET /l402/api/fees Authorization: L402 dG9rZW4... → 200 OK { fee_histogram: [...] }

Native Nostr integration

Your node speaks Nostr natively. Broadcast validated blocks, publish real-time mempool fee data, and authenticate RPC requests with Nostr event signatures instead of passwords.

  • Block announcements (kind 33333)
  • Mempool fee oracle (kind 33334)
  • NIP-98 HTTP authentication
  • Persistent identity with profile metadata
  • Dynamic relay management via RPC
// Block announcement event (kind 33333) { "kind": 33333, "content": { "height": 940601, "hash": "00000000...f005ff", "timestamp": 1710403200, "tx_count": 3847, "size": 1832456 }, "tags": [ ["d", "block"], ["t", "bitcoin"], ["network", "mainnet"] ] }

Secure descriptor wallet

BDK-powered wallet with BIP39 mnemonic generation, BIP84 native SegWit addresses, and full PSBT support. Create wallets via RPC — seed phrases are returned once via RPC.

  • BIP39 12-word mnemonic generation
  • BIP84 native SegWit (bc1q...)
  • PSBT creation, signing, finalization
  • Optional SQLCipher encryption at rest
  • Import existing wallets from seed phrase
  • Full blockchain rescan via RPC
// Create a new wallet $ curl -X POST localhost:8332 -d '{ "method": "createwallet" }' { "mnemonic": "abandon ability ...", "message": "BACKUP THIS SEED PHRASE — it will NOT be shown again" } // Import from existing seed $ curl -X POST localhost:8332 -d '{ "method": "importwallet", "params": ["word1 word2 ..."] }'
API Reference

Bitcoin Core compatible. And then some.

Drop-in JSON-RPC compatibility where it matters. Extended with Lightning, Nostr, and wallet management.

Blockchain

getblockchaininfo
getblockcount
getbestblockhash
getblock
getnetworkinfo
getpeerinfo
getmempoolinfo
getrawmempool

Transactions

getrawtransaction
sendrawtransaction
walletcreatefundedpsbt
walletprocesspsbt

Wallet

createwallet
importwallet
getbalance
getwalletinfo
getnewaddress
listtransactions
rescanblockchain

Lightning

ln_getinfo
ln_connect
ln_openchannel
ln_closechannel
ln_invoice
ln_pay
ln_listchannels
ln_listpeers

Nostr

nostr_getinfo
nostr_publish
nostr_addrelay
nostr_removerelay
nostr_listrelays

REST Endpoints

GET /api/info
GET /api/blockchain
GET /api/mempool
GET /api/peers
GET /api/lightning/*
GET /l402/api/*
Configuration

One file. Full control.

Everything in wolfe.toml. Enable what you need, leave the rest.

wolfe.toml Example
# ── Network ────────────────────────────────────────────── [network] chain = "mainnet" # mainnet | testnet | signet | regtest # ── P2P ────────────────────────────────────────────────── [p2p] listen = "0.0.0.0:8333" max_outbound = 10 prefer_v2_transport = true # BIP324 encrypted connections # ── Wallet (off by default) ────────────────────────────── [wallet] enabled = true # create via RPC: createwallet # ── Lightning (off by default) ─────────────────────────── [lightning] enabled = true listen_port = 9735 alias = "BitcoinWolfe" color = "ff9900" # ── L402 Paywall (off by default) ──────────────────────── [l402] enabled = true # requires Lightning price_sats = 10 # ── Nostr (off by default) ─────────────────────────────── [nostr] enabled = true block_announcements = true fee_oracle = true # ── Metrics (on by default) ────────────────────────────── [metrics] enabled = true # Prometheus on :9332/metrics
Get Started

Run your own node. Verify everything.

BitcoinWolfe is free, open-source software. Clone it, build it, run it. Your keys. Your node. Your rules.

Clone Repository Back to Top