1

Since last time I dabbled in bitcoin using a single address wallet (using fractions of coins gained from captcha faucets), I've learned about new things like change addresses. I understand when you make a transaction you pay the address' full value and the change is sent back to it or preferably to a new address for the sake of everyone's anonimity.

So let's say you have a wallet with 10 addresses and 20 change addresses. After a while you end up having your collective wealth spread out over all 30.

Now comes the time to pay someone an amount larger than held by any individual address you have.

Does your bitcoin client somehow pool the money from the addresses you control together and funnel it into a single transaction to your intended recipient with a single transaction fee? I thought this was impossible by design since an address can only spend the coins it directly owns and a transaction has 1 source address.

Does your client first need to gather the btc in your individual addresses into a single new address through n transactions and then spend that new address with another transaction? I could have to pay the transaction fee up to 31 times for a single payment to somebody.

--

Honestly I've gone over a dozen sites, wikis, etc and this stupid question isn't answered anywhere, directly or otherwise. What I know about it (addresses can only spend the coins they control and a transaction has only 1 source and 2 destinations) conflicts with reason (only needing to pay for 1 transaction since you control all the addresses that control btc you want to spend).

  • Your first misunderstanding: a transaction can have between 1 and 1000s of inputs, and between 1 and 1000s out outputs. Those inputs can spend from coins assigned to one or multiple addresses. Those outputs can send to one or multiple addresses. – Pieter Wuille Mar 2 '17 at 19:39
  • @PieterWuille perfect clarification, thanks – Marnes Mar 2 '17 at 19:46
1

a transaction has 1 source address

That is not correct. A transaction may have any number of inputs, so it can spend the results of any number of previous transactions involving any number of addresses. See https://en.bitcoin.it/wiki/Transaction.

Here is an example of a transaction with 4 inputs.

If you want to make a large payment using transactions from your 30 different addresses, you can make a transaction with 30 inputs. Your Bitcoin wallet will handle this for you; if you try to make a payment of a larger amount than any single previous transaction contains, it will automatically select as many transactions to use as inputs as are needed.

Each additional input makes the transaction larger, and fees are based on the size of a transaction, so a transaction with 30 inputs will require a higher fee than one with 1 input. However, it should be less than the fees to make 30 separate transactions.

1

As Nate and Pieter already mentioned, you can have up to 1000 inputs from various addresses.

Another point I'd like to clarify is that your situation wouldn't be changed by having all your bitcoins in one address much (except for the privacy implications) as each transaction creates unspent transaction outputs which are tracked separately. There is no "address balance", rather that is an abstraction to talk about all the UTXO that you control. Whether these UTXO are associated with the same address or different addresses makes no difference for the structure of a new transaction.

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.