0

I know that it's sounds ridiculous, but i need to create an unconfirmed bitcoin transaction that will be unconfirmed for 2+ hours.I came to a conclusion that i need to create a 0 fee transactions but can't find a solution to make it and broadcast. Another variant was to set the min. fee ( 1sat/byte ) , but sometimes it's got confirmed after 5-10 minutes.How can a achieve the desired result ?

  • 1
    By not broadcasting it ? :D More seriously, what are you trying to achieve ? – darosior Feb 3 at 21:37
0

You can achieve this with timelocks.

The bitcoin wiki says "A Timelock is a type of smart contract primitive that restricts the spending of some bitcoins until a specified future time or block height."

EDIT

Further, it reads:

CheckLockTimeVerify

In late 2015, the BIP65 soft fork[6] redefined the NOP2 opcode as the CheckLockTimeVerify (CLTV) opcode, allowing transaction outputs (rather than whole transactions) to be encumbered by a timelock. When the CLTV opcode is called, it will cause the script to fail unless the nLockTime on the transaction is equal to or greater than the time parameter provided to the CLTV opcode. Since a transaction may only be included in a valid block if its nLockTime is in the past, this ensures the CLTV-based timelock has expired before the transaction may be included in a valid block.

CLTV is currently used in CLTV-style payment channels.

Relative locktime

In mid-2016, the BIP68/112/113 soft fork gave consensus-enforced meaning to some values in the nSequence field[7] that is a part of every transaction input, creating a "relative locktime"[citation needed]. This allowed an input to specify the earliest time it can be added to a block based on how long ago the output being spent by that input was included in a block on the block chain.

CheckSequenceVerify Also part of the BIP68/112/113 soft fork was the CheckSequenceVerify opcode[8], which provides for relative locktime the same feature CLTV provides for absolute locktime. When the CSV opcode is called, it will cause the script to fail unless the nSequence on the transaction indicates an equal or greater amount of relative locktime has passed than the parameter provided to the CSV opcode. Since an input may only be included in a valid block if its relative locktime is expired, this ensures the CSV-based timelock has expired before the transaction may be included in a valid block.

Hope this helps.

| improve this answer | |
  • 1
    Timelocked transactions are not broadcastable until the timelock expires, so this is not a solution to OP's question. – Pieter Wuille Feb 29 at 1:54
  • I meant specifically CHECKSEQUENCEVERIFY. – ecavero Mar 1 at 16:28
  • Same. Those are still not broadcastsble until the relative locktime has passed. – Pieter Wuille Mar 1 at 16:57
0

You could broadcast a transaction that depends on a parent transaction that you don't broadcast until 2 hours later. This would ensure that the child transaction cannot make it into a block until the parent has been transmitted.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.