2 things to have in mind
A. since this is for testing, all the values are generated using different "websites" which you see their links below, keep in mind that for security reasons you must never do this. instead download all the respective sources and run them offline on a clean system.
B. coinb.in has a hard time with testnet apparently so some workarounds were used here. it should work fine for mainnet but you may want to test it yourself to make sure.
i am posting all these values so that you can test any tool that you may find in the future (coinb.in, using bitcoin core to sign, using Electrum or any other wallet, tool, code,...). you can double check to see if you can get the exact values. the only thing that could change is the transaction locktime as new blocks are found and block height grows.
1. creating a new key pair1.1. we use bitaddress.org. setting it to testnet by adding ?testnet=true to the end
link private key:
cVVeRq1oaneL6ELYBXZfkuT3YJSeFB7g8rpRexYKKNDQhqPxkuHT
public key:
0387CBC334A467FB592BD6E467EA21D34B7226BE38841469EF83424D8BE2B76E5A
2. creating the time lock address using coinb.in2.1. setting it to testnet by going to settings page
https://coinb.in/#settings set network to bitcoin(testnet) and click submit
2.2. go to
https://coinb.in/#newTimeLocked and fill in the fielts
pubkey (same as above)
time 11/28/2019 10:00
click submit.
address:
2NAbY2bwun4YxmHTx7S2BbWTbKNAL1ZsdjE
redeem script:
046869df5db175210387cbc334a467fb592bd6e467ea21d34b7226be38841469ef83424d8be2b76e5aac
3. send coins to that address:the faucet used (found using google)
https://bitcoinfaucet.uo1.net/send.phpsee history here:
https://live.blockcypher.com/btc-testnet/address/2NAbY2bwun4YxmHTx7S2BbWTbKNAL1ZsdjE/4. spend the coins (donate back to the faucet itself)using
https://coinb.in/#newTransaction (sadly the load button is disabled! probably because they don't have a testnet API to fetch UTXOs!) we have to mimic the operation ourselves...
assuming it works correctly with mainnet then all you have to do is enter your (important:) Redeem Script in the first box not your address. and click load.
if it didn't work automatically for mainnet then just follow these steps:
first entering inputs:
transaction ID: 18bea5112a442926ab171d7082ef76fbf654300f6819643699039a67ed274a1f
n (my address was the second one in txouts of above tx which means index is one) = 1
script: IMPORTANT: the same redeemscript as above not the pubkeyscript of the transaction.
amount: 0.00022
now outputs:
address: 2NGZrVvZG92qGYqzTLjCAewvPZ7JE8S8VxE (faucet address)
amount: 0.00021 (pay attention to fee)
result:
0100000001692fe9564b4b17d580bb797b5ad5e1ccccffc7fb6b2f5aae4518744af1a1cf4b0100000017a914cd145d38914f7cdd4ae2f6df4b50f9976a42778e87ffffffff01583e0f00000000001976a914344a0f48ca150ec2b903817660b9b68b13a6702688ac00000000
now before we sign it, there are a couple of problems with this transaction. according to
BIP-65:
- locktime of this tx needs to be of the same type as the locktime of the redeemscript (time here) so we set it to a new value that is also bigger the previous one (1574922600 + 1)
- also the sequence of the input must not be max so we change that too (0xffffffff -=1)
the edited version is this:
01000000011f4a27ed679a0399366419680f3054f6fb76ef82701d17ab2629442a11a5be180100000017a914be51843ee8b9fd148987833e53342466be38100387feffffff01085200000000000017a914ffd0dbb44402d5f8f12d9ba5b484a2c1bb47da42876969df5d
(note that coinb.in should probably take care of all this if you use mainnet and it creates the tx for you, if it doesn't then maybe you should re-think using OP_CLV unless you find another easy to use tool)
5. signinghttps://coinb.in/#sign- enter the private key from first step in first box
- enter the edited raw tx above in second box
- and click sign
result:
01000000011f4a27ed679a0399366419680f3054f6fb76ef82701d17ab2629442a11a5be180100000073473044022066c49835065ce39c59e60335b02c22250c06388040d9f2d3203e73d4935edb5702200f31da26d187ee19c3521f903b7abd55dbea83d276852e4ef7d2c3a5b5279328012a046869df5db175210387cbc334a467fb592bd6e467ea21d34b7226be38841469ef83424d8be2b76e5aacfeffffff01085200000000000017a914ffd0dbb44402d5f8f12d9ba5b484a2c1bb47da42876969df5d
6. broadcasthttps://coinb.in/#broadcastagain this site doesn't have broadcast for testnet so as workaround i used Electrum with --testnet option but you could use a block explorer like
https://live.blockcypher.com/btc-testnet/pushtx/ too
...and we are done:
https://live.blockcypher.com/btc-testnet/tx/5a8671cf995be0b1f7d206459549003663e265545b45023ffbda9058ebcf6742/
conclusion:as you can see if you have some understanding of bitcoin transactions and scripts you can figure out a way to use this. it took me about 1.5 hours to create this post and i ended up writing some code myself to create and sign the transaction first and then try to make coinb.in to work!!!
so maybe it is best that you don't use this feature if it is not that important to lock coins until a proper wallet like bitcoin core or Electrum implements this feature for easy usage.