Skip to main content
Splyt Genesis

Crypto markets, protocols and policy

Bitcoin transaction inputs: how wallets combine UTXOs

Why does a Bitcoin transaction have multiple inputs? A wallet combines UTXOs when one cannot cover the payment and fee; leftover value returns as change.

The Splyt Genesis Desk

Bitcoin transaction inputs: how wallets combine UTXOs

A Bitcoin transaction has multiple inputs when a wallet combines several unspent transaction outputs (UTXOs) to cover a payment and its fee. Bitcoin records spendable value in separate outputs, rather than as one account balance, so a wallet may need to spend more than one.

Why can a Bitcoin transaction need multiple inputs?

Each input spends one UTXO created by an earlier transaction. It identifies that output with its transaction ID and output index. A wallet can show you a single balance, but that balance may be made up of several separate UTXOs.

Each UTXO is spent as a whole. If you spend more than the payment and fee require, the extra value usually returns to your wallet in a change output. For the underlying term, read TeleSwap's plain explanation of a Bitcoin UTXO. A TeleSwap deposit uses the same basic structure: your wallet selects enough UTXO value for the deposit and network fee.

Take an illustrative wallet with two UTXOs: 0.4 BTC and 0.3 BTC. To pay 0.6 BTC, one UTXO is not enough, so the wallet can use both as inputs. It creates an output for the recipient and, if the fee is less than 0.1 BTC, a change output for the remainder after the fee.

Before the transaction, the wallet controls the two original UTXOs, worth 0.7 BTC in total. After it is confirmed, those UTXOs are spent. The recipient has a new 0.6 BTC output, and the wallet has a new change output worth 0.1 BTC minus the fee. The value has moved into new outputs, with the fee paid to the miner.

Why do Bitcoin transaction fees depend on transaction size?

Bitcoin fees depend partly on transaction size in virtual bytes (vbytes). More inputs generally make a transaction larger because each input adds data that must be included and verified. At the same fee rate, a larger transaction usually costs more to send.

That means a wallet may face a trade-off when choosing UTXOs. Combining several small ones can cover the payment, but it can also increase the transaction size and fee. The fee rate and the transaction’s size affect the final fee; input count is one factor in that size.

What happens to Bitcoin change after a transaction?

Bitcoin change becomes a new UTXO assigned to a script your wallet can spend later. It is not a refund of one original input: the transaction spends the old UTXO and creates new outputs for the recipient and, when needed, your wallet.

In the 0.4 BTC plus 0.3 BTC example, the two original outputs are no longer spendable after confirmation. The 0.6 BTC payment and the change output are the new spendable outputs. Your wallet can use that change in a future transaction, either alone if it covers the amount and fee or alongside other UTXOs.

Related

  • A wallet combines UTXOs when one output cannot cover the payment and fee.
  • Spending a UTXO can create a payment output and a change output; more inputs can increase transaction size and fee.