Pages:
Author

Topic: howto nlocktime (Read 6919 times)

legendary
Activity: 3038
Merit: 1032
RIP Mommy
August 28, 2015, 02:17:58 PM
#28
Edit: there's a free 0.1 BTC for the first person to discover why I was giggling like a schoolboy when I made that transaction.

Because the address sent to is 1LASS?

Nope, it's slightly ruder than that.

Well it must be something to do with this...

Code:
{"ver":1,"size":225,"inputs":[{"sequence":142620501,"prev_out":{"spent":true,"tx_index":68671943,"type":0,"addr":"1JDBngCAx8Vc4MXKo5Ye54rg4eEsgovfUT","value":8990000,"n":1,"script":"76a914bcc8228412c4780c304847487816226b55a4088a88ac"},"script":"4730440220273d23cb2bdc6f6b4a9c9e112c06a6399cc8ba7ffe5f32fda777e5b595482fed022016f4f0148d86b571b2d7ad29953c7d6de4c9d15706d1bbb4b017baf6aa0916bf0121022e9d2a251a345c77ce8ded0ceae6906bcdb83d15cf2ce4890600bbda105cb2d0"}],"double_spend":false,"time":1415337539,"block_height":328916,"tx_index":68673323,"vin_sz":1,"hash":"8b8486d428cd5aade180437b09ce95f65ca2e9f3e3b5ea69f6ca9c47f1bd249c","vout_sz":2,"relayed_by":"209.190.122.2","out":[{"spent":false,"tx_index":68673323,"type":0,"addr":"1LASSfaBQbSAxyA4feP82fLDDEUwNbC5S3","value":1000000,"n":0,"script":"76a914d2335f3362c0b82f624b6c32d3829831f8e5b4b388ac"},{"spent":false,"tx_index":68673323,"type":0,"addr":"1JDBngCAx8Vc4MXKo5Ye54rg4eEsgovfUT","value":7980000,"n":1,"script":"76a914bcc8228412c4780c304847487816226b55a4088a88ac"}]}

Might be because it is sent from 1JD.

Did anyone win the BTC0.1, dooglus? I see "SAxy" in there.
hero member
Activity: 560
Merit: 509
I prefer Zakir over Muhammed when mentioning me!
August 08, 2015, 10:27:39 AM
#27

All inputs will be loaded manually when you enter an address or private key*.

Script determines how the person who receive that Bitcoins can access it. Read more at https://en.bitcoin.it/wiki/Script.

You can use http://btc.blockr.io/api/v1/tx/info/txid api to get raw transaction data. It displays script.

* I recommend entering an address instead of private key and sign unsigned raw transaction using Bitcoin Core or any other client which supports signing raw transaction.
sr. member
Activity: 448
Merit: 250
Craig Wright is scammer.
August 08, 2015, 07:25:07 AM
#26
hero member
Activity: 560
Merit: 509
I prefer Zakir over Muhammed when mentioning me!
August 07, 2015, 10:18:59 PM
#25
hi, I've done some successful transactions using nlocktime and changing sequence numbers.
I used brainwallet service to do the raw transaction, but now that site is dead.
What method can I use to do a nlocktime transaction?

https://coinb.in/#newTransaction
sr. member
Activity: 448
Merit: 250
Craig Wright is scammer.
August 07, 2015, 05:09:49 PM
#24
hi, I've done some successful transactions using nlocktime and changing sequence numbers.
I used brainwallet service to do the raw transaction, but now that site is dead.
What method can I use to do a nlocktime transaction?
sr. member
Activity: 467
Merit: 267
November 07, 2014, 08:47:05 PM
#23
Edit: there's a free 0.1 BTC for the first person to discover why I was giggling like a schoolboy when I made that transaction.

Because the address sent to is 1LASS?

Nope, it's slightly ruder than that.
ASS?
sr. member
Activity: 728
Merit: 256
November 07, 2014, 01:42:59 PM
#22
Edit: there's a free 0.1 BTC for the first person to discover why I was giggling like a schoolboy when I made that transaction.

Because the address sent to is 1LASS?

Nope, it's slightly ruder than that.

Well it must be something to do with this...

