Mining ALPHA — complete guide
SHA-256d proof-of-work. Rewards are defined by consensus — your software can never claim more than the protocol allows. CPU-only PoW; every miner below is a small Python script, no compile step.
Step 0 — Get the software
Everything is in the public repo — no binaries to trust, you run the audited Python source:
git clone https://github.com/alpha-chain-project/alpha-blockchain.git cd alpha-blockchain # requirements: Python 3.10+ — that's it, stdlib only
Or download single files: alphad.py (node) · mine_alpha.py (solo) · pool_miner.py (getwork pool) · stratum_miner.py (stratum) · alpha_cli.py (RPC wallet commands)
Step 1 — Run a node
# regtest (local, trivial difficulty — for learning/testing) python alphad.py --chain regtest --datadir data-regtest --rpcport 18499 --port 18444 --stratum --strataport 18435 # mainnet (public network — connect to seeds or the VPS node) python alphad.py --chain main --datadir data-mainnet
| Network | P2P port | RPC port | Stratum port | Status |
|---|---|---|---|---|
| regtest (yours) | 18444 | 18443 (yours: 18499) | 8335 (yours: 18435) | local |
| testnet (VPS) | 68.178.163.58:20333 | 127.0.0.1:20332 | 68.178.163.58:20335 | public |
| mainnet | 8333 | 8332 | 8335 | live |
RPC is localhost-only with cookie auth — miners on your own machine
just need the datadir/.cookie file. For remote stratum mining, only the stratum
TCP port is exposed.
Step 2 — Get a payout address
Open the wallet on this site and create a wallet — or run
python alpha_cli.py getnewaddress on your node. Addresses look like
alphart1… (regtest), alphat1… (testnet), alpha1… (mainnet).
How a mined block flows
Method A — Solo mining (recommended to start)
mine_alpha.py grinds nonces through your node's RPC and pays 100% of subsidy + fees to your address:
# regtest (your local node on :18499) python mine_alpha.py --rpcport 18499 --datadir data-regtest --address alphart1… # testnet via the public stratum is Method C — for a local testnet node: python mine_alpha.py --rpcport 18332 --datadir data-testnet --address alphat1… # mainnet (local node, default rpc :8332): python mine_alpha.py --address alpha1…
CPU control: --threads N (default 0 = auto, ~75% of cores so
your PC stays responsive), --maxtries N nonces per round, --timeout N
RPC timeout. Each thread grinds a unique coinbase extranonce — no duplicate work.
Method B — Pool mining (getwork / submitwork)
pool_miner.py
speaks the node's getwork/submitwork JSON-RPC. The node validates every
share independently and credits your address pro-rata when a block pays out:
python pool_miner.py --rpcport 18499 --datadir data-regtest --address alphart1… --threads 4
CPU control: --threads N (default auto ~75% of cores),
--batch N nonces per submit. Note: on regtest every share-nonce is also a block
solution, so shares mostly resolve as instant blocks — real share accounting shows on
higher-difficulty networks.
Method C — Stratum mining (external miners)
Start the stratum server on your node with --stratum, then either use our client
stratum_miner.py
or any standard stratum-compatible miner pointed at the port:
# 1) on the node host: python alphad.py --chain regtest --stratum --strataport 18435 ... # 2) our client — SOLO mode (block wins pay you 100%): python stratum_miner.py --host 127.0.0.1 --port 18435 --address alphart1… --threads 8 # POOL mode (shares earn pro-rata rewards): python stratum_miner.py --host 68.178.163.58 --port 20335 --address alphat1… --pool --threads 8 # mainnet stratum (solo — block wins pay your alpha1… address 100%): python stratum_miner.py --host 68.178.163.58 --port 8335 --address alpha1… --threads 8
Pool mode: authorize as <address>@pool — the server pushes
mining.set_difficulty as vardiff retunes your share target (~1 share / 5s per session,
adjusted every 30s). Set a stratum password via ALPHA_STRATUM_PASSWORD env var if
the node requires one.
Public testnet stratum: 68.178.163.58:20335 — point any stratum miner at it
with your alphat1… address. No RPC access needed.
Method D — Browser mining (zero install)
Proof-of-work in your browser tab via
getwork/submitwork. Best on regtest/testnet — mainnet
difficulty needs real miner software (see above).
Browser JS hashing is slow by design — honest demo of the full getwork→hash→submitwork→block pipeline. Every share and block is independently verified by the node; fake submissions are rejected.
Block reward rules
- Coinbase may pay at most subsidy + collected fees — verified by every node
- Excessive coinbase rewards → block rejected
- Subsidy follows the emission schedule; fees are separate
- Coinbase outputs mature after 100 blocks
Mining security guarantees
- Modified clients cannot inflate rewards — consensus re-checks everything
- Duplicate/fake shares are rejected at the pool layer
- Nonce grinding cannot exceed the 100-byte coinbase scriptSig limit
- Timestamp/difficulty manipulation is consensus-checked
- Share submissions are rate-limited; getwork is rate-limited per address