Post
Topic
Board Development & Technical Discussion
Re: Delayed transactions (using nTimeLock)
by
halftimepad
on 05/01/2013, 23:55:09 UTC
Thank you all for the explanations!

  I have already been playing with raw transactions in the testnet with bitcoind. After a few false starts (I still have some trouble with the change and I forgot about the sequence number) I think I have managed to send some transactions with a lock time.

  I'm still a bit confused, because right after sending them, I could spend the coins in another transaction. Here is an example transaction:

Code:
{
    "hex" : "0100000001b110f593f3f4b0a9f93fd625d5e455c82b7ec0a5fe491198ac0bdf042bc837c8000000006b48304502207501c32e46cfba0ac5aae64849a34107c2a30291448604d0c207ae7c0a05c65d022100f914d06a0f64331d0b6ba931d62db2257293c199d4541bbb02266cf0fa1272f50121035ecd174d977eecdda204fd52be159469b77399f8f19894a70b72216197525782fff0ffff0100d2496b000000001976a914be42ebf8ab45f191de4703213a093510b825959188ac03000000",
    "txid" : "251a368ff8a663f8d1ce55ce1f3dbd49ce2fbd9f1a270dc4ef9decf3c4a3461e",
    "version" : 1,
    "locktime" : 3,
    "vin" : [
        {
            "txid" : "c837c82b04df0bac981149fea5c07e2bc855e4d525d63ff9a9b0f4f393f510b1",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "304502207501c32e46cfba0ac5aae64849a34107c2a30291448604d0c207ae7c0a05c65d022100f914d06a0f64331d0b6ba931d62db2257293c199d4541bbb02266cf0fa1272f501 035ecd174d977eecdda204fd52be159469b77399f8f19894a70b72216197525782",
                "hex" : "48304502207501c32e46cfba0ac5aae64849a34107c2a30291448604d0c207ae7c0a05c65d022100f914d06a0f64331d0b6ba931d62db2257293c199d4541bbb02266cf0fa1272f50121035ecd174d977eecdda204fd52be159469b77399f8f19894a70b72216197525782"
            },
            "sequence" : 4294963455
        }
    ],
    "vout" : [
        {
            "value" : 18.00000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 be42ebf8ab45f191de4703213a093510b8259591 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914be42ebf8ab45f191de4703213a093510b825959188ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "mxrxrJnR2XP889vMz2ewVZ97dvgso6DfF6"
                ]
            }
        }
    ],
    "blockhash" : "000000000b5ac111cc15c3b47cc46e877e5b93f250a927a14dddcddf013bfee5",
    "confirmations" : 2493,
    "time" : 1356543924,
    "blocktime" : 1356543924
}

The sequence number is a bit strange because I just replaced an f by a 0 in the hex transaction, but I think it is OK.

I will continue playing and post the results. I might be doing something else wrong.