Bitcoin Forum
November 18, 2024, 04:29:36 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: one wallet, two addresses - transfer btc?  (Read 698 times)
txoomy (OP)
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
March 26, 2013, 06:46:26 PM
 #1

I have two addresses in my wallet (Bitcoin-Qt)

Is it possible to transfer btc from one address to the other?
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
March 26, 2013, 06:48:50 PM
 #2

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.
txoomy (OP)
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
March 26, 2013, 07:04:07 PM
 #3

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?
tysat
Legendary
*
Offline Offline

Activity: 966
Merit: 1004


Keep it real


View Profile
March 26, 2013, 07:19:23 PM
 #4

Is there a reason that you need to send from a particular address?
txoomy (OP)
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
March 26, 2013, 07:21:31 PM
 #5

Is there a reason that you need to send from a particular address?

No, just trying to figure out how it all works.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
March 26, 2013, 10: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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!