Skip to content
LogoLogo

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.

  1. lock_time ≤ h. If valid_until ≠ 0, then h ≤ valid_until (tx-expired).
  2. Every input's outpoint exists in the view (missing-inputs). Coinbase outputs require h − coin.height ≥ coinbase_maturity (100). Relative locks: for version ≥ 2, an input whose sequence has bit 31 clear needs h − coin.height ≥ sequence & 0xFFFF (tx-premature-relative).
  3. 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).
  4. Every output's lock schemes MUST allow new outputs at h (§8).
  5. Clawback inputs (§7.4) and freezes (§7.3) require the asset's control token to be spent in this transaction.
  6. Issuances and mints follow §7.
  7. Outputs of a non-ARRK asset to a frozen (asset, lock) are invalid (asset-frozen-recipient).
  8. Conservation: for every asset ≠ ARRK, inputs + issued + minted == outputs. Burn outputs count as outputs. For ARRK, inputs ≥ outputs; fee = inputs − outputs.
  9. fee ≥ asset_issuance_fee × #issuances.
  10. Signatures: every input not in clawbacks satisfies 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.