Is there a way to send funds from a specific bitcoin address in a wallet?
Asked Answered
E

3

6

The first result from Google gave me an answer from 2012 so I wondered if there was a better one than 'use armoury' now?

It's fine if I have to decode the raw transactions, I would be grateful if someone could take me through the steps.

Thanks in advance :)

Effervesce answered 27/4, 2014 at 14:10 Comment(1)
"the below answer from 2012 " link might be missing... :/Arson
E
15

I'll answer my own question,

It was unbelievably easy. (from the debug console or command line)

listunspent

produces a/the list of unspent outputs at your disposal. Make a note of the 'txid', 'vout' and 'scriptPubKey' of each output you wish to use.

Use the 'createrawtransaction' command followed by a list of dictionaries containing the txid's and vout's of the inputs you chose earlier followed by the addresses you wish to send them to (the send to addresses are in a single dictionary, not a list of dictionaries).

createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...}

If you don't want to send the outputs in total (you want some change for yourself) you will need to include an address that you control in your sending dictionary (from your wallet or somewhere else) since outputs cannot be partially spent, sorry.

To pay the mining fee simply leave some of the total output amount unaccounted for and bitcoin will use it as the mining fee by default (fee is 0.0001 at time of writing).

If all went well you should be given a hex string.

Use the 'signrawtransaction' command to check there are no errors by passing in your new hex string followed by a list of dictionaries with the txid's, vout's and scriptPubKeys we got at the very beginning of all this.

signrawtransaction <hex string> [{"txid":txid,"vout":n,"scriptPubKey":hex},...]

note: in newer versions of bitcoin the list of dictionaries is not required

If you got a new hex with "complete" : true after it then all went well and you can now use the 'sendrawtransaction' command followed by the even newer hex you were just given to broadcast your newly created transaction into the bitcoin network.

sendrawtransaction <new hex string>

If you managed to sign it successfully but get a "code":-22,"message":"TX rejected" error please see the footnote below.

Notice it only took four commands in total:

*get     (listunspent)
*create  (createrawtransaction)
*sign    (signrawtransaction)
*send    (sendrawtransaction)

Easy :)

FOOTNOTE:

Be aware if you designate an unusually large fee like 0.5btc (I tried this on the testnet) the network will reject your transaction when you try to broadcast it because it thinks you've made a mistake which I discovered whilst I was experimenting.

(This is also the case if you are trying to spend more BTC than you have available.)

In the end I set the fee to 0.001 and it worked fine, here is a link to my question regarding this situation.

Effervesce answered 1/5, 2014 at 2:58 Comment(1)
signrawtransaction has been deprecated from bitcoin core v0.17. should use signrawtransactionwithwallet since you are signing with keys from the wallet. bitcoincore.org/en/doc/0.17.0/rpc/wallet/…Logan
D
2

Another possibility is with Electrum. Under the Addresses tab right-click on one with non-zero balance and select 'Spend from'.

You have to click View > Show Addresses if you do not have the Addresses tab.

Duplication answered 22/5, 2016 at 22:14 Comment(1)
Thanks! Also fixed typo and added helptext. In the beginning of the Bitcoin I got a lot of very micro transactions. Removed all those micro transactions, now the fee is 10 times less and another 0.0001554 BTC is lost forever now...Experience
S
0

from where you wanna send your BTC. All you need to fill the withdrawal address of bitcoins. You may send your BTC to Bitfinex with the same process: Fill withdraw address Fill amount to be sent. Verify your payment. Done.

Stumpf answered 14/8, 2017 at 5:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.