Take the 2-minute tour ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

I'd like to know if there are transactions that can only take place at some predefined moment. In principle, it should be possible to use the parameter nLockTime to wait for a particular block number:

https://en.bitcoin.it/wiki/Protocol_specification#tx

This could be useful in certain contracts, but replacement is not as yet supported:

Why isn't transaction replacement supported?

In any case, it seems you still can, in principle, create a simple, unreplaceable transaction with a wait time.

Is there any example of such a transaction in the blockchain? If not, would it be accepted by the standard client or would it be necessary to convince one miner to include it in one of his/her blocks.

UPDATE: Opened a discussion in https://bitcointalk.org/index.php?topic=131443.0 to delve further.

share|improve this question
1  
The Lock_time facility has potential for a 'Pension' type function. IE Buy 1 Bitcoin today and prevent access to it for 10 years. Sent to a Brain wallet address so no matter what client you use and no matter where in the world you are you can pick up your Bitcoin, Pension, Investment. Could it be modified so that it releases this investment at say, 1% amounts every X UTC Months, so you get 1% every month released to the Brainwallet address. That way, there there are at least 10 years worth of BTC Pension payments. Youd expect an ever dwindling return, but as Bitcoin is deflationary, perhaps no –  Ade Nov 15 '13 at 13:49
add comment

2 Answers

OK. This got interesting quickly. I have built a small block explorer and have found 5 transactions with high nLockTime values in blocks:

http://blockexplorer.com/rawblock/000000000000036a546044e094db778e1c146f051cd5d0e52fb0e6c43e63ea8c

http://blockexplorer.com/rawblock/000000000000049bd7c8aebf91efc907c880a35c05b7861b4eab3fc09655bb05

http://blockexplorer.com/rawblock/00000000000005f229df518de50c53616f4f2f895deca078dce1d74d5b79e39c

http://blockexplorer.com/rawblock/000000000000026e8536f6ffe741feeb30d7123e6435b3ad7db141833969b5bf

http://blockexplorer.com/rawblock/00000000000001d985839442aac0179713fc7f6e5b109d524a272d3d55600d7a

There is one in each block with lock time values 198370, 199000, 199000, 207150 and 207167. None of them are expired yet.

I will answer my own question and start a post in bitcointalk to see this in more depth (how the transactions got there, what happens to them if the clients change, etc).

share|improve this answer
add comment
up vote 3 down vote accepted

Solved. You can prepare transactions with a wait time and the standard client will accept them.

You can check some details in: https://bitcointalk.org/index.php?topic=131443.0

Essentially, I have been able to create a raw transaction https://en.bitcoin.it/wiki/Raw_Transactions using bitcoind. Then, before signing, I could manually replace the bytes for the sequence number and the locktime. I had some hard time with locktime. First you set the UNIX timestamp you want, then convert to hex, reverse the bytes (little endian) and replace the the last bytes of the hex transaction. https://en.bitcoin.it/wiki/Protocol_specification#tx tells you which are the relevant bytes. You can later sign the new transaction and send it.

I've been using the guide in: https://people.xiph.org/~greg/signdemo.txt

I did all in the testnet. In my first attempts I wasn't careful with my change and ended up spending all my wallet in fees. You should be careful if you try this with real bitcoins.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.