Deep Source Audit

Block Processing & Reorganization Audit

This audit traces how the VirtaCoin source handles an incoming block: validation → proof-of-work → transactions → Merkle root → UTXO state → block index → most-work selection → disconnect/connect → active-chain update. The page separates source-verified behavior from measurements that still require a live network test.

01Receive
02Validate
03Index
04Choose Work
05Reorg
06Activate

Audit Matrix

VERIFIED IN SOURCE

Block size / structure

CheckBlock() rejects empty/oversized blocks and enforces MAX_BLOCK_SIZE serialization limits.

VERIFIED IN SOURCE

Proof-of-work

CheckBlock() validates the PoW hash against nBits; AcceptBlock() also requires the exact target from GetNextWorkRequired().

VERIFIED IN SOURCE

Timestamp rules

CheckBlock() rejects blocks more than 2 hours in the future; AcceptBlock() requires block time to be greater than the previous chain median-time-past.

VERIFIED IN SOURCE

Coinbase rules

The first transaction must be coinbase and later transactions must not be coinbase.

VERIFIED IN SOURCE

Transaction validation

Every transaction is passed through CheckTransaction(); duplicate transaction IDs are rejected.

VERIFIED IN SOURCE

Merkle-root validation

The block builds its Merkle tree and compares the computed root with hashMerkleRoot.

VERIFIED IN SOURCE

Signature-operation bound

CheckBlock() counts legacy signature operations and rejects blocks above MAX_BLOCK_SIGOPS.

VERIFIED IN SOURCE

Difficulty target

AcceptBlock() rejects nBits that do not equal GetNextWorkRequired(previous block, block).

VERIFIED IN SOURCE

Finality

AcceptBlock() checks IsFinalTx() for every transaction using the candidate height and block time.

VERIFIED IN SOURCE

Checkpoint / fork limits

AcceptBlock() applies checkpoint checks and rejects forks older than the last checkpoint.

VERIFIED IN SOURCE

UTXO connect

ConnectBlock() checks the prior UTXO view, validates inputs/scripts, fees and coinbase value, then advances the view best-block pointer.

VERIFIED IN SOURCE

Undo / disconnect

DisconnectBlock() reads undo data, reverses transactions, restores spent outputs and moves the UTXO best-block pointer to the previous block.

VERIFIED IN SOURCE

Most-work selection

CBlockIndexWorkComparator orders candidates by nChainWork; FindMostWorkChain() excludes candidates with failed ancestors.

VERIFIED IN SOURCE

Reorganization path

ActivateBestChain() disconnects active blocks no longer in the selected chain and connects the replacement chain.

VERIFIED IN SOURCE

Orphan block handling

Unknown-parent blocks are stored in orphan maps, pruned when necessary, and retried after their parent arrives.

EVIDENCE GAP

Live reorg observation

The source code path is verified, but this website has not performed a controlled live network-wide reorganization test.

EVIDENCE GAP

Network-wide reorg statistics

No independently verified current network-wide reorg frequency/depth dataset is available from the local bridge.

Interpretation Rule

Source verification shows that the client contains an explicit block-validation and reorganization path. It does not by itself prove current network behavior, current miner distribution, typical reorg depth, or real-world settlement reliability. Those require reproducible live-network measurements.