This repository provides an educational proof-of-concept demonstrating Bitcoin Proof-of-Work.
- PoW Simulator (offline): Brute-forces a nonce against a chosen compact target (
bits). - Regtest Miner (stub): Planned extension to connect with
bitcoindin regtest mode using RPC.
This project is strictly educational. CPU mining on Bitcoin mainnet is not feasible.
- Go 1.22 or higher
- (Optional, for regtest) Bitcoin Core 27+ (
bitcoind,bitcoin-cli)
go build ./...
go run ./cmd/powsim --max-nonces 50000000 --bits 1f0fffff --progress-every 2000000
--max-noncesMaximum attempts (default: 20000000)--bits Compacttarget in hex (default: 1f07ffff)--progress-everyPrint progress after N nonces (default: 4000000)
bitcoind -regtest -daemon
bitcoin-cli -regtest createwallet miner || true
bitcoin-cli -regtest -generate 101
- getblocktemplate
- block assembly (coinbase + merkle root)
- nonce loop and submitblock