Pow

From claude-dev-suite/claude-dev-suite · View interactive version

Pow is an AI agent skill from the GitHub repository claude-dev-suite/claude-dev-suite. Bitcoin Proof of Work: SHA256d on block header, target, nonce iteration, hashrate, mining math. USE WHEN: explaining mining mechanics, debugging mining software, designing mining-related apps.

How to use this skill

Skill file

Proof of Work

Bitcoin's consensus security: miners compete to find a nonce such

that SHA256d(block_header) ≤ target. The first to find one

broadcasts the block, claiming the subsidy + fees.

Block header (80 bytes)

[4 bytes]   version
[32 bytes]  prev_block hash
[32 bytes]  merkle_root (of all txs)
[4 bytes]   timestamp (unix seconds)
[4 bytes]   bits (compact target encoding)
[4 bytes]   nonce

Hash function: SHA256(SHA256(header)) (SHA256d).

Target & difficulty

bits encodes the target in compact form:

is mantissa.

difficulty = max_target / current_target. Higher difficulty =

harder.

Difficulty adjusts every 2016 blocks (~2 weeks):

Hashrate

Number of header hashes per second. Per-block expected time: 10 minutes

(protocol target, held by the retarget).

The figures below are a dated snapshot - they age fast, re-check a live

source before quoting them.

As of 15 September 2026 (mempool.space mining API):

5 September 2026 (block 965,664, +1.31%).

the 900-940 EH/s band through Q3 2026; the spot reading is a rolling

estimate and wandered from 967 to 981 EH/s within 15 September 2026.

on 25 October 2025; difficulty 155.97T on 29 October 2025

(block 921,312).

Live sources: getdifficulty / getnetworkhashps RPC, or

https://mempool.space/api/v1/mining/hashrate/1m.

Mining algorithm

def mine_block(header, target):
    while True:
        for nonce in range(2**32):
            header[76:80] = pack('<I', nonce)
            h = sha256(sha256(header))
            if h < target:
                return header
        # Exhausted nonce space; bump extra-nonce in coinbase, redo merkle
        bump_extra_nonce()
        recompute_merkle_root()

extranonce lives in the coinbase tx scriptSig, allowing many

2^32 nonce-space sweeps per block template.

Header search space (nonce rolling)

2^32 is only ~4.3 billion hashes; a 200 TH/s ASIC sweeps the whole

nonce field in ~21 microseconds. Miners therefore roll four fields,

cheapest first:

header-only.

consensus bounds (> median-time-past of the last 11 blocks,

<= network-adjusted time + 2h).

rebuilds the coinbase and the merkle root, so the controller and not

the hash core does the work.

Only the first three are headers-only mining: the device mutates the

80-byte header without touching transactions or merkle trees.

Standardization of the nVersion slice:

Stratum mining.configure negotiation and with it the

version-rolling extension, through which a pool advertises the

version mask a miner may roll.

for general use and removes them from BIP8/BIP9 signaling.

12 May 2026) replaces BIP 320 and reserves bits 5-28 (mask

0xe000001f, 24 bits). 16 bits proved too few; some devices had

started taking ~7 bits out of nTime instead, which distorts block

timestamps. Future soft forks SHOULD NOT signal on bits 5-28.

Core support, as of September 2026:

unknown-soft-fork warnings. Merged 3 June 2026, milestoned v32.0.

released nodes still warn on blocks that set those bits.

Subsidy / Halving

Block reward = subsidy + fees.

Subsidy halves every 210,000 blocks (~4 years):

Total supply asymptote: 21 million BTC.

Mining hardware

ASIC manufacturers: Bitmain (Antminer), MicroBT (Whatsminer),

Canaan (AvalonMiner), Bitfury, others.

Selfish mining attack

Theoretical attack where a miner with > 25% hashrate withholds

blocks to gain disproportionate share. Mitigated by random network

delays in practice.

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.