Skip to content

Latest commit

 

History

History
119 lines (100 loc) · 6.48 KB

File metadata and controls

119 lines (100 loc) · 6.48 KB

Block Zero Implementation Status

This is the honest, current state of the Block Zero core implementation. It is updated as real, verified progress lands. It describes what is built, not plans.

Source: blockzero-core (fork of Bitcoin Core v31.0).

Done and verified

Fork baseline

  • Forked Bitcoin Core v31.0 (full git history preserved).
  • Upstream pinned and tracked for security backports (see blockzero-core/UPSTREAM.md).
  • Builds cleanly on Linux (WSL Ubuntu 22.04, CMake) and passes a regtest smoke test.

RandomX proof-of-work (CPU-friendly, ASIC-resistant)

  • Vendored tevador/RandomX v2.0 (BSD-3-Clause) as a pinned submodule (src/randomx).
  • Wired into the CMake build (librandomx.a linked into the node and kernel).
  • New module src/pow_randomx.{h,cpp}: thread-safe, light-mode VM cache keyed by the RandomX key; computes the PoW hash of an 80-byte header.
  • pow.cpp: GetBlockPoWHash() plus a CBlockHeader-based CheckProofOfWork overload. Block identity hash stays double-SHA256; only PoW validity uses RandomX.
  • Enforcement switched to RandomX in validation, block storage and mining.
  • Reproducible genesis miner tool: bz-genesis-miner.
  • RPC mining (generatetoaddress / generateblock) uses multi-threaded RandomX grinding in GenerateBlock (same light-mode path as the genesis miner).

Chain identity (separated from Bitcoin)

  • Network magic: mainnet b10c00a0, testnet b10c7445, regtest b10c5247.
  • P2P ports: 8210 / 18210 / 18212. RPC ports: 8211 / 18211 / 18213.
  • Bech32 HRP: bz / tbz / bzrt. Base58 prefixes set; Bitcoin seeds cleared.
  • Mainnet ticker: BLOZ (100,000,000 sat per BLOZ). Testnet/regtest: TBLOZ / tsat.

Seed key rotation (height-based, ASIC resistance)

  • The RandomX seed key rotates by height (Monero scheme): epoch length + lag, key = a past block hash, not miner-selectable. Below the first epoch the deterministic bootstrap key is used.
  • Per-network epoch params: mainnet/testnet 2048/64, regtest 16/2 (fast testing).
  • Authoritative PoW check is height-aware in ContextualCheckBlockHeader; context-free checks validate only the nBits target range. TestBlockValidity skips the PoW check for unmined templates via an fCheckPOW flag.
  • Verified on regtest: 26 blocks mined and accepted across an epoch boundary (mining and validation agree on the rotated key).

Genesis blocks (all networks, RandomX)

  • Distinct Block Zero genesis blocks mined under RandomX for mainnet, testnet and regtest (reproducible via the multi-threaded bz-genesis-miner).
  • RandomX-appropriate difficulty floor: powLimit set to nBits 0x1f00ffff for mainnet/testnet (regtest 0x207fffff).
  • Bitcoin-specific nMinimumChainWork and defaultAssumeValid zeroed for a fresh chain.
  • Verified: mainnet and testnet nodes both boot on their new genesis; regtest mines end-to-end under RandomX.

End-to-end (verified)

  • Regtest: node starts on the Block Zero genesis, enforces RandomX PoW, mines via -generate, wallet yields bzrt... addresses, seed rotation works across an epoch.
  • Testnet/Mainnet: nodes boot on their genesis (chain reports test/main, height 0).
  • VPS seed (217.160.46.61) runs mainnet (port 8210) and testnet (port 18210).

Testnet genesis (2026-06-04)

  • Satoshi-style message: The Times 04/Jun/2026 Block Zero - a second chance at Genesis
  • nTime = 1780531200 (2026-06-04 UTC), nonce 244191. Mainnet genesis separate/unchanged.
  • Genesis hash: 7462293eec16a92c54a74362af6825688135e2955250024dcc3668ff4f55cfce
  • Verified: node boots on this genesis (UpdateTip new best=...4f55cfce height=0 date=2026-06-04).
  • Tooling: scripts/genesis/mine-testnet-genesis.ps1 + apply-testnet-genesis.ps1.
  • See blockzero-docs/testnet-reset.md for VPS + miner reset steps.

Difficulty floor and genesis (v1 testnet, superseded)

  • powLimit set to a safe floor 0x1e3fffff and the retarget window shortened to 12 hours (72 blocks, nPowTargetTimespan = 12*60*60). This keeps the difficulty math well within 256 bits (powLimit * 4 * timespan stays below 2^256) and is a good fit for a fair-launch CPU chain (faster response to early hashrate swings).
  • Mainnet (nonce 425526) and testnet (nonce 175029) genesis re-mined under RandomX via the multi-threaded bz-genesis-miner. Both nodes boot on their genesis.
  • ChainParams_*_sanity pass; the historical difficulty-retarget unit tests are decoupled via a local Bitcoin-like consensus and pass. New RandomX PoW determinism and seed-key rotation unit tests pass.

RandomX performance note (environment, not a bug)

  • In WSL2 the RandomX hashrate is low (~50 H/s/thread fast mode, ~135 H/s/thread light mode) even with JIT + huge pages, because the VM's memory access is heavily penalized under the WSL2/Hyper-V memory subsystem. On bare-metal Linux/Windows the same code reaches ~1000+ H/s/thread.
  • Impact is limited: node block verification is one hash per block (~7 ms, fine everywhere). Only bulk mining is slow in WSL2. Real miners run bare metal or optimized miners. Genesis mining used light mode (faster in WSL2) at a feasible floor.

Mainnet launch (2026-06-06)

  • Launched at 2026-06-06 06:06:06 UTC (nTime 1780725966).
  • Genesis hash: 44c1a8c852b3eda21966e1ddb6b0807e22488dffe8a270bf24bf1fa2d66c13bd
  • Public mainnet seed live on VPS 217.160.46.61:8210 (systemd, always-on).
  • Mainnet block explorer at explorer.bloz.org.
  • One-click mainnet mining scripts in blockzero-ops/scripts/mainnet/.

Public infrastructure (live)

  • Mainnet seed + explorer (BLOZ).
  • Testnet seed + explorer (TBLOZ) at 217.160.46.61:18210 / texplorer.bloz.org.
  • Release binaries published on GitHub Releases.
  • Mining guides and runbooks updated for mainnet.

Not done yet (known gaps)

Difficulty calibration

  • Difficulty adjustment is still upstream behavior. Ongoing observation on the live mainnet for low-hashrate stability (avoid stalls and swings).

Future work

  • DNS seeds and monitoring dashboards.
  • Signed Windows installer, dedicated blockzero-miner with hashrate display.
  • Expand functional/unit test coverage (e.g. a regtest functional test that mines across a seed-rotation epoch boundary).

Build and test (WSL Ubuntu)

cmake -B build -DBUILD_GUI=OFF -DBUILD_TESTS=ON -DENABLE_IPC=OFF
cmake --build build -j <cores>
./build/bin/bitcoind -regtest -datadir=/tmp/bz -listen=0 -rpcport=19777 -daemon
./build/bin/bitcoin-cli -regtest -datadir=/tmp/bz -rpcport=19777 -generate 1