Lesson Ready to Start
Intermediate

Anatomy of a Transaction

Sign up or sign in to start lessons, track your progress, take quizzes, and earn achievements.

This lesson will guide you through the intricate details that make up a Bitcoin transaction, from its basic denominations to the final confirmation. Understanding the components and processes involved in a transaction is crucial for anyone looking to navigate the Bitcoin network effectively. Join us as we dissect the structure and lifecycle of a Bitcoin transaction.
Video length: 11 mins 25 secs

Comment below with questions, suggestions and corrections.

Go to Comments

Transcript

Greetings, Bitcoin adventurers! Today, we're diving deep into the heart of Bitcoin to unravel the anatomy of a transaction. Transactions are the lifeblood of the Bitcoin network, moving value from one entity to another. Let’s break down what is transaction is made of.

Blockchain Explorers
First let’s discuss an important tool that allows you to examine the Bitcoin network, the so called blockchain explorer. The explorer as it’s referred to in a shorthand, is typically a website that is backed by a so called “Bitcoin full node” that contains all the latest information about the Bitcoin blockchain. Here you can watch Bitcoin blocks being generated, and look inside the blocks to see the transactions with all their details. This tool is indispensable for a bitcoin user, and it’s worth checking out several of them as they all offer a slightly different UI and set of features. Some of the most popular ones are mempool.space, blockstream.info, and bitcoinexplorer.org.

In later courses you will learn how to run your very own blockchain explorer, so you don’t have to rely on third parties providing you blockchain information.

Transaction ID
The ID is a unique 64 character text, which you can use to look up the transaction on one of the bitcoin blockchain explorers.

Denominations in Bitcoin
Bitcoin's value is denoted in several denominations, offering flexibility across different scales of transactions and valuations.

The smallest denomination within the Bitcoin system is the "satoshi," named in honor of Bitcoin's pseudonymous creator, Satoshi Nakamoto. Various symbols have been proposed to represent satoshis, including "SATS", the so called kebab symbol, and more recently the well recognized Bitcoin symbol, which resembles an uppercase "B" intersected by two vertical lines. For everyday transactions the bitcoin community uses satoshis as the denomination.

One bitcoin, which is denoted with a lowercase "b" when referring to the currency to distinguish it from the Bitcoin network, denoted by an uppercase "B", consists of 100 million satoshis. The currency symbol for bitcoin is most often seen as "BTC," though "XBT" is also used in some contexts. This larger denomination is preferred for significant transactions and in financial analysis.

Two additional denominations, which have become less popular over time, include:

Millibitcoin or mBTC represents one-thousandth of a bitcoin, or 0.001 BTC, equating to 100,000 satoshis. It serves as a medium-scale denomination, convenient for transactions of moderate value.

Microbitcoin μBTC, also called "bit", equals to one-millionth of a bitcoin, or 0.000001 BTC. This denomination introduces a parallel to the "cent" in many fiat currencies, facilitating smaller transactions. Thus, 100 satoshis make up one "bit," offering a more intuitive way to handle minor amounts, such as converting 540 satoshis into 5.40 bits.

Additionally, the "milli-satoshi" is a conceptual denomination used primarily in second-layer solutions like the Lightning Network, where accounting for exceptionally small transaction values is crucial. In this context, one satoshi is divisible into 1,000 milli-satoshis, although this division exists only within these specific applications and is not part of the Bitcoin blockchain itself.

If necessary, you can find online tools that assist in converting different denominations.

Concept of UTXO
The concept of UTXO, which stands for Unspent Transaction Output, is central to understanding Bitcoin transactions. To demystify this, consider a typical Bitcoin wallet, which displays your balance as a single figure in either satoshis or bitcoins, based on your wallet's settings. This consolidated balance actually comprises one or more UTXOs.

UTXOs are generated whenever someone receives satoshis at their Bitcoin address. Each UTXO is associated with the recipient's Bitcoin address, which is derived from the public key and, indirectly, the private key that owns the address.

When you send satoshis, the Bitcoin wallet combines one or more of your UTXOs to total the amount you wish to send.

Wallets manage all this complexity for the user. Some wallets provide optional fine grained control over which UTXO to use when sending bitcoins, which can improve privacy.

