DEEP SOURCE AUDIT

Transaction Maturity + Coinbase + UTXO / Double-Spend Audit

This audit follows how VTA treats coinbase maturity, transaction structure, UTXO availability, mempool conflicts and input/script validation. The diagram below is an inline SVG so the validation path is visible on desktop and mobile.

Transaction vin / vout basic checks CheckTransaction duplicates / values coinbase rules UTXO View HaveCoins HaveInputs Conflict Gate same outpoint? mempool mapNextTx CheckInputs scripts / signatures consensus validation Accept mempool / block UTXO transition Coinbase path COINBASE_MATURITY = 8 • spend only after maturity depth

Audit Matrix

VERIFIED IN SOURCE

Coinbase maturity = 8

main.h defines COINBASE_MATURITY = 8.

VERIFIED IN SOURCE

Maturity depth calculation

CMerkleTx::GetBlocksToMaturity() uses (COINBASE_MATURITY + 1) minus main-chain depth, bounded at zero.

VERIFIED IN SOURCE

Coinbase-only maturity rule

The maturity calculation is applied only when the transaction is coinbase; normal transactions return zero blocks-to-maturity.

VERIFIED IN SOURCE

Coinbase script size

CheckTransaction() requires the coinbase scriptSig to be 2–100 bytes.

VERIFIED IN SOURCE

Null prevout restriction

Non-coinbase inputs with a null prevout are rejected.

VERIFIED IN SOURCE

Duplicate-input rejection

CheckTransaction() tracks COutPoint values and rejects duplicate inputs.

VERIFIED IN SOURCE

Missing/spent input detection

AcceptToMemoryPool() uses the coin view and HaveInputs(tx); already-spent inputs are rejected.

VERIFIED IN SOURCE

Mempool conflict detection

pool.mapNextTx is checked for an existing transaction spending the same outpoint; replacement is disabled in this path.

VERIFIED IN SOURCE

Input/output value checks

The transaction path calculates input and output values and rejects transactions that fail input/script validation before mempool admission.

VERIFIED IN SOURCE

Script/signature validation

CheckInputs() is invoked after the cheaper checks, with P2SH and strict-encoding script flags.

VERIFIED IN SOURCE

Coinbase excluded from mempool

AcceptToMemoryPool() explicitly rejects a coinbase transaction as an individual transaction.

VERIFIED IN SOURCE

Main-chain depth verification

CMerkleTx checks that its block index entry exists and is contained in chainActive before returning confirmation depth.

EVIDENCE GAP

Controlled double-spend experiment

The source path is verified, but this site has not run a controlled conflicting-transaction experiment against a live VTA network.

EVIDENCE GAP

Network-wide maturity observation

The 8-block rule is source-verified; no current network-wide dataset is used to claim observed maturity timing.

Coinbase Maturity — Exact VTA Rule

COINBASE_MATURITY = 8. The VTA source defines this network rule in main.h. GetBlocksToMaturity() returns max(0, (COINBASE_MATURITY+1) - GetDepthInMainChain()) for coinbase transactions. This is a source-level rule; it should not be converted into a claim about current network activity.

Latest Recorded Local Snapshot

No local snapshot available. The source audit remains available independently.

Primary Source Evidence

VTA main.h defines the 8-block coinbase maturity rule. main.cpp verifies transaction structure, rejects duplicate inputs, excludes coinbase from the mempool, checks missing/spent inputs through the coin view, detects mempool outpoint conflicts, and invokes CheckInputs() for script/signature validation.

VTA main.cpp source
VTA main.h source

Interpretation Rule

The source proves that these validation gates exist in the inspected code. It does not by itself prove that a live network has never experienced a double-spend, nor does it provide a current network-wide double-spend rate. Those require controlled or independently observed network evidence.