Sending and Receiving Mechanics I'm new to Bitcoin and am considering allowing people to pay for my software with them. Before I continue I would like to clarify some things. My googling did not get me the answers I was after.

I understand that you can create new addresses for each transaction. Say I have 1BTC paid to A and 1BTC paid to B.

On the overview tab of the default Bitcoin client, the balance would be displayed as 2BTC. I can only assume it has simply added up all the amounts in A and B address?

But when I send 2BTC to address C, does it create a new 'sending address' X and move to amounts from A and B to X and then send to C or send two transactions, one from each account A and B?
The coin selection that the client does is performed behind the scenes, the client takes care of the details.

But if you are curious to know what happens behind the scenes:

INPUT:


Address: A  1.0 BTC
Address: B  1.0 BTC


OUTPUT:


Address: C  2.0 BTC


FEE (derived as inputs - outputs): 0.0 BTC

This is assuming you didn't pay a fee.



Let's say instead you only were to pay 1.5 BTC, and a 0.0005 BTC Fee.

INPUT:


Address: A  1.0 BTC
Address: B  1.0 BTC


OUTPUT:


Address: C  1.5 BTC
Address: D  0.4995 BTC


FEE (derived as inputs - outputs): 0.0005 BTC

Address D was an address from your own wallet that the client chose to receive the change transaction.  Your balance in your wallet will then show 0.49995 BTC.



Here's a technical explanation:


http://en.bitcoin.it/wiki/Transactions