Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Topic OP
Delayed transactions (using nTimeLock)
by
halftimepad
on 18/12/2012, 17:15:26 UTC
⭐ Merited by ETFbitcoin (1)
Hello all. I'm new in the Bitcoin community and I have a particular interest in contracts, Script and all the new possibilities that usual currencies don't have.

I have been looking into some features like the ability to delay payments. In principle, transactions have a lock time that can be used to delay transactions.

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

There are some interesting uses in contracts in transaction replacement, but this ability seems to be disabled at the moment http://bitcoin.stackexchange.com/questions/861/why-isnt-transaction-replacement-supported.

I have made a small block explorer based on bitcointools (https://github.com/gavinandresen/bitcointools) to find transactions with a lock_time value different from 0 and have found five transactions that do have a wait time. They are in blocks:

000000000000036a546044e094db778e1c146f051cd5d0e52fb0e6c43e63ea8c
000000000000049bd7c8aebf91efc907c880a35c05b7861b4eab3fc09655bb05
00000000000005f229df518de50c53616f4f2f895deca078dce1d74d5b79e39c
000000000000026e8536f6ffe741feeb30d7123e6435b3ad7db141833969b5bf
00000000000001d985839442aac0179713fc7f6e5b109d524a272d3d55600d7a

The transactions are:

Code:

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

{
      "hash":"13e100dd08b6da0a7426ea520b0bb3ae54cef79dd045e2e4f7116023df3a5c95",
      "ver":1,
      "vin_sz":1,
      "vout_sz":1,
      "lock_time":198370,
      "size":191,
      "in":[
        {
          "prev_out":{
            "hash":"8af03f89f3e774ba64890b6f491f43b30de5f8c5e1d92fcad1e3355c566fd21d",
            "n":1
          },
          "scriptSig":"304402204427e4bcb2bd48bf5d25dc3c7fde90df5b6e8ad39f62ddf1ad2bf82c33bb7f170220494ac767bbbe269eb8c352c8698ed24f2be09ee5d4e5f6a5d7cf69e709c28f1201 021669049d34ea3a8e364710151de215f15a74947ab87b8952ab062ed106c37bf6"
        }
      ],
      "out":[
        {
          "value":"0.01500000",
          "scriptPubKey":"OP_DUP OP_HASH160 46186d1c563e4507b102aa0e5e3b9ef0a9077de3 OP_EQUALVERIFY OP_CHECKSIG"
        }
      ]
    },


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

  {
      "hash":"34df83aea6d6a68bab10b01e4ec4043850855406d45589b907dea565c8439976",
      "ver":1,
      "vin_sz":2,
      "vout_sz":1,
      "lock_time":199000,
      "size":341,
      "in":[
        {
          "prev_out":{
            "hash":"69d771de96b5e0b7e66bc47f13eeedb96c45636bb3853637852b536b8959026a",
            "n":0
          },
          "scriptSig":"3046022100ea4a9a35edbfa63327a68ef33b151da6a824ba86119c2fb2e69ccfa676cbf55d022100d8071b560b35585bee1249ba27e4cd9b61229c4bad6a5e2482982ea98e59215f01 024931bfb3b26c333c180a9dce4892035f58468cb1bd0b5e2159f5834101672a40"
        },
        {
          "prev_out":{
            "hash":"69d771de96b5e0b7e66bc47f13eeedb96c45636bb3853637852b536b8959026a",
            "n":1
          },
          "scriptSig":"304502207674f68e100d65b0f29316b0d643d3e6c9410da056102ab305d4ea8f229f5c56022100ddbd064ae427f4db44fc8cefd45e837e35264b276ed8007fbf293301b22bd82901 025145729dd299d26dd21244e04df616a6083e80e2604153d1ec9b20dc79d1f4e2"
        }
      ],
      "out":[
        {
          "value":"0.01450000",
          "scriptPubKey":"OP_DUP OP_HASH160 1bec313498b523aadb2964ab6d95608a911f4eeb OP_EQUALVERIFY OP_CHECKSIG"
        }
      ]
    },


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

  {
      "hash":"b0fa60f601d5fe6fb1501aa614503b9af688492f68bcf8268d7cdb30f3534079",
      "ver":1,
      "vin_sz":1,
      "vout_sz":1,
      "lock_time":199000,
      "size":192,
      "in":[
        {
          "prev_out":{
            "hash":"4ac2fd4616a400ea29ad5eaff723d18ca05e4c22e4c9a190b8ab7b09d8964f99",
            "n":0
          },
          "scriptSig":"3045022006f942260b9587f8976fc31de7c238e4998e6f0afbf026568c41f732de672473022100f30f27305dc27b3435b5803fe72d0dacf8c845b402959d192d27de96f5fcd90601 03e71226d01c0186a3995446089d41ce90d08cf384f5a1c906239e540221efc683",
          "sequence":4278190335
        }
      ],
      "out":[
        {
          "value":"0.01350000",
          "scriptPubKey":"OP_DUP OP_HASH160 87965d6172fcc30cbbdfd1b674d66d567e64bb53 OP_EQUALVERIFY OP_CHECKSIG"
        }
      ]
    },


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

 {
      "hash":"c466c6f8ee76ac77495f703aa5646926d67730ea7a8ede45debf3be37c9ffe7b",
      "ver":1,
      "vin_sz":2,
      "vout_sz":2,
      "lock_time":207150,
      "size":373,
      "in":[
        {
          "prev_out":{
            "hash":"a8f8a86ebc2c9eb8989a6e988238cfa37ffc5634bd8a216a19a63ae7bb84e352",
            "n":0
          },
          "scriptSig":"304502206bbfb4f4c700b25d7e7c6627a43c6b6ef5c2e449c8c3cf0e729a08fd6b8e4d3f022100de614f17b6f2ddcf0c9cb5c9259ccbcf38fc7bc529c261166651072eee8de3a901 0372517b2117c312844838b6cb79959ab6dfb3357e7c7e8ead94e438091039f72d",
          "sequence":0
        },
        {
          "prev_out":{
            "hash":"a8f8a86ebc2c9eb8989a6e988238cfa37ffc5634bd8a216a19a63ae7bb84e352",
            "n":1
          },
          "scriptSig":"304402207dd414f7c962b67378bf659c7f38fd96a32e9c6d245479ce9f37595f6673e51f02202ea6355791b2b945694916baec0139ba6a807c35cc72b6e96ccaee21bb00409001 0346559defaa3a93fe93eb38af8f10ac060a39b2f5b1b18a932aaba39746e9f36f",
          "sequence":0
        }
      ],
      "out":[
        {
          "value":"0.00050000",
          "scriptPubKey":"OP_DUP OP_HASH160 f1ddb423647b717589222293108b3a71f6c9c479 OP_EQUALVERIFY OP_CHECKSIG"
        },
        {
          "value":"0.00022074",
          "scriptPubKey":"OP_DUP OP_HASH160 0c7d886ae9a809429e962458f8b86ecb7ae2b730 OP_EQUALVERIFY OP_CHECKSIG"
        }
      ]
    },

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

    {
      "hash":"d1ef46055a84fd02ee82580d691064780def18614d98646371c3448ca20019ac",
      "ver":1,
      "vin_sz":1,
      "vout_sz":2,
      "lock_time":207167,
      "size":226,
      "in":[
        {
          "prev_out":{
            "hash":"18a3db0f83fd7407f1a286af161703e19f5ea800944e9c273c02f3d2cd106a33",
            "n":1
          },
          "scriptSig":"3045022016dfc9cd05189641188b7f8ca8336d30c6dd4750766060437f16c384c4e9756a022100cbc2906d947e131bdf5e8a685df7ae869d3a92fdc7d0198cd7756ecf7f3fecef01 0372517b2117c312844838b6cb79959ab6dfb3357e7c7e8ead94e438091039f72d",
          "sequence":0
        }
      ],
      "out":[
        {
          "value":"0.00050000",
          "scriptPubKey":"OP_DUP OP_HASH160 2aacd8e8e3607cadd993eaf20047b3ba051049b5 OP_EQUALVERIFY OP_CHECKSIG"
        },
        {
          "value":"0.00900000",
          "scriptPubKey":"OP_DUP OP_HASH160 71b13ab7f1f5b1e7ed1b3df8c2b57eef083cf3fb OP_EQUALVERIFY OP_CHECKSIG"
        }
      ]
    },

It seems none of them will be able to be redeemed for a long time.

I have a few questions:

- This ability looks like a feature to me, but it seems clients shouldn't allow this kind of transaction and some people treat this as a bug:

http://bitcoin.stackexchange.com/questions/5783/transactions-with-a-wait-time-using-nlocktime/5833#5833
https://github.com/bitcoin/bitcoin/issues/1820

Are locked transactions supposed to be supported or not?

- If not, what will happen to the already existing locked transactions?

- Can you easily introduce a locked transaction using the standard client? If not, how? 



                       Thanks!