Need help with CLTV; I want to lock away bitcoins for 1 year
How does one actually write and broadcast a transaction with an CLTV script.
Step by Step instructions would help me a lot.
My goal is to send x.y amount of bitcoin to my address but with a lock of 1 year.
This is what I have come up:
1704666900 CHECKLOCKTIMEVERIFY DROP DUP HASH160 <ripemd160(my_address)> EQUALVERIFY CHECKSIG
The PowerShell line I use to calculate seconds since 1970:
((Get-Date).AddYears(1) - (Get-Date -Year 1970 -Month 1 -Day 1 -Hour 0 -Minute 0)).totalseconds
Where do I have to input my code if it were correct?If I have to compile it, how do I do that?When I have it compiled, where do I input the compiled code?
I didn't find any YouTube video to my surprise and the internet articles/wiki don't have step by step instructions on how to compile the code nor where to input the code.
Do I have to sign a message? Is there an app that allows me to do my usecase in an easy way?
I want to stop myself from spending a certain amount of bitcoin for 1 year on the blockchain.
How? Thank you!
- correct code formating
- Summary of useful links:
Important: The redeem script is needed as well. Even after the timelock expires a special transaction must be crafted to spend the bitcoins.