What is a timelock contract?
- Author
- CRYPTO PORT Editorial
- Published
- Updated
- Reading time
- 5 min
In short
A timelock forces an announced change to wait a fixed period before it can execute, giving users a window to examine it and withdraw if they dislike it. The protection is only as good as the delay: too short, and execution completes before anyone notices.
Key points
- Imposes a delay between announcing a change and executing it
- Gives users room to review and exit
- The length of the delay is the strength of the protection
- The side effect is slower response in emergencies
Definition
A contract that records an intended action as a queued proposal and refuses to execute it until a set period has elapsed, used to prevent abrupt changes by privileged parties.
Any system with administrative powers leaves the worry that a fee change or a contract swap could happen without warning. A timelock makes such an action be queued first and blocks execution until, say, forty-eight hours have passed.
The queued action is recorded on-chain for anyone to read. If a watcher points out that a proposed change would allow funds to be moved, users can withdraw before it executes. In effect, the mechanism buys time for the market to judge the change.
Choosing the delay involves a genuine trade-off. A longer wait strengthens the protection but equally slows the response when a real vulnerability appears. Some designs exempt an emergency pause from the timelock, but that exemption then becomes a new concentration of power.
Watch out for
- · A short delay means a change can execute before you notice and exit
- · Any power exempted from the timelock can still be used without warning
- · Queued actions are public, but nobody tells you — you have to look