2

Can I spend Inputs with 0 confirmations?? If I could, are there some restrictions?

Alberto
  • 51
  • 1
  • 1
  • 2
  • Possible duplicate of: [Can multiple transactions transferring the same bitcoin be done in one block?](http://bitcoin.stackexchange.com/q/1726/5406), [Can an output be spent in the block in which it is contained?](http://bitcoin.stackexchange.com/q/30485/5406); related: [Order of transactions within a block](http://bitcoin.stackexchange.com/q/23035/5406) – Murch Jun 03 '15 at 12:41

3 Answers3

1

If the input is coinbase transaction, you can't spent it until it get 100 confirmations. Relevant code is here
If the input is not a coinbase transaction, you can spend it by creating a raw transaction How To Create A Raw Transaction

However, receiving input with 0 confirmation is not recommended.

Zero-confirmation transaction vulnerability: accepting zero-confirmation transactions (transactions that have not yet been included in a block) from somebody you do not trust is still not recommended, because there will always be ways for attackers to double-spend zero-confirmation transactions. However, this release includes a bug fix that makes it a little bit more difficult for attackers to double-spend a certain type ("lockTime in the future") of zero-confirmation transaction.

moshaholo
  • 633
  • 6
  • 16
1

With the exception of freshly mined coins, it is possible to spend unconfirmed funds - though it depends on which wallet you use. The bitcoin-core, cli version, will by default only spend funds with at least one confirmation, but it's possible to override, i.e. using the sendfrom command:

sendfrom "fromaccount" "tobitcoinaddress" amount ( minconf "comment" "comment-to" )

Set minconf to 0 and you're done.

Be aware of the trust issue; if you receive funds from someone you don't trust and send the coins further to someone that trusts you, you could put your reputation on line if the original sender pulls a double-spend.

If the original transaction carried a low fee and that's the reason why it hasn't been included in the blockchain yet, the new transaction may help to get it confirmed faster

tobixen
  • 821
  • 7
  • 12
0

If you are using Blockchain.info's wallet, you need to wait for 1 confirmation before spending it out. If your wallet has more than the amount you want to spend and that amount is not currently in any transaction or is un-confirmed, you can spend your coins easily.

Claris
  • 15,323
  • 2
  • 26
  • 43
Lt.Bitcoin
  • 56
  • 1
  • 1
  • 6