Author

Topic: Time locked transactions (Read 353 times)

legendary
Activity: 1792
Merit: 1283
June 05, 2018, 03:52:57 PM
#11
Can anyone tell me how to unlock the transection in between?


You mean unlock it before the timelock has expired?
I'm afraid that's not possible, unless you've accidentally made a mistake while creating the timelock.

This is what Achow mentioned on my other thread:

Quote
A transaction with a timelock means that the transaction itself cannot confirm before the timelock (either a block height or a timestamp). However a conflicting transaction (one that spends the same inputs) could be created and that transaction can still confirm.

In order to make coins that are unspendable until after a certain time or block height, you will need to create an address that uses OP_CHECKLOCKTIMEVERIFY. Only coins sent to such an address are guaranteed to be only spendable after a certain time.

Source: https://bitcointalksearch.org/topic/m.24712001
newbie
Activity: 11
Merit: 0
June 05, 2018, 03:49:51 PM
#10
Can anyone tell me how to unlock the transection in between?
legendary
Activity: 1792
Merit: 1283
June 05, 2018, 01:42:59 PM
#9

I've also asked a similar question before on this forum and got a really amazing reply.
Easy step-by-step instructions to create a time-locked transaction.

https://bitcointalksearch.org/topic/m.24710770



For a set-by-step guide with picture, you can visit https://steemit.com/bitcoin/@daan/how-to-create-time-locked-transactions-with-bitcoin-free-bitcoins-inside.

Lol, I've written that article myself and I even used the Bitcointalk thread I've posted as a source for that article (it's mentioned at the bottom)
I'd suggest just following Tryninja's instructions (in the thread I posted), if you know what you're doing. It's much faster that way.
legendary
Activity: 1624
Merit: 2481
June 05, 2018, 03:58:57 AM
#8
How is this transaction created exactly? Cry Cry Cry

What about reading the previous replies?
The answer to your question already has been posted:

I've also asked a similar question before on this forum and got a really amazing reply.
Easy step-by-step instructions to create a time-locked transaction.

https://bitcointalksearch.org/topic/m.24710770



For a set-by-step guide with picture, you can visit https://steemit.com/bitcoin/@daan/how-to-create-time-locked-transactions-with-bitcoin-free-bitcoins-inside.
legendary
Activity: 1059
Merit: 1020
June 02, 2018, 04:39:26 AM
#7
Concerning for the information about a time-locked address, you can verify the time until the funds have been locked, the address whose permission is required to withdraw the funds and the address where the funds are located, using Coinb.in.
legendary
Activity: 1792
Merit: 1283
June 01, 2018, 12:26:42 PM
#6
I've also asked a similar question before on this forum and got a really amazing reply.
Easy step-by-step instructions to create a time-locked transaction.

https://bitcointalksearch.org/topic/m.24710770

I know you're probably looking for a more in-depth technical answer, but just sharing this in case anyone else is interested in creating a time-locked transaction.
HCP
legendary
Activity: 2086
Merit: 4363
May 30, 2018, 10:41:56 PM
#5
Yes. Effectively... nLockTime is a bit like a "Dead Man's Switch".

You setup a transaction, that is not valid until X time (X = block number). Any time before X, you can invalidate that transaction simply by spending one of the inputs in a different transaction. If no action is taken, then the original transaction can be broadcast as a valid transaction after X has occurred.

GreenAddress uses nLockTime as a fail-safe for it's MultiSig wallets... They create a (partially) signed transaction (with their key) that sends all your funds to a nominated address from your 2-of-2 wallet with an nLockTime calculated to be around 90 days in the future. This way, if GreenAddress service goes down, you can simply sign the transaction with your key (so it is fully signed), and then broadcast it to recover your funds in 90 days.


But is it somewhere documented that it cannot be broadcasted by bitcoin nodes?
I don't think there is anything specifically documented that it cannot be broadcast... I think it's more just that because the transaction is considered "invalid" due to the lockTime that nodes will treat it like any other "invalid" transaction (bad signature, "missing" inputs, zero fee etc) and reject it (and thus refuse to broadcast/relay it).


My question was after I create and sign this transaction, what do I do with it?
All you can do is store it somewhere... most nodes won't accept invalid transactions, so attempting to broadcast it likely won't work. Why would a node want to store an "invalid" transaction in it's mempool? There is no point.

It isn't "unsafe" to have it stored somewhere (email, cloud storage, harddrive, given to recipient etc.) because, as already mentioned, if you change your mind you can simply invalidate it by spending one of the inputs in a transaction prior to nLockTime, and no-one can alter the "signed" transaction.
hero member
Activity: 773
Merit: 528
May 30, 2018, 10:08:11 PM
#4
Ok let me make my question more specific:
Suppose I create a transaction with OP_CHECKLOCKTIMEVERIFY set into some block in the future. I understand that this transaction is invalid until we reach that block.
My question was after I create and sign this transaction, what do I do with it? Of course it cannot be mined since it is invalid. Heisenberg_Hunter said I can only store it in a safe place, maybe sending it to the recipient letting him know that I have this transaction ready to broadcast it as soon as I can. But is it somewhere documented that it cannot be broadcasted by bitcoin nodes?
legendary
Activity: 1584
Merit: 1280
Heisenberg Design Services
May 30, 2018, 02:31:31 PM
#3
I'm looking for information on time-locked transactions for bitcoin.
Time Locking is a feature which when enabled restricts you to spend the btc present in the wallet for a certain time period or until the network reaches a specific block height. Time Locking features are used frequently for investment purposes or locking of funds for the heirs.

How is this transaction created exactly?
At the time of this writing, the block height is 525160. Create a transaction and enter the nlocktime say 650000.
The bitcoinj library has a command line tool that can be used to create such transactions.
Unless the blockheight entered hasn't been exceeded, your transaction is invalid, won't get confirmed and would never be broadcasted in the network.

Does this transaction remain off-chain between the sender and the receiver until the time has elapsed?
Yes transaction is invalid and would remain off-chain until the specified blockheight is reached. If you broadcast the transaction before the blockheight, it will not get included in the blocks. You can even cancel the transactions before the locktime is reached.

Does this transaction remain on the mempool until that time?
No. Mempool consists of unconfirmed transactions. Mempool consists of set of transactions that are broadcasted in the network but are not included in the blocks by a miner. Locktime transactions are not broadcasted to the network before the blockheight is reached. So you need to store the transactions in a safe place and need to broadcast it to the network at the right time when the locktime reaches.


More about Locktime here
Someone correct me if I am wrong   Embarrassed


sr. member
Activity: 490
Merit: 389
Do not trust the government
May 30, 2018, 01:00:38 PM
#2
I assume you are referring to nLocktime. It is simply a parameter in every Bitcoin transaction that can be set to zero.
Yes, the nLocktime value means that the transaction can not be added to a block that has a lower block number than the one specified in the nLocktime filed.

https://en.bitcoin.it/wiki/Protocol_specification#tx
hero member
Activity: 773
Merit: 528
May 30, 2018, 12:01:50 PM
#1
I'm looking for information on time-locked transactions for bitcoin. How is this transaction created exactly? Does this transaction remain off-chain between the sender and the receiver until the time has elapsed? Does this transaction remain on the mempool until that time?
Jump to: