Post
Topic
Board Development & Technical Discussion
Re: nLockTime
by
dree12
on 26/05/2014, 23:57:30 UTC
Hello,

I am trying to understand nLockTime. I believe it is an optional attribute, normally not set, on transactions. https://en.bitcoin.it/wiki/Protocol_specification

Quote
If all TxIn inputs have final (0xffffffff) sequence numbers then lock_time is irrelevant. Otherwise, the transaction may not be added to a block until after lock_time (see NLockTime).

Were NLockTime points to https://en.bitcoin.it/wiki/NLockTime

Quote
nLockTime is a parameter that can be attached to a transaction, that mandates a minimal time (specified in either unix time or block height), that before this time, the transaction cannot be accepted into a block.

I thought I understood, but then I read discussions here, however then I read the following from https://greenaddress.it/en/faq/:

Quote
But! We have solved this issue by providing nLockTime transactions which essentially make deposits 'expire' after some time, which allows redeeming them without our intervention after this pre-set period of time. It is enabled by default when you have email notifications and two factor enabled.

This allows you to keep your ease of mind even in case GreenAddress.it disappears with its keys.

It also means that every time the funds expire the user has to re-transfer them. This can be automated on login and notified in advance via email or manually done.

Which rather confuses me. Just how does this work?

Thanks

Basically, GreenAddressIt will send a transaction with nLockTime whenever someone makes a deposit. This transaction sends the funds back to the depositor. The nLockTime transaction effectively acts as a deposit expiry: after this time, it will be included in a block and the depositer will get the funds back.

GreenAddressIt works by using multi-factor transactions. Both the user and GreenAddressIt must sign for a transaction to be made from deposited funds. This allows the recipient to disregard the possibility of a double spend since GreenAddressIt has to authorize a double spend, which it won't do if the site is honest. To prevent a database loss or owner disappearance from destroying the funds, the nLockTime transactions are made returning funds to the depositor's address.