Back to blog list
Bitcoin
Timelocks
Liana

Published on Mon, Jan 19, 2026 by Kevin Loaec

Understanding Bitcoin Timelocks: Security Without the Wait

Liana timelocks aren't to lock coins. Instead, we lock recovery conditions.

Blog image cover
A class about Timelocks, and how we use them in Liana!

Understanding Bitcoin Timelocks: Security Without the Wait

At Liana, we talk about timelocks a lot. However, there is a common misconception that timelocking coins means you cannot touch your money for a set period. In reality, we do not lock your coins. We only lock their recovery options.

It is a subtle but important distinction. To understand why this matters for your security, we need to look at how Bitcoin timelocks actually work under the hood.

The Consensus Layer

Timelocks are enforced at Bitcoin’s consensus layer. This means that if a transaction has a timelock that has not expired yet, the transaction is considered invalid. It cannot be mined into a block, it cannot be relayed by the network, and nodes will simply reject it.

The important thing to remember is that the timelock lives inside the transaction, not the coin itself.

How Transactions Use Locks

A Bitcoin transaction contains specific fields used for locking logic:

  1. nLockTime: This is used for Absolute timelocks, which point to specific dates or block heights.
  2. nSequence: This is used for Relative timelocks, which measure the duration since a coin was originally mined or received.

If a transaction has multiple inputs and even just one of them has an unexpired nSequence timelock, the entire transaction is invalid.

The Problem With Raw Timelocks

Historically, timelocks were difficult to use for security because transactions that are not yet mined do not provide any real guarantees.

If I give you a timelocked transaction, that transaction is not yet on the blockchain. I could simply craft a new transaction using those same coins but without a timelock. If I broadcast the second version and it gets mined first, the timelocked version becomes useless. Because of this, raw transaction-level timelocks do not prevent someone from spending their own coins early.

The Solution: OP_CLTV and OP_CSV

To make timelocks useful for security, Bitcoin introduced two Opcodes: OP_CLTV (CheckLockTimeVerify) and OP_CSV (CheckSequenceVerify).

Instead of living in the transaction, these live inside the spending conditions of the coin itself. They enforce a rule: any future transaction attempting to spend this coin MUST use a specific timelock value. This prevents a spender from bypassing the lock by just creating a different transaction.

How Liana Changes the Game

This is where Liana’s approach differs from a simple “HODL” lock. We do not use timelocks to stop you from spending your money. Instead of a restriction like “you cannot spend for one year,” we use logic like “you can spend now, but a backup key also becomes active in one year.”

This approach is much more practical for real world use. It enables several powerful features:

  • Secure Recovery: Your backup keys only activate after a period of inactivity.
  • Inheritance: An heir’s key becomes valid if the wallet has not been touched for a long time.
  • Expanding Multisig: A 3-of-3 setup can “decay” into a 2-of-3 after six months to protect against a lost key.

In this context, timelocks are not for locking coins. They are for locking conditions.

A Brief History

Timelocks have existed since the beginning of Bitcoin. However, Satoshi did not originally put them in the consensus layer. This meant a miner could technically bypass the lock and include a transaction in a block anyway. This was fixed in November 2009. Since then, even miners cannot cheat the clock.

Absolute vs Relative

There are two main types of locks used today:

  • Absolute (CLTV): Tied to a specific time or block height. For example, “December 31, 2025.”
  • Relative (CSV): Tied to the age of the coin. For example, “90 days after this coin was received.”

Relative locks are especially important because they are the engine behind the Lightning Network and Liana’s recovery paths.

Can You Lock Someone Else’s Coins?

A common question is whether you can send someone “locked” coins. The answer is no. Spending scripts are created by the receiver’s wallet. Only the person receiving the Bitcoin can impose a timelock on themselves. When you see a Bitcoin address, you have no way of knowing if it has a lock condition. Only the owner knows the rules of their script.

The Future of Self-Custody

By combining these timelocks with Miniscript, we can create complex smart contracts on Bitcoin. You can set rules like: “I can spend anytime, but my lawyer can only spend if I am inactive for one year.”

Currently, Absolute timelocks can look ahead about 9,500 years, while Relative timelocks are limited to about 15 months. At Liana, we use Relative timelocks to manage inactivity, and we hope to see future soft forks increase that 15 month limit to several years.

Timelocks are becoming a standard for Bitcoin self-custody. They are not meant to lock you out of your own money, but to provide a digital safety net. If you want to explore how these recovery options can help you sleep better at night, you can try Liana at lianawallet.com.