How Bitcoin transactions work, from your wallet to a block
A Bitcoin payment is not a balance moving between accounts. It spends earlier outputs and creates new ones. Here is the anatomy of a transaction, a worked example with change, and the checks every node runs.

Photo: “Bitcoin, bitcoin coin, physical bitcoin, bitcoin photo” by antanacoins, CC BY-SA 2.0, via Flickr (edited: cropped and resized).
A Bitcoin transaction spends one or more unspent outputs (UTXOs) from earlier transactions and creates new outputs for the recipient and, usually, change back to you [1]. Your signature proves you may spend them, nodes check it, and whatever inputs exceed outputs is the miner’s fee [2].
Key points
- 1Your wallet balance is the sum of unspent transaction outputs (UTXOs) your keys can unlock, not a single account number.
- 2A transaction has inputs (old outputs being spent) and outputs (new amounts locked to addresses). Each output can be spent only once.
- 3Because a UTXO must be spent whole, most payments create a change output back to the sender.
- 4Fee = total inputs − total outputs. It is not a separate line; it is what you leave on the table for the miner.
- 5Once confirmed in a block, a transaction cannot be reversed — only refunded by the person who received it.
On this page
- What is a Bitcoin transaction, really?
- Why do UTXOs behave like cash?
- How do inputs, outputs, change and fees add up?
- How does a signature unlock an output?
- What happens after you press send?
- What does every node check?
- What is a transaction ID?
- Can a Bitcoin transaction be reversed?
- What mistakes do beginners make here?
- Frequently asked questions
- The bottom line
- Sources
What is a Bitcoin transaction, really?#
Wallet apps make it look as if bitcoin moves from one account to another. Under the hood it moves from transaction to transaction. Each transaction spends satoshis received in one or more earlier transactions, so the input of one transaction is the output of a previous one [2]. A satoshi is the smallest unit: one bitcoin is 100,000,000 satoshis [3].
Every transaction has at least one input and at least one output. Each output then waits as an unspent transaction output (UTXO) until a later input spends it [1]. The developer guide gives a concrete picture: when your wallet says you have a 10,000-satoshi balance, it really means 10,000 satoshis are waiting in one or more UTXOs that your keys can unlock [1].
| Part | What it contains | Plain meaning |
|---|---|---|
| Version | A 4-byte number | Which set of rules to validate it with |
| Inputs | Reference to an earlier output (txid + index) and an unlocking script | “I am spending this coin, and here is my proof” |
| Outputs | An amount in satoshis and a locking script | “This much now belongs to whoever can meet these conditions” |
| Locktime | A block height or time | The earliest moment it may be added to a block |
Field meanings from the bitcoin.org developer guide. The locking script is called a pubkey script; the unlocking data is a signature script or witness.
Why do UTXOs behave like cash?#
Glassnode’s documentation compares UTXOs to banknotes. You can hold $50 as one note or as five $10 notes; either way it is $50. And just as you cannot tear a corner off a $10 note to pay for a $3.75 coffee, you cannot send part of a UTXO: you spend the whole thing and receive change [4]. In their example, someone holding a single 10 BTC output who wants to pay 3.75 BTC sends the whole output, the recipient gets 3.75 BTC, and 6.25 BTC returns as a new, smaller output [4].
That returning amount is a change output. The developer guide explains that few people hold UTXOs exactly matching what they want to pay, so most transactions include one, and it strongly recommends sending change to a new address rather than reusing the old one [1].
How do inputs, outputs, change and fees add up?#
The rule is simple arithmetic. If a transaction’s outputs add up to more than its inputs, it is rejected. If the inputs add up to more than the outputs, the difference can be claimed by the miner as the transaction fee [2]. There is no separate “fee” field: you set the fee by choosing how much change to give yourself.
| Step | Value |
|---|---|
| Input 1 (earlier output Alice received) | 300,000 sats |
| Input 2 (another earlier output) | 250,000 sats |
| Total inputs = 300,000 + 250,000 | 550,000 sats (0.0055 BTC) |
| Output 1: to Bob | 400,000 sats (0.004 BTC) |
| Output 2: change to Alice’s new address = 550,000 − 400,000 − 2,000 | 148,000 sats |
| Fee = inputs − outputs = 550,000 − 548,000 | 2,000 sats |
Neither input could cover 400,000 sats alone, so the wallet combined both. After this transaction confirms, both old outputs are spent forever and two new UTXOs exist: Bob’s and Alice’s change.
How does a signature unlock an output?#
Each output is locked by a small script. For the most common classic type, pay-to-public-key-hash (P2PKH), the lock says, in effect, that anyone may spend the output if they present a public key that hashes to the stored value plus a valid signature from the matching private key [1]. To spend it, your wallet provides your full public key and a signature made with your private key.
The signature does more than prove ownership. It also covers the transaction’s other details — which outputs are being spent, where the money goes and how much — so nobody relaying it across the network can tamper with them [1]. Our guide to public keys, private keys and addresses explains the key pair behind this.
What happens after you press send?#
Life of a Bitcoin transaction
After signing, your wallet broadcasts the transaction to the peer-to-peer network, and each peer and miner validates it independently before passing it on or putting it into a block [1]. Until a miner includes it, it sits in the mempool of each node that accepted it. Once it is in a block it has one confirmation, and every later block adds another; how many you should wait for is covered in blocks and confirmations.
What does every node check?#
- The inputs exist and are unspent
A payment is valid only if it spends UTXOs; trying to spend an output twice is a forbidden double spend [2].
- The scripts succeed
Each unlocking script must satisfy the locking script of the output it spends — for P2PKH, the right public key and a valid signature.
- The amounts balance
Outputs may not exceed inputs. Whatever is left over is the fee.
- Local policy is met
Nodes also apply relay rules, such as a minimum fee and a maximum standard size of 400,000 weight units in Bitcoin Core [5].
The double-spend check is the heart of Bitcoin. The whitepaper describes an electronic coin as a chain of digital signatures, and explains that the only way to be sure an earlier owner did not spend the same coin twice is for transactions to be publicly announced and for the network to agree on one order [6]. The blockchain is that agreed order.
What is a transaction ID?#
Every transaction is identified by its txid, the double SHA-256 hash of the transaction [7]. Block explorers use it to look a payment up, and inputs use it (together with an output number) to say which earlier output they spend. If someone asks for “proof of payment”, the txid is what you share; it reveals nothing secret.
Transaction rules at a glance
Can a Bitcoin transaction be reversed?#
No. bitcoin.org states that a Bitcoin transaction cannot be reversed; it can only be refunded by the person who received the funds [9]. Before confirmation there is a narrow exception: a sender can sometimes replace an unconfirmed transaction that opted in to replacement with a higher-fee version [10]. That is one reason bitcoin.org rates zero confirmations as safe only if you trust the person paying you [9]. Once a transaction is buried under blocks, the only way back is the recipient’s goodwill.
What mistakes do beginners make here?#
- Thinking “I have one balance”
Your wallet adds up many UTXOs. That is why a payment can show several inputs and why the fee can depend on how many small UTXOs you hold.
- Panicking about the change output
Seeing an unknown address receive part of your payment is normal: it is usually your own change address, generated by your wallet.
- Treating “sent” as “settled”
A broadcast transaction is only a request. Until it is in a block it has zero confirmations and could still be replaced or dropped.
- Sending to an address you have not double-checked
There is no undo. Compare the first and last characters of the address and, for large amounts, send a small test first.
Frequently asked questions#
Does a bigger payment cost a bigger fee?
Not directly. Bitcoin fees depend on the transaction’s size in bytes, which rises with the number of inputs and outputs, not with the amount sent [1].
Why did my wallet use several inputs?
Because no single UTXO was large enough. The wallet combined several, as in the worked example above, and returned the surplus as change.
Can I cancel a transaction I just sent?
Only before it is confirmed, and only if your wallet supports replacing it with a new version. After confirmation it is final.
Where can I see my transaction?
Paste the txid into any public block explorer. Every transaction is stored publicly and permanently [9].
What is a coinbase transaction?
The first transaction in every block, created by the miner to collect the block reward. Its outputs cannot be spent for at least 100 blocks [2].
The bottom line#
A Bitcoin transaction is a small, signed recipe: spend these earlier outputs, create these new ones. Change and fees fall out of simple subtraction, and every node re-checks the recipe before accepting it.
Understanding UTXOs makes wallet screens far less mysterious. Continue with transaction fees explained to see how the fee is priced, or compare Bitcoin’s design with Ethereum’s in UTXO vs account model.
Sources#
Grade A = primary source (regulator, protocol specification, client code, original author). Grade B = expert secondary source used for explanation only.
- Abitcoin.org developer documentation. Developer Guide: Transactions, 2026.
- Abitcoin.org developer documentation. Developer Guide: Block Chain, 2026.
- ABitcoin Core (GitHub). src/consensus/amount.h (COIN, MAX_MONEY), 2026.
- BGlassnode Docs. UTXO vs. Account-Based Chains, 2026.
- ABitcoin Core (GitHub). src/policy/policy.h (mempool and relay policy defaults), 2026.
- ASatoshi Nakamoto. Bitcoin: A Peer-to-Peer Electronic Cash System, 2008.
- Abitcoin.org developer documentation. Bitcoin Developer Glossary, 2026.
- ABitcoin Core (GitHub). src/consensus/consensus.h (MAX_BLOCK_WEIGHT, COINBASE_MATURITY), 2026.
- Abitcoin.org. Some things you need to know, 2026.
- ABitcoin Improvement Proposals (GitHub). BIP 125: Opt-in Full Replace-by-Fee Signaling, 2015.


