Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: voileipa on July 27, 2014, 11:53:47 AM



Title: Making a transaction whose output is spendable only after n blocks are found?
Post by: voileipa on July 27, 2014, 11:53:47 AM
Making a transaction whose output is spendable only after n blocks are found?
Is that possible?`


Title: Re: Making a transaction whose output is spendable only after n blocks are found?
Post by: kolinko on July 27, 2014, 12:17:35 PM
Bitcoin has a nLockTime mechanism within the protocol, but there are various issues with it: http://bitcoin.stackexchange.com/questions/5783/transactions-with-a-wait-time-using-nlocktime

You can achieve a similar feat using M of N oracles:
https://github.com/orisi/orisi
https://www.youtube.com/watch?v=boPW1FwNu4c


Title: Re: Making a transaction whose output is spendable only after n blocks are found?
Post by: yakuza699 on July 27, 2014, 12:20:33 PM
I may be wrong but nLockTime isn't correctly implemented. nLockTime only works if the sequence number is lower than 4294967295 but transactions which sequence number is lower than 4294967295 are considered non standard if you set the sequence number to 4294967295 miners will ignore the nLockTime and will mine your transaction before nLock expires so no there is no such thing implemented. Correct me if i am wrong.


Title: Re: Making a transaction whose output is spendable only after n blocks are found?
Post by: yakuza699 on July 27, 2014, 01:00:54 PM
Bitcoin has a nLockTime mechanism within the protocol, but there are various issues with it: http://bitcoin.stackexchange.com/questions/5783/transactions-with-a-wait-time-using-nlocktime

You can achieve a similar feat using M of N oracles:
https://github.com/orisi/orisi
https://www.youtube.com/watch?v=boPW1FwNu4c

If i am not mistaken (sorry didn't had enough time to read everything) your client invades multi sig transactions but what if user wants to create transaction like this : A sends money directly to B(not involving multi sig) transaction appears on block explorers such as blockchain.info (http://blockchain.info) as unconfirmed and will not be confirmed till block x and B (even though you can spend unconfirmed transaction now) will not be able to spend those btc until the transaction is confirmed. Can i do this kind of thing with orisi?


Title: Re: Making a transaction whose output is spendable only after n blocks are found?
Post by: DeathAndTaxes on July 27, 2014, 04:33:16 PM
I may be wrong but nLockTime isn't correctly implemented. nLockTime only works if the sequence number is lower than 4294967295 but transactions which sequence number is lower than 4294967295 are considered non standard if you set the sequence number to 4294967295 miners will ignore the nLockTime and will mine your transaction before nLock expires so no there is no such thing implemented. Correct me if i am wrong.

That is how it works but it is implemented correctly.  nlocktime transactions which are not standard until the lock time is reached.  This is intentional because if it wasn't true one could spam the network at no cost by generating millions or billions of nlocktime transactions.   However this doesn't prevent you from giving the nlocktime transaction directly to the recipient out of band.


Title: Re: Making a transaction whose output is spendable only after n blocks are found?
Post by: rapport on July 28, 2014, 08:07:05 AM
I may be wrong but nLockTime isn't correctly implemented. nLockTime only works if the sequence number is lower than 4294967295 but transactions which sequence number is lower than 4294967295 are considered non standard if you set the sequence number to 4294967295 miners will ignore the nLockTime and will mine your transaction before nLock expires so no there is no such thing implemented. Correct me if i am wrong.

That is how it works but it is implemented correctly.  nlocktime transactions which are not standard until the lock time is reached.  This is intentional because if it wasn't true one could spam the network at no cost by generating millions or billions of nlocktime transactions.   However this doesn't prevent you from giving the nlocktime transaction directly to the recipient out of band.

Here's my attempt to make above clearer (yakuza699 lack of punctation was a little confusing):
- nLockTime only works if the sequence number is lower than 4294967295
- transactions with sequence number lower than 4294967295 are considered non standard
- This is intentional because if it wasn't true one could spam the network at no cost by generating millions or billions of nlocktime transactions
- You can give the nlocktime transaction directly to the recipient out of band, and when the lock time is reached, the transaction becomes standard and the recipient can broadcast it


Title: Re: Making a transaction whose output is spendable only after n blocks are found?
Post by: gmaxwell on July 28, 2014, 03:04:24 PM
- nLockTime only works if the sequence number is lower than 4294967295
- transactions with sequence number lower than 4294967295 are considered non standard
If and only if their locktime hasn't passed, I realize you know this, but your message was a bit confusing. :)


Title: Re: Making a transaction whose output is spendable only after n blocks are found?
Post by: kolinko on July 30, 2014, 03:23:26 PM
If i am not mistaken (sorry didn't had enough time to read everything) your client invadesolves multi sig transactions but what if user wants to create transaction like this : A sends money directly to B(not involving multi sig) transaction appears on block explorers such as blockchain.info (http://blockchain.info) as unconfirmed and will not be confirmed till block x and B (even though you can spend unconfirmed transaction now) will not be able to spend those btc until the transaction is confirmed. Can i do this kind of thing with orisi?

For that, you'd need nLockTime, as others said :)