Timelock/Locktime is a feature of Bitcoin and other digital currencies that allows for transactions to be timed or locked until a certain date or block height. It can be used to create conditional payments, escrow services, trustless contracts, and more.
The timelock mechanism requires the sender of the transaction to specify either an absolute timestamp (a particular time in the future) or a relative locktime measured in blocks from the current block height. When this parameter is included in an output script, it will prevent miners from including that transaction into blocks until either condition has been met – meaning funds cannot be spent before then.
There are two types of timelocks: Checklocktimeverify (CLTV) and Checksequenceverify (CSV). CLTV is used when specifying an absolute timestamp while CSV is used when relying on a relative locktime; both require setting parameters with each transaction sent out. The main difference between them is that CSV also supports sequence numbers which allow users to make multiple transactions dependent on each other within specific order rules set by their wallet provider.
Using timelocks can help protect against double-spending attacks since they introduce delays before funds are available for spending again; however, there may still be risks involved if not implemented correctly as hackers could attempt to manipulate timing conditions somehow or try exploiting any bugs associated with the wallet software itself. Additionally, some wallets do not support this type of functionality yet so users should double-check compatibility with their service provider before attempting such transactions.