Inputs and Outputs
Every Bitcoin transaction consists of inputs and outputs, which together define the movement of satoshis across the network.

Inputs are essentially references to UTXOs from previous transactions that are being used as the source of funds for the new transaction. Each input effectively says, "Here are the funds I am using to make this payment." A transaction must have at least one input, but can include multiple if the total value of a single UTXO is not sufficient to cover the amount being sent plus the transaction fee.

A common scenario involving numerous inputs is known as a "consolidation transaction." In this process, an individual aims to merge various Unspent Transaction Outputs (UTXOs) into a single UTXO. This consolidation can be motivated by several factors, such as the desire to lower future transaction fees or to simplify the tasks of accounting and monitoring. Additionally, consolidation occurs when transferring all funds from one wallet to another in a single operation.

Outputs specify the destinations of the satoshis from the inputs. Each output determines a certain amount of satoshis to be sent to a particular Bitcoin address. There are typically three types of outputs in a standard transaction:

  1. The recipient's address, which receives the specified amount of satoshis.
  2. The change address, which is usually an address controlled by the sender.
  3. The mining fee to process the transaction.

The number of outputs depends on the specific transaction's requirements. A simple transaction might have just three outputs mentioned earlier. However, transactions can also be more complex, with multiple recipients, in which case there would be more outputs.

Situations with many outputs typically occur when an exchange distributes funds to multiple customers simultaneously. If you've ever transferred funds from an exchange to your personal wallet, your address will probably be among the numerous outputs.

Change Address
Grasping the notion of "change" is crucial in the realm of Bitcoin transactions. Often, when you make a payment, the sum of the UTXOs you're using surpasses the total of the payment and the mining fee. The excess funds don't just vanish; instead, they're returned to you as "change." Your wallet automatically generates a new address for the change, and the returned satoshis become a new UTXO in your account. This step is vital for two reasons: it ensures that each UTXO is utilized just once for sending funds, and it complicates the task for anyone trying to trace the transaction by making it unclear which part of the transaction is the payment and which is the change.

For instance, imagine you have two UTXOs: one worth 1,000 satoshis and another worth 2,000 satoshis, and you wish to send 2,500 satoshis. Your wallet will merge these UTXOs, resulting in two inputs. It then creates three outputs: the 2,500 satoshis you're sending, a 100-satoshi mining fee, and 400 satoshis returned as change to your account, making the inputs and outputs tally up to 3,000 satoshis each.

When examining a transaction on a blockchain explorer, you can see every detail, including the inputs and outputs. This tool also allows you to trace the flow of funds by clicking on the addresses involved.

Transaction Fees
Transaction fees in Bitcoin serve as an incentive for miners to process and include your transaction in a block, acting much like a toll for utilizing the network's resources. These fees are not based on the amount of Bitcoin being transferred but are instead determined by the size of the transaction in bytes. Therefore, larger transactions incur higher fees.

Several elements can contribute to the enlargement of a transaction, resulting in increased fees:

  1. Transactions utilizing older address formats, specifically those not starting with "bc1," tend to be larger as they do not fully utilize the Bitcoin Segwit protocol upgrade benefits.
  2. Transactions with a high number of inputs or outputs significantly increase in size due to the additional data concerning the involved addresses.
  3. Embedding extra textual or image data within a transaction for storage on the Bitcoin blockchain greatly amplifies its size.

Fees are always paid in satoshis. To determine the amount of satoshis that needs to be paid as a fee, wallets need to know two pieces of information: the size of the transaction and the fee rate. The fee rate is denominated in sat/vB. The higher the sat/vB rate, the higher the priority of the transaction is to get into the next block.

Transaction Features
When you look up a transaction in a blockchain explorer, you will see various labels next to the Features section of a transaction, such as SegWit, Taproot, or RBF. Segwit and Taproot are advanced address formats.

RBF stands for Replace By Fee. This feature allows the wallet to increase the fee of a transaction if necessary because the blockchain is too busy. This is not the only way users can accelerate a transaction. We will discuss this and other methods in more detail in later lessons.

Views: 438

0 Comments

Please login to post comments.