Glossary · deep dive

Timelock

A rule that prevents coins from being spent before a certain block height or time.

A timelock prevents a transaction or output from being spent until a certain time. Bitcoin has two kinds.

  • Absolute: "not before block 900,000" or "not before 1 Jan 2030". Set with nLockTime on a transaction, or enforced in a script with OP_CHECKLOCKTIMEVERIFY (BIP65).
  • Relative: "not until 144 blocks after the coin was confirmed". Set with nSequence (BIP68), or enforced with OP_CHECKSEQUENCEVERIFY (BIP112).

Timelocks make inheritance plans, vaults, and payment channels possible, because they give a counterparty a deadline to act.