What is Nostr?
lianabitcoin / Liana Wallet
npub1ejk…expu
2025-04-22 12:24:51

lianabitcoin on Nostr: GM, nostr. Want to learn about timelocks? What is a #Bitcoin timelock and how can you ...

GM, nostr. Want to learn about timelocks?

What is a #Bitcoin timelock and how can you use it? 🧵

Do you feel like timelocks are only for shadowy super coders?
Do you wish you knew what a timelock was?
Do you want to make timelock magic with your bitcoins?

This thread's for you!



Timelocks have been in Bitcoin since the beginning, but over the years upgrades to Bitcoin made them a lot more powerful.

Today timelocks are used in
⚡️ Lightning
⚛️ Atomic swaps
⚖️ Fidelity bonds
🛟 Recovery keys
🔐️ Expanding multisigs
- and more

⏲️ So, what is a timelock?

Every bitcoin wallet has a set of instructions (spending conditions) for how its coins can be spent

Often these instructions are simple: provide a signature from a private key matching the wallet's pubkey...

Timelocks are just additional instructions you can apply to your coins. They prevent the coins from being spent before a specific time or blockheight (this is called an absolute timelock) or until a certain amount of time or blocks after you received the coins (this is called a relative timelock).

Being able to lock your coins this way is surprisingly useful. You've probably already used timelocks in some of your transactions without even knowing it.

Here's some examples:

⚡️ Lightning

- You and your channel partner share updates to the balance without putting them on chain
- Adding a timelock to the transaction lets you enforce a delay before a peer who force closes your channel can spend funds

⚛️ Atomic Swaps

- You swap some of your coins for someone else's on another chain (like liquid) or layer (like lightning)
- Adding a timelock lets you get your coins back if the other party doesn't fulfill their side of the swap

⚖️ Fidelity Bonds

- You participate in a join market coinjoin with several liquidity providers
- Adding a timelock lets you be sure the other party has skin in the game by letting you see that they've locked away real funds

💸 Lending Protocols

- You decide to take a loan on your bitcoin and send some btc to an address as collateral
- Adding timelocks to the recovery transaction allows you to recover your collateral if the lender ceases to exist

Things really get exciting when you combine timelocks with more complicated instructions. You can have one path of instructions for spending your coins that is timelocked and another path that is not.

In Liana, you can create spending conditions for your coins that look like this:

🔑️ A primary key can spend the coins anytime
⏰️ After a timelock expires
🔑️🔑️ Another key can also spend the coins

This is how we make a recovery key.

Or you can create spending conditions that look like this:

🔑️🔑️ 2 primary keys must sign to spend the coins
⏰️ After a timelock expires
🔑️🔑️ 2 additional keys can spend
🔓️ But still only 2 keys are required to spend

This is how we make an expanding multisig.

Liana uses timelocks that begin counting as soon as you receive coins in your wallet. These timelocks are currently limited to 65535 blocks (about ~15 months). But you can start the timer over by sending the coins to yourself.

We even have a button for that



Want to try out a wallet that lets you really use timelocks?

👉️ Check out Liana Wallet: wizardsardine.com/liana
👉️ For some extra help hit up our friends @BitcoinBrabant
Author Public Key
npub1ejkyx6hvrs0v9tj3ft0qhpjwxdasfnfsessu2rtnuzhtp4866u2s00expu