Nockchain evidence

Mining and PoW provenance

Nockchain Mining/PoW Source Trace

Source anchors for fakenet miner commands, mining public-key-hash configuration, candidate block refresh, miner-kernel proof checks, fakenet difficulty controls, structured miner traces, and network PoW separation.

Commit
33ba97b1e206
Anchors
15
Capabilities
9
Modes
3

Source Anchors

fakenet-miner-script

file

scripts/run_nockchain_miner_fakenet.sh

symbols

MINING_PKH, --mine, --fakenet, --mining-pkh, --peer, --no-default-peers

lineRange

1-6

Defines the upstream fakenet miner command source: load .env, export MINING_PKH, mine against a local fakenet peer, and suppress default peers.

The script runs nockchain with --mine --fakenet --mining-pkh ${MINING_PKH}, dials /ip4/127.0.0.1/udp/3006/quic-v1, and uses --no-default-peers.

node-fakenet-script

file

scripts/run_nockchain_node_fakenet.sh

symbols

MINING_PKH, --fakenet, --bind-public-grpc-addr, --bind

lineRange

1-6

Defines the local fakenet hub side that binds QUIC and public gRPC for local miner and wallet/API testing.

The node script binds public gRPC to 127.0.0.1:5555 and QUIC to /ip4/127.0.0.1/udp/3006/quic-v1 while running --fakenet.

mainnet-miner-script

file

scripts/run_nockchain_miner.sh

symbols

MINING_PKH, get_cpu_count, --mine, --num-threads

lineRange

1-28

Defines upstream operator command shape for non-fakenet mining and automatic CPU-thread selection.

The script exports MINING_PKH, computes logical CPU count, subtracts two threads with a minimum of one, and runs nockchain --mine --num-threads.

mining-cli-flags

file

crates/nockchain/src/config.rs

symbols

mine, mining_pkh, mining_pkh_adv, num_threads, fakenet_pow_len, fakenet_log_difficulty

lineRange

121-194

Declares the operator-facing mining and fakenet PoW flags that receipts must capture before interpreting mining results.

Mining requires --mine with --mining-pkh or --mining-pkh-adv, supports --num-threads, and exposes fakenet-only PoW length and log difficulty overrides.

fakenet-constants-poke

file

crates/nockchain/src/lib.rs

symbols

fakenet_blockchain_constants, PokeFakenetConstants, with_asert_phase

lineRange

416-440

Pokes fakenet blockchain constants into the kernel before fakenet operation and applies optional v1/bythos/ASERT/candidate interval overrides.

The fakenet boot path constructs fakenet_blockchain_constants from CLI PoW length/log difficulty, applies phase overrides, and sends PokeFakenetConstants.

fakenet-blockchain-constants

file

crates/nockchain-types/src/blockchain_constants.rs

symbols

DEFAULT_FAKENET_POW_LEN, DEFAULT_FAKENET_LOG_DIFFICULTY, fakenet_blockchain_constants, with_genesis_target_atom_bex, with_pow_len

lineRange

510-526

Defines relaxed fakenet mining constants derived from mainnet defaults for local testing.

Fakenet overrides update candidate interval, PoW length, genesis target by bex difficulty, first-month coinbase minimum, timelock minimum, base fee, and early phases.

mining-driver-bootstrap

file

crates/nockchain/src/lib.rs

symbols

MiningPkhConfig, create_mining_driver, add_io_driver

lineRange

481-512

Installs the mining driver with parsed public-key-hash target, mine flag, and thread count before libp2p and gRPC drivers.

The node translates --mining-pkh into share=1 PKH config, derives mine/threads, creates the mining driver, and adds it to the NockApp.

mining-wire-contract

file

crates/nockchain/src/mining.rs

symbols

MiningWire, MiningWire::Mined, MiningWire::Candidate, MiningWire::SetPubKey, MiningWire::Enable

lineRange

24-50

Names the typed mining wire tags used for key setup, enablement, candidate work, and mined-block submission.

MiningWire maps SetPubKey to setpubkey, Enable to enable, Candidate to candidate, and Mined to mined under wire source miner version 1.

candidate-effect-handler

file

crates/nockchain/src/mining.rs

symbols

mine, MiningData, pow_len, start_mining_attempt

lineRange

290-378

Receives kernel %mine effects, captures version/header/target/pow_len, starts mining threads, and cancels stale attempts when a new candidate arrives.

The driver accepts a %mine effect payload, stores block_header/version/target/pow_len, starts SerfThread miners, and cancels old attempts when the candidate changes.

mined-pow-poke

file

crates/nockchain/src/mining.rs

symbols

create_poke, set-mining-key-advanced, enable-mining, start_mining_attempt

lineRange

386-525

Constructs candidate proof pokes, sets mining keys, enables mining, creates random nonce cells, and submits mined PoW back to the main kernel.

The driver builds [version header nonce target pow_len], sends set-mining-key-advanced and enable-mining commands, then pokes MiningWire::Candidate on each mining attempt.

miner-kernel-pow-check

file

hoon/apps/dumbnet/miner.hoon

symbols

prove-block-inner, check-target:mine, %mine-result, %command %pow

lineRange

38-60

Runs the miner kernel proof attempt and emits either success with command %pow or retry with the digest.

The miner kernel builds prover input, calls prove-block-inner, checks proof hash against target, and returns %mine-result with success/failure.

pow-library

file

hoon/common/pow.hoon

symbols

check-target, prove-block-inner, proof-to-pow

lineRange

5-27

Defines the common PoW target check and proof-to-pow digest conversion used by the miner kernel.

check-target compares proof hash to target atom, and prove-block-inner dispatches proof versions 0/1/2 before converting proof to PoW.

candidate-block-state

file

hoon/apps/dumbnet/lib/miner.hoon

symbols

update-candidate-block, candidate-block, add-txs-to-candidate

lineRange

86-113

Refreshes candidate block timestamp and transaction set when the candidate update interval is reached.

The miner library updates candidate block timestamp, logs the change, and adds transactions to the candidate block.

structured-miner-traces

file

crates/nockchain/src/traces.rs

symbols

new_heaviest_chain, new_heaviest_miner, block_height, heaviest_block_digest

lineRange

1-17,76-110

Translates miner and heaviest-chain kernel spans into stdout-visible structured events used by monitoring and tests.

The traces driver records new_heaviest_chain and new_heaviest_miner with block height and digest fields.

libp2p-request-pow-separation

file

crates/nockchain-libp2p-io/src/messages.rs

symbols

gen2_pow_preimage, gossip_pow_preimage, solve_pow, verify_pow, AuthenticatedGossip

lineRange

807-1130

Separates network request/gossip EquiX anti-spam PoW from block-mining PoW so diagnostics do not conflate the two.

Libp2p request PoW uses sender/receiver/message preimages, verifies inbound request PoW, and authenticates gossip independently of miner candidate proof.

Mining Capabilities

operator-fakenet-miner-command

Operator fakenet miner command

Use the upstream fakenet scripts as command authority before deciding whether a local miner is pointed at the expected hub.

sourceAnchorIds

fakenet-miner-script, node-fakenet-script

receiptFields

minerCommand, networkMode, peerMultiaddr, noDefaultPeers

fakenet-difficulty-controls

Fakenet difficulty controls

Fakenet mining can be intentionally easy; receipts need the exact PoW length/log difficulty before comparing mining rates.

sourceAnchorIds

mining-cli-flags, fakenet-constants-poke, fakenet-blockchain-constants

receiptFields

fakenetPowLen, fakenetLogDifficulty, targetBex, candidateUpdateInterval

proof-kernel-validation

Proof kernel validation

Block mining evidence is anchored in the miner Hoon kernel and common PoW target check, not in libp2p request PoW.

sourceAnchorIds

miner-kernel-pow-check, pow-library

receiptFields

candidateHeader, candidateTarget, candidatePowLen, minedBlockDigest

network-pow-separation

Network PoW separation

Libp2p EquiX request/gossip PoW protects network messages; it is distinct from block-mining proof and should be diagnosed separately.

sourceAnchorIds

libp2p-request-pow-separation

receiptFields

networkPowVerified, connectedPeerCount, routeTableSize

Receipt Contract

nockchainCommit
nockchainBuild
networkMode
minerCommand
miningPkh
mineFlag
fakenetPowLen
fakenetLogDifficulty
fakenetAsertPhase
peerMultiaddr
noDefaultPeers
numThreads
candidateHeader
candidateTarget
candidatePowLen
nonceDigest
minedBlockDigest
heaviestMinerHeight
heaviestChainDigest
syncMode
routeTableSize
connectedPeerCount
gossipSuppressedBehindTipTotal
networkPowVerified
observedAt
verificationStatus
highlightedField

miningPkh

highlightedField

fakenetPowLen

highlightedField

candidatePowLen

interpretationRule

A running miner is not proof that a candidate block has been accepted.

interpretationRule

A found miner-kernel proof must still be poked into the main kernel and observed in heaviest-miner or heaviest-chain traces.

interpretationRule

Fakenet PoW length and log difficulty intentionally differ from mainnet defaults and must be recorded.

interpretationRule

Libp2p request/gossip EquiX PoW is separate from block-mining proof.

Operational Modes

highlightedMode

local-fakenet-hub

highlightedMode

local-fakenet-miner

highlightedMode

mainnet-miner

local-fakenet-hub

Local fakenet hub

commandSource

scripts/run_nockchain_node_fakenet.sh

expectedSignals

public gRPC bound to 127.0.0.1:5555, QUIC bound to UDP 3006

Record hub bind address, public API endpoint, fakenet constants, and genesis/state provenance before attaching miner evidence.

local-fakenet-miner

Local fakenet miner

commandSource

scripts/run_nockchain_miner_fakenet.sh

expectedSignals

--mine, --fakenet, --mining-pkh, --peer 127.0.0.1:3006

Record peer multiaddr, MINING_PKH, fakenet difficulty, sync mode, and whether default peers were disabled.

mainnet-miner

Mainnet miner

commandSource

scripts/run_nockchain_miner.sh

expectedSignals

--mine, --mining-pkh, --num-threads

Record thread count, build/release, public key hash target, and chain/network context before interpreting miner output.

Diagnostic Scenarios

highlightedDiagnostic

wrong-block-commitment

highlightedDiagnostic

empty-routing-table

wrong-block-commitment

Miner reports work for the wrong block commitment or stale candidate header.

requiredReceiptFields

candidateHeader, heaviestChainDigest, syncMode, candidateChanged

Compare candidateHeader and heaviestChainDigest, then restart or wait for a fresh %mine effect if the miner is still working on stale candidate data.

empty-routing-table

Routing table is empty and connected peers are zero while fakenet miner output is quiet.

requiredReceiptFields

peerMultiaddr, connectedPeerCount, routeTableSize, noDefaultPeers

Check that the hub is bound on /ip4/127.0.0.1/udp/3006/quic-v1, the miner uses the same peer, and --no-default-peers is intentional.

mining-starts-before-candidate

Mining process is running but no threads start because no %mine candidate effect has arrived.

requiredReceiptFields

mineFlag, miningPkh, candidateHeader, candidatePowLen

Wait for or debug the candidate effect path before treating lack of mined blocks as a proof performance issue.

network-pow-confused-with-block-pow

A libp2p request PoW failure is mistaken for a block-mining proof failure.

requiredReceiptFields

networkPowVerified, requestMethod, minedBlockDigest, verificationStatus

Separate network request/gossip EquiX verification from block candidate proof checks before updating mining assumptions.

Local Verification

status

source-inspected

inspectedSourceCommit

33ba97b1e206dd89b15c61b72b7802caf2136c18

highlightedCommand

cargo check -p nockchain

highlightedCommand

cargo check -p kernels-open-miner

command

cargo check -p nockchain

command

cargo check -p kernels-open-miner

command

cargo test -p nockchain-libp2p-io req_res_pow

command

cargo test -p nockchain open_prover_bench --test open_prover_bench --release

symbol

MiningWire::Candidate

symbol

set-mining-key-advanced

symbol

enable-mining

symbol

check-target:mine

symbol

new_heaviest_miner

Forbidden Evidence

forbiddenField

rawMinerJam

forbiddenField

rawCandidateNoun

forbiddenField

rawPowProof

forbiddenField

rawNonce

forbiddenField

rawPmaSlab

forbiddenField

rawEventLog

forbiddenField

rawStateJam

forbiddenField

rawTransaction

forbiddenField

walletSeedPhrase

forbiddenField

walletPrivateKey

forbiddenField

privateSpendKey

forbiddenField

privateGrpcPokePayload

highlightedForbidden

rawMinerJam

highlightedForbidden

rawPowProof

highlightedForbidden

walletSeedPhrase