#

mining

(50 articles)

The bull case is in the commit log

Half of my life in Bitcoin is machines paying me. Rigs turn watts into sats and a pool sends them to an address I control, one of them over Lightning, no bank in the loop, nobody's permission required. That half works. It has worked for years. The other half of the stack is machines paying machines: agents buying inference, compute, and API calls with sats instead of a credit card on file. For about a year that half has lived in demo land. Charming on stage, nobody's money at stake. This week I watched it grow up a little, and the evidence was not an announcement. It was a commit log. Routstr, the Bitcoin-native inference router that lets you pay for AI models with Cashu ecash, spent its entire week on crash safety. Guards so a process that dies mid-payment cannot pay twice. Retries on critical writes. Error propagation so a failure surfaces instead of quietly eating sats. Rate limiting per mint. An encrypted vault for stored secrets. Read that list again. There is not one feature in it. Nobody demos crash safety. You cannot put "we no longer double-spend when the process gets killed at the wrong millisecond" on a slide. You only do that work when real value is hitting the failure paths, because demo code loses your sats politely and production code assumes the process dies at the worst possible moment. It does. Ask anyone who has run anything. Now the honest contrast, because the sovereign stack does not get stronger by pretending the other rail does not exist. The loudest agent-payment rail right now is x402, stablecoin micropayments over HTTP, and by measured volume it is winning: over a hundred million transactions and six figures worth of agents buying with it as of this summer. But listen to the builders on that rail and the same worries keep surfacing: authorization, idempotency, receipts. A two-cent call that misfires is a shrug. A five-hundred-dollar job that double-pays, with no receipt and no recourse, is a disaster. There are already third-party arbitration layers launching to referee disputes, which tells you the rail cannot settle an argument on its own. The Bitcoin-side bet is structurally different. Ecash and Lightning are bearer instruments. There is no issuer to phone, no chargeback, no court in the loop. Which means the safety cannot be bolted on as a dispute process later; it has to live in the client, in exactly the unglamorous code Routstr spent this week writing. That is not a weakness of the design. It is the design telling you where the engineering has to happen. So here is the frame I keep coming back to as an operator. The earn side of the loop is proven: my machines already convert energy into permissionless money every ten minutes, and one pool already delivers it over Lightning. The spend side, sats buying compute back without asking anyone, is the half being hardened right now, in public, commit by boring commit. When both halves hold, a machine can fund its own thinking from its own work, and no platform sits in the middle of that sentence. Could this stall? Sure. One good week of commits is not an ecosystem, the volume on the Bitcoin side is still a rounding error next to the dollar rails, and I have watched promising plumbing die of no users before. I reserve the right to change my mind when new information comes available. But if you want to know whether this half of the stack is real, do not watch the announcements. Watch the commit logs. Announcements are what a project says about itself. Crash safety is what it quietly admits about its users: that they exist, and that losing their money has started to matter. --- I write monthly about running a small hosted mining fleet as a bitcoin accumulation strategy. Subscribe at [difficultyadjusted.io](https://difficultyadjusted.io/).

Bitcoin CPU Lottery Miner Using Your Own Full Node

# Bitcoin CPU Lottery Miner on Linux Using Your Own Full Node I have a 32 thread Ryzen CPU in my Debian PC and I definitely don't use most of that computing power most of the time. I thought it would be fun to throw a few of those idle threads at solo lottery mining with my own full node. Here are the steps if you want to try the same thing: This is **not profitable CPU mining**. It is **educational lottery mining**. Odds are extremely low, but the setup performs real SHA256d mining against your own node. (*this guide assumes you already have a full node running on your PC that is started by a systemd service. If you do not use systemd for that then just disregard step 1 and start with step 2.*) --- ## 1. Verify your Bitcoin node config path ```bash systemctl --user status bitcoind.service ``` Look for: ```bash -datadir=/path/to/your/bitcoin/datadir -conf=/path/to/your/bitcoin.conf ``` --- ## 2. Edit `bitcoin.conf` ```bash nano /path/to/your/bitcoin.conf ``` Add or verify: ```conf server=1 rpcbind=127.0.0.1 rpcallowip=127.0.0.1 zmqpubhashblock=tcp://127.0.0.1:28332 ``` --- ## 3. Create RPC credentials for ckpool ```bash python3 - <<'PY' import secrets, hmac, hashlib user = "ckpool" password = secrets.token_urlsafe(32) salt = secrets.token_hex(16) digest = hmac.new(salt.encode(), password.encode(), hashlib.sha256).hexdigest() print("Add this line to bitcoin.conf:") print(f"rpcauth={user}:{salt}${digest}") print() print("Use this password in ckpool.conf:") print(password) PY ``` - Copy the printed `rpcauth=ckpool:...` line into `bitcoin.conf` - Save the printed password --- ## 4. Restart your node ```bash systemctl --user daemon-reload systemctl --user restart bitcoind.service ``` Test RPC: ```bash bitcoin-cli \ -datadir=/path/to/your/bitcoin/datadir \ -conf=/path/to/your/bitcoin.conf \ getblockchaininfo ``` Optional alias: ```bash echo "alias bitcoin-cli-node='bitcoin-cli -datadir=/path/to/your/bitcoin/datadir -conf=/path/to/your/bitcoin.conf'" >> ~/.bashrc source ~/.bashrc ``` --- ## 5. Install all build dependencies ```bash sudo apt update sudo apt install -y \ git build-essential autoconf automake libtool pkg-config \ libssl-dev libevent-dev libzmq3-dev yasm \ libcurl4-openssl-dev libjansson-dev \ lm-sensors ``` --- ## 6. Build ckpool-solo ```bash mkdir -p ~/apps cd ~/apps git clone https://github.com/golden-guy/ckpool-solo.git cd ckpool-solo ./autogen.sh ./configure make -j"$(nproc)" ``` --- ## 7. Configure ckpool ```bash nano ~/apps/ckpool-solo/ckpool.conf ``` Replace the contents of the file with this: ```json { "btcd" : [ { "url" : "127.0.0.1:8332", "auth" : "ckpool", "pass" : "PASTE_YOUR_GENERATED_RPC_PASSWORD_HERE", "notify" : true } ], "serverurl" : [ "127.0.0.1:3333" ], "btcsig" : "/solo/" } ``` --- ## 8. Test ckpool manually ```bash cd ~/apps/ckpool-solo src/ckpool -k -B -c ckpool.conf ``` Expected output: ```text Connected to bitcoind: 127.0.0.1:8332 Mining solo to any incoming valid BTC address username ``` Stop with: ```bash Ctrl+C ``` Start detached: ```bash ~/apps/ckpool-solo/src/ckpool -k -B -D -c ~/apps/ckpool-solo/ckpool.conf ``` Verify: ```bash pgrep -a ckpool ss -ltnp | grep 3333 ``` --- ## 9. Build cpuminer ```bash cd ~/apps git clone https://github.com/pooler/cpuminer.git cd cpuminer ./autogen.sh ./configure make -j"$(nproc)" ``` Test: ```bash ./minerd --help ``` --- ## 10. Test mining manually ```bash cd ~/apps/cpuminer ./minerd -a sha256d \ -o stratum+tcp://127.0.0.1:3333 \ -O YOUR_BITCOIN_ADDRESS.worker:x \ -t 4 ``` --- ## 11. Check CPU temperature ```bash sudo sensors-detect sensors ``` Live monitoring: ```bash watch -n 2 sensors ``` Temperature guidance: ``` <75°C comfortable sustained load 75–85°C running a bit hot 85–90°C high, reduce load >90°C DANGER!!! ``` --- ## 12. Enable services to run after logout ```bash loginctl enable-linger "$USER" ``` --- ## 13. Create ckpool systemd service ```bash mkdir -p ~/.config/systemd/user nano ~/.config/systemd/user/ckpool.service ``` ```ini [Unit] Description=ckpool solo Stratum server After=bitcoind.service Requires=bitcoind.service [Service] Type=simple WorkingDirectory=/home/YOUR_USER/apps/ckpool-solo ExecStart=/home/YOUR_USER/apps/ckpool-solo/src/ckpool -k -B -c /home/YOUR_USER/apps/ckpool-solo/ckpool.conf ExecStop=/usr/bin/pkill -TERM -x ckpool Restart=on-failure RestartSec=10 [Install] WantedBy=default.target ``` --- ## 14. Create miner environment file ```bash mkdir -p ~/.config/minerd nano ~/.config/minerd/minerd.env ``` ```bash BTC_ADDRESS=YOUR_BITCOIN_ADDRESS MINER_THREADS=4 CPU_QUOTA=200% ``` --- ## 15. Create minerd systemd service ```bash nano ~/.config/systemd/user/minerd.service ``` ```ini [Unit] Description=Bitcoin CPU lottery miner After=ckpool.service Requires=ckpool.service [Service] Type=simple EnvironmentFile=/home/YOUR_USER/.config/minerd/minerd.env WorkingDirectory=/home/YOUR_USER/apps/cpuminer ExecStart=/home/YOUR_USER/apps/cpuminer/minerd -a sha256d -o stratum+tcp://127.0.0.1:3333 -O ${BTC_ADDRESS}.worker:x -t ${MINER_THREADS} Restart=on-failure RestartSec=10 Nice=15 CPUWeight=10 CPUQuota=${CPU_QUOTA} IOSchedulingClass=idle [Install] WantedBy=default.target ``` --- ## 16. Stop manual processes ```bash pkill minerd pkill ckpool ``` --- ## 17. Enable and start services ```bash systemctl --user daemon-reload systemctl --user enable ckpool.service minerd.service systemctl --user start ckpool.service systemctl --user start minerd.service ``` --- ## 18. Verify everything ```bash systemctl --user status ckpool.service systemctl --user status minerd.service ``` ```bash pgrep -a ckpool pgrep -a minerd ss -ltnp | grep 3333 ``` Logs: ```bash journalctl --user -u ckpool.service -f journalctl --user -u minerd.service -f ``` --- ## 19. Adjust threads or CPU cap ```bash nano ~/.config/minerd/minerd.env ``` Example: ```bash MINER_THREADS=4 CPU_QUOTA=200% ``` Restart: ```bash systemctl --user restart minerd.service ``` --- ## 20. Expected result Example output: ```text thread 0: 16700 khash/s thread 1: 16700 khash/s thread 2: 16700 khash/s thread 3: 16700 khash/s ``` Total: ```text ~66.8 MH/s ``` --- ## Final Notes - This is **lottery mining**, not income generation - You are mining directly against your own node - You control the full stack: node → stratum → miner - This is useful for learning and sovereignty, not profit - You have a better chance of winning the powerball than getting a block reward, but the point is, you are now fully participating in the Bitcoin network! Later you can point any ASICs you have to mine to the same stratum server if you really want to get serious about solo mining.