Code:
{"ver":1,"size":225,"inputs":[{"sequence":142620501,"prev_out":{"spent":true,"tx_index":68671943,"type":0,"addr":"1JDBngCAx8Vc4MXKo5Ye54rg4eEsgovfUT","value":8990000,"n":1,"script":"76a914bcc8228412c4780c304847487816226b55a4088a88ac"},"script":"4730440220273d23cb2bdc6f6b4a9c9e112c06a6399cc8ba7ffe5f32fda777e5b595482fed022016f4f0148d86b571b2d7ad29953c7d6de4c9d15706d1bbb4b017baf6aa0916bf0121022e9d2a251a345c77ce8ded0ceae6906bcdb83d15cf2ce4890600bbda105cb2d0"}],"double_spend":false,"time":1415337539,"block_height":328916,"tx_index":68673323,"vin_sz":1,"hash":"8b8486d428cd5aade180437b09ce95f65ca2e9f3e3b5ea69f6ca9c47f1bd249c","vout_sz":2,"relayed_by":"209.190.122.2","out":[{"spent":false,"tx_index":68673323,"type":0,"addr":"1LASSfaBQbSAxyA4feP82fLDDEUwNbC5S3","value":1000000,"n":0,"script":"76a914d2335f3362c0b82f624b6c32d3829831f8e5b4b388ac"},{"spent":false,"tx_index":68673323,"type":0,"addr":"1JDBngCAx8Vc4MXKo5Ye54rg4eEsgovfUT","value":7980000,"n":1,"script":"76a914bcc8228412c4780c304847487816226b55a4088a88ac"}]}

Might be because it is sent from 1JD.
legendary
Activity: 2940
Merit: 1333
November 07, 2014, 12:56:34 PM
#21
Edit: there's a free 0.1 BTC for the first person to discover why I was giggling like a schoolboy when I made that transaction.

Because the address sent to is 1LASS?

Nope, it's slightly ruder than that.
sr. member
Activity: 467
Merit: 267
November 07, 2014, 12:45:04 PM
#20
People won't hold your transaction in their memory pool for a year...

I think you misunderstand.

You can't send a transaction to the p2p network until the timelock has expired.

Until then you keep the transaction somewhere safe, and wait.

I tested this with a transaction I made with an nLockTime 10 seconds in the future.

The first time I tried to broadcast it, it was still timelocked:

Quote
$ bitcoin-cli sendrawtransaction $tx
error: {"code":-26,"message":"64: non-final"}

The second time, it worked:

Quote
$ bitcoin-cli sendrawtransaction $tx
8b8486d428cd5aade180437b09ce95f65ca2e9f3e3b5ea69f6ca9c47f1bd249c

Yes but that's just what bitcoind does. It won't relay non-standard tx and using nlocktime makes the tx non standard. The protocol doesn't say that. It should accept it and wait until the locktime expires before allowing mining. However, this feature could be easily abused.

From main.cpp
Code:
    // Treat non-final transactions as non-standard to prevent a specific type
    // of double-spend attack, as well as DoS attacks. (if the transaction
    // can't be mined, the attacker isn't expending resources broadcasting it)
    // Basically we don't want to propagate transactions that can't be included in
    // the next block.

Quote
Edit: there's a free 0.1 BTC for the first person to discover why I was giggling like a schoolboy when I made that transaction.
Because the address sent to is 1LASS?
legendary
Activity: 2940
Merit: 1333
November 07, 2014, 11:12:38 AM
#19
People won't hold your transaction in their memory pool for a year...

I think you misunderstand.

You can't send a transaction to the p2p network until the timelock has expired.

Until then you keep the transaction somewhere safe, and wait.

I tested this with a transaction I made with an nLockTime 10 seconds in the future.

The first time I tried to broadcast it, it was still timelocked:

Quote
$ bitcoin-cli sendrawtransaction $tx
error: {"code":-26,"message":"64: non-final"}

The second time, it worked:

Quote
$ bitcoin-cli sendrawtransaction $tx
8b8486d428cd5aade180437b09ce95f65ca2e9f3e3b5ea69f6ca9c47f1bd249c

Edit: there's a free 0.1 BTC for the first person to discover why I was giggling like a schoolboy when I made that transaction.
sr. member
Activity: 467
Merit: 267
November 07, 2014, 07:01:00 AM
#18
People won't hold your transaction in their memory pool for a year...
legendary
Activity: 2940
Merit: 1333
November 07, 2014, 12:03:22 AM
#17
As well as setting the "lock_time" to the future block number or unix time, you have to change the "sequence" to 0, otherwise the lock_time is disregarded.

Changing the sequence other than 4294967295 (the default) is enough.

From the code (with details omitted):

"a transaction is final if the locktime is less than the blockheight or blocknumber (depending on whether the locktime is low or high, resp.)
otherwise a transaction isn't final if any of its inputs aren't final
otherwise it's final

an input is final if its sequence is the biggest it can be (4294967295)"

Code:
bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
{
    if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime))
        return true;
    BOOST_FOREACH(const CTxIn& txin, tx.vin)
        if (!txin.IsFinal())
            return false;
    return true;
}

class CTxIn
{
public:
    bool IsFinal() const
    {
        return (nSequence == std::numeric_limits::max());
    }
}
full member
Activity: 125
Merit: 101
November 02, 2013, 06:30:16 PM
#16
I just did a test with small amounts using this tool: http://brainwallet.org/#tx (all outgoing transactions from 1FBirjB4q1MLH4gZXTKXNUfgMzuQDx49rh have a lock time: example1, example2)

As well as setting the "lock_time" to the future block number or unix time, you have to change the "sequence" to 0, otherwise the lock_time is disregarded.

I tried to broadcast the tx with https://blockchain.info/pushtx but it's not supported ("invalid sequence").

Broadcasting it with BitcoinQT works, but only when the lock_time has been reached, otherwise it won't broadcast ("transaction rejected").
staff
Activity: 4284
Merit: 8808
November 02, 2013, 06:18:40 PM
#15
Nlocktime is supported fine, replacement is not. But the OP's request doesn't need replacement.

He needs to create a transaction moving his coins to a key he keeps safe,  preferably signed with single|anyone_can_pay  so fees could be added later, with an nlocktime for the future... and then he needs to destroy the private key the coins are currently assigned to.

I do not recommend this— at least not for long spans of time, no one knows what the future holds. Future discovered security issues may make a transaction authored today no longer good in the future— unlikely, perhaps, but no one will promise otherwise.
legendary
Activity: 1092
Merit: 1016
760930
November 02, 2013, 05:21:36 PM
#14
Nlocktime is not properly supported at this time, so you can't do what you want with it, as far as I know, unfortunately.

that's a bad news... and just as I was about to spend half a day creating and editing those raw transactions.

However a friend of mine has developed a generic self-discipline time-lock type of app that could, among other things, help you secure those coins. He made it specifically for dealing with gambling addiction issues.

If you're interested, I will check with him what's the status on that.

yes, I'm interested. Provided it's  secure and trust-free

Sure, I will check and let you know.
sr. member
Activity: 333
Merit: 252
November 02, 2013, 10:05:35 AM
#13
Nlocktime is not properly supported at this time, so you can't do what you want with it, as far as I know, unfortunately.

that's a bad news... and just as I was about to spend half a day creating and editing those raw transactions.

However a friend of mine has developed a generic self-discipline time-lock type of app that could, among other things, help you secure those coins. He made it specifically for dealing with gambling addiction issues.

If you're interested, I will check with him what's the status on that.

yes, I'm interested. Provided it's  secure and trust-free
legendary
Activity: 1092
Merit: 1016
760930
November 02, 2013, 09:04:35 AM
#12
Nlocktime is not properly supported at this time, so you can't do what you want with it, as far as I know, unfortunately.

However a friend of mine has developed a generic self-discipline time-lock type of app that could, among other things, help you secure those coins. He made it specifically for dealing with gambling addiction issues.

If you're interested, I will check with him what's the status on that.
legendary
Activity: 3682
Merit: 1580
November 02, 2013, 06:52:01 AM
#11
Is nlocktime supported by bitcoin nodes? I remember reading on this forum that most nodes don't support it.
legendary
Activity: 1974
Merit: 1029
November 01, 2013, 08:31:26 AM
#10
Really? I thought you would do it manually, but on a computer. It would be hard to do it by hand, with a pen and a piece of paper.

You could say that, yes… but you'll agree that having to edit raw hexadecimal output in 2013 qualifies as "by hand" or "manually", as opposed to "automatically". Turns out that "manually" comes from latin "manus" meaning "hand".
b!z
legendary
Activity: 1582
Merit: 1010
November 01, 2013, 08:01:49 AM
#9
can anyone explain me how to make an Nlocktime transaction?

As far as I know you have to createrawtransaction, then edit the raw hexadecimal by hand Smiley. When edited, issue a decoderawtransaction to check that everything's ok, then finally sendrawtransaction.

Really? I thought you would do it manually, but on a computer. It would be hard to do it by hand, with a pen and a piece of paper.
Pages:
Jump to: