6. Contextual transaction validation (check_tx_inputs)
Evaluated against a UTXO view at height h, the height of the block that would include the
transaction. The mempool uses exactly the same function with h = tip + 1.
lock_time ≤ h. Ifvalid_until ≠ 0, thenh ≤ valid_until(tx-expired).- Every input's outpoint exists in the view (
missing-inputs). Coinbase outputs requireh − coin.height ≥ coinbase_maturity(100). Relative locks: forversion ≥ 2, an input whose sequence has bit 31 clear needsh − coin.height ≥ sequence & 0xFFFF(tx-premature-relative). - For every input not listed in
clawbacks:- its lock's schemes MUST allow spends at
h(§8); - if its asset is not ARRK,
(asset, lock)MUST NOT be frozen (asset-frozen).
- its lock's schemes MUST allow spends at
- Every output's lock schemes MUST allow new outputs at
h(§8). - Clawback inputs (§7.4) and freezes (§7.3) require the asset's control token to be spent in this transaction.
- Issuances and mints follow §7.
- Outputs of a non-ARRK asset to a frozen
(asset, lock)are invalid (asset-frozen-recipient). - Conservation: for every asset ≠ ARRK,
inputs + issued + minted == outputs. Burn outputs count as outputs. For ARRK,inputs ≥ outputs;fee = inputs − outputs. fee ≥ asset_issuance_fee × #issuances.- Signatures: every input not in
clawbackssatisfies its lock (§4) for the sighash below. POLICY locks are evaluated with the transaction's lock_time, version and the input's sequence.
6.4 Signature hash
sighash(i) = TH("sighash", magic(4) ‖ txid ‖ u32(i) ‖ TH("spent-outputs", Σ spent_output_i))
spent_output = asset_id 32 ‖ amount u64 ‖ lock
The sighash commits to the network, the whole transaction (through the txid), the input position, and the asset, amount and lock of every spent output. That prevents cross-network, cross-input and cross-asset replay, and lets offline signers verify exactly what they sign.