Validity range.

A slot interval during which a transaction is considered valid. Outside the window, the chain rejects it.

Think of it as

A "best between" date stamped on the transaction. Outside the window, the network throws it out.

In depth

Every Cardano transaction can carry a lower and upper bound on slots, `invalidBefore` and `invalidHereafter`. The transaction can only be included in a block whose slot is inside that range. Plutus scripts see this range in the script context as a POSIX-time interval (not the "current" slot, there isn't one inside a script) and use it to enforce time-based rules: vesting windows, auction deadlines, expiry timeouts.

Example

A vesting validator checks that the lower bound of the transaction's validity interval is at or after `unlockTime` (POSIX time). Since the ledger only accepts the transaction inside that interval, the unlock time has certainly passed.

Next on this path

  1. Script Context The full transaction visible to a validator: inputs, outputs, fees, signatories, time range.
  2. Validator A pure script that gates a UTxO. Returns pass or fail given Datum, Redeemer and Script Context.