Introduction to Bitcoin Transactions
In simple terms, a transaction tells the network that the owner of a number of bitcoins has authorized the transfer of some of those bitcoins to another owner. The new owner can now spend these bitcoins by creating another transaction that authorizes transfer to another owner and so on in a chain of ownership.
Bitcoin Transactions as Ledger Entries
Transactions are like lines in a double-entry bookkeeping ledger. In simple terms, each transaction contains one or more “inputs” which are debits against a bitcoin account. On the other side of the transaction, there are one or more “outputs” which are credits added to a bitcoin account. The inputs and outputs (debits and credits) do not necessarily add up to the same amount. Instead, outputs add up to slightly less than inputs and the difference represents an implied “transaction fee” which is a small payment collected by the miner who includes the transaction in the ledger.
Proof of Ownership in Transactions
The transaction also contains proof of ownership for each amount of bitcoin (inputs) whose value is transferred in the form of a digital signature from the owner which can be independently validated by anyone. In bitcoin terms, “spending” is signing a transaction that transfers value from a previous transaction over to a new owner identified by a bitcoin address.
Movement of Value in Transactions
Transactions move value from transaction inputs to transaction outputs. An input is where the coin value is coming from, usually a previous transaction’s output. A transaction output assigns a new owner to the value by associating it with a key. The destination key is called an encumbrance. It imposes a requirement for a signature for the funds to be redeemed in future transactions. Outputs from one transaction can be used as inputs in a new transaction thus creating a chain of ownership as the value is moved from address to address.
Alice’s Transaction at Bob’s Cafe
Alice’s payment to Bob’s Cafe utilizes a previous transaction as its input. In the previous chapter, Alice received bitcoin from her friend Joe in return for cash. That transaction has a number of bitcoins locked (encumbered) against Alice’s key. Her new transaction to Bob’s Cafe references the previous transaction as an input and creates new outputs to pay for the cup of coffee and receive change. The transactions form a chain where the inputs from the latest transaction correspond to outputs from previous transactions. Alice’s key provides the signature which unlocks those previous transaction outputs thereby proving to the bitcoin network that she owns the funds. She attaches the payment for coffee to Bob’s address thereby “encumbering” that output with the requirement that Bob produces a signature in order to spend that amount. This represents a transfer of value between Alice and Bob.
How Bitcoin Works : Transactions, Blocks, Mining, and the Blockchain in 2024
Common Transaction Forms
Simple Payment Transaction
The most common form of transaction is a simple payment from one address to another which often includes some “change” returned to the original owner. This type of transaction has one input and two outputs.
Aggregation Transaction
Another common form of transaction is a transaction that aggregates several inputs into a single output. This represents the real-world equivalent of exchanging a pile of coins and currency notes for a single larger note. Transactions like these are sometimes generated by wallet applications to clean up lots of smaller amounts that were received as change for payments.
Distribution Transaction
Finally, another transaction form that is seen often on the bitcoin ledger is a transaction that distributes one input to multiple outputs representing multiple recipients. This type of transaction is sometimes used by commercial entities to distribute funds such as when processing payroll payments to multiple employees.