Bitcoin Timelock - Discussion

Welcome to the discussion about this section. Here you can ask questions or post feedback about this specific lecture.

Hi Filip,

Could you provide a link where the special data structure (bitstructure) for relative time lock is specified?

Thx!!

A link to what, a transaction?

Hi I think you can see the specification for this here:
https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki#specification

That was clear explanation about nTimeLock vs Check Lock Time Verify. CLTV is a very clever way to solve the shortcomings of nTimeLock too

1 Like

Hi Filip!

Thanks for the courses, amazing work and very well structured!
I have a question:
Is it possible to combine CLTV (OP_CHECKLOCKTIMEVERIFY) with a Segwit transaction?
The course show the CLTV example with a PubKeyHash transaction so I was just curious to know if it possible to do it with a Segwit type transaction.

Thanks

1 Like

Thank you very much, I’m happy to hear you like it. Yes, that is absolutely possible. I think most people would do them within PayToWitnessScriptHash transactions. Basically a normal p2sh transaction but segwit enabled.

In that script you can embed any bitcoin logic you want, including CLTV.

2 Likes

Hi filip or other colleagues

One novice question,
You explained in 4 TimeLock Tx Part3 nSequence that “when nSequence started being used as relative time lock stamp for time lock, there was no need of forks(hard nor soft)” more or less.
Then I dont understand how nodes started recognizing nSequense as the new meaning.
It is something related to Script so that fork is not needed?

Hope my question is clear enough…
Yosuke

In nLocktime it is possible to double spend within the 1 year timeframe.

What about after the 1 year has passed In Check Lock Time Verify?

Can someone wait until the locking period is done and then double spend the tx before the holder claims it?

Hello,

Just wondering, what are some practical situations where nSequence txs are used?

Thank you.

They are mostly not used. I think the only way they are used for at the moment is to replace a transaction in the mempool with a higher fee.

1 Like

Hi @filip or team,

would it be possible for you to upload the presentations from the timelock videos?

Thank you!

Hi there, I failed the test, and when I checked what were the right answers … I think they are wrong (sorry if I understood very very bad … but I had to ask): @filip

I reaaaaaly think than when you taked about the frist two types of timelocks, you only spoke about Unix Epoch timestamps … and I reaaaaaaly think, than when you spoke about the last two of timelocks, you only spoke about block height … isnt the “correct answer” wrong?

And about the third one… it really made me wonder … because I thought it was a multiple choice question … and I think both of them are true. both my answer and the “correct” answer.

If Iḿ wrong, it means that I will have to watch all of these videos again

Yes the answers in the quiz are correct. You switched the first two.
The third question: nLockTime prevents a transaction from entering the block and CheckLockTimeVerify is an opcode that locks the output from being spent. :slight_smile:

2 Likes

Hey guys and girls,

In the check sequence verify video, it states that the n sequence must also be placed in the unlocking script to verify that the individual spending this output must provide a number that is Equal or less than the time it is locked for. But surely it would have to be Equal or more than the time locked? (Using 24 hours as standard lock time) As a way of stating that, yes 24 hours have passed (equal) or 72 hours have passed ( more than ).

Please could you clarify as i may just be confused

Thank you for these videos by the way i am learning so much!

Back again, i just watched the remainder of the video and realized you corrected yourself. you just accidentally said less than. No worries thank you again :smile:

2 Likes

I found this article helpful. sharing if anyone need help.

https://medium.com/summa-technology/bitcoins-time-locks-27e0c362d7a1

1 Like

@Alko89 hi, i have a question from this section quiz.

What are the main use cases for timelocked transactions in bitcoin? answer of this question dont consider smart contract ? don’t you think with atomic swap, lightening network, smart contract should also be included ?

please clarify…

Is there a question about main use cases in the quiz? You can use timelocks yourself if you want. Like for example if you have a 2-2 multisig address with a cofounder of a company where you both must sign, but in case of death, the lawyer can sign after a period of time instead of one of you. So the funds are not locked.

Not sure how many people do this, so I think timelocks on Bitcoin are most commonly used for Lightning today.

yes it was first question in quiz… So this mean one can use timelock in smart contract too. Thanks.