Author

Topic: one wallet, two addresses - transfer btc? (Read 703 times)

donator
Activity: 1218
Merit: 1079
Gerald Davis
March 26, 2013, 05:06:58 PM
#6
Sure.  although bitcoin-QT doesn't make it easy to control from which address coins come from

So, what if I have 2 btc in one address in my wallet and 5 btc in other address, and then I send 3... what does Bitcoin-Qt do?

Well the first thing to realize is Bitcoin has no concept of "x value at address z".  Bitcoin ONLY cares about outputs.

It is possible to have 10 BTC worth of outputs at one address made up of hundreds or thousands of discrete outputs.
i.e.
output worth 0.2 BTC
output worth 0.3 BTC
output worth 0.1 BTC
...
output worth 0.4 BTC
output worth 0.2 BTC

When you wallet says "you have 7 BTC" what is really means is you have a colleciton of unspent outputs whos combined value is worth 7 BTC.  It could be a single unspent output or it could be a half dozen all the same address, or it could be a few hundred one at each of a few hundred addresses.

So without knowing how the value of your wallet is organized it is unknown outputs (and thus from which address) will be used in the transaction.


You have two options:
a) forget about it.  Bitcoin QT was designed to operate at the wallet level. You have 7 BTC.  If you want to spend it, spend it, and the wallet will pick the right combinations of outputs to spend it.

b) use a wallet (such as electrum or blockchain.info) which allows coin control.

still as tysat pointed out you might want to ask yourself "why" you want to do this.  You can think of outputs as similar to fiat "bills".   If you owe a merchant 23 USD and you look in your wallet and there are 20x $1 USD bills,  3x $5 USD bills, 7x $10 USD bills, one $20 and one $100 bill it doesn't really matter which bill you use.  Bitcoin works the same way.  The wallet finds a set of outputs (like bills) worth more than the amount you are trying to send and then creates a tx with the amount you are sending going to the merchant and the "change" (leftover) going back to another address in your wallet.


  Bitcoin QT (and other wallets) uses a coin selection algorithm which attempts to pick
newbie
Activity: 56
Merit: 0
Is there a reason that you need to send from a particular address?

No, just trying to figure out how it all works.
legendary
Activity: 966
Merit: 1004
Keep it real
Is there a reason that you need to send from a particular address?
newbie
Activity: 56
Merit: 0
Sure.  although bitcoin-QT doesn't make it easy to control from which address coins come from

So, what if I have 2 btc in one address in my wallet and 5 btc in other address, and then I send 3... what does Bitcoin-Qt do?
donator
Activity: 1218
Merit: 1079
Gerald Davis
Sure.  although bitcoin-QT doesn't make it easy to control from which address coins come from.  Using a wallet like blockchain.info eWallet is likely easier as you have control over the exact input being used.

At the protocol level the network has no concept of wallets. All transactions are simply assigning ownership of an unspent output to a new (or same but that is kinda pointless) address.  The network doesn't "know" or "care" if the two addresses are in the same wallet or on different continents.
newbie
Activity: 56
Merit: 0
I have two addresses in my wallet (Bitcoin-Qt)

Is it possible to transfer btc from one address to the other?
Jump to: