6

If I have Bitcoins in my wallet and I have downloaded the blockchain far enough so that I can see that I have received them, can I send them without having a fully updated blockchain?

  • 1
    Why not try it and see? – Nate Eldredge Nov 16 '13 at 15:11
2

Actually you can spend these if you REALLY need it creating a raw transaction:

  1. Collect unspent outputs. RPC listunspent does this, but IIRC it's empty until you download the whole blockchain. You can also check Blockchain.info for known transactions.
  2. For each unspent output grab the transaction id (txid), output index (vout) and script (scriptPubKey) and write down as {"txid":"exampleID","vout":x,"scriptPubKey":"exampleScript"}. We'll call each one of these {in1}, {in2}, ..., {inN} for N inputs.
  3. Concatenate all inputs like this '[{in1},{in2},...,{inN}]' where each {inX} is what you annotated earlier in step 2. Note the opening and closing ' !
  4. Concatenate destination addresses and amounts like this '{"out1":amt1,"out2":amt2,...,"outM":amtM}. Remember to send unspent change to yourself! Change not sent back will be sent as a mining fee. Remember to set a sensible fee too.
  5. Use RPC: createrawtransaction '[{in1},{in2},...,{inN}]' '{"out1":amt1,"out2":amt2,...,"outX":amtM}'. This will return a hex string composed of numbers 0-9 and letters A-F.
  6. Use RPC: signrawtransaction "resultStep5" '[{in1},{in2},...,{inN}]'. This will return {"hex": "string of 0-9 A-F", "complete": true}. If complete says false the transaction is not signed (perhaps wrong input, or missing private keys).
  7. Double check the transaction using RPC decoderawtransaction hexStep6. Check that outputs are fine and fee is not too much/little.
  8. If "complete: true" and the transaction has been double-checked, broadcast it using RPC: sendrawtransaction hexStep6.
  • +1 for a great answer.. I just wanted to clarify. I think kaoD knows this already, judging by his answer but I just wanted to let others know this does not allow you to double spend anything. Its not that easy (!) – Brian Onn Jan 11 '14 at 7:47
3

No, because Bitcoin-Qt still has no way of knowing if you actually have those bitcoins.

Imagine you had the same wallet on two separate computers one with the block chain fully downloaded and one with it only half downloaded. Now Imagine you have 10 bitcoins. On the wallet with the block chain fully downloaded you send all 10 coins to your friend. This computer now reflects that you have 0 bitcoins while the one with the half downloaded block chain still says you have 10. If Bitcoin-Qt allowed you to send those bitcoins, it would be opening the network up to double spending.

  • 2
    It should be noted that there are lightweight clients such as Electrum, that can be used without downloading the blockchain. I know that is not the focus of the question but someone may find that information relevant to the question at hand. – Mark S. Nov 17 '13 at 6:53

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.