How do Bitcoin transactions work?

Bitcoin was created to function as peer-to-peer electronic cash. Whether you are spending or accepting bitcoin as payment, it is prudent to understand how a transaction works.

Bitcoin transactions are messages, like email, which are digitally signed using cryptography and sent to the entire Bitcoin network for verification. Transaction information is public and can be found on the digital ledger known as the 'blockchain.' The history of each and every Bitcoin transaction leads back to the point where the bitcoins were first produced or 'mined.'

Table of Contents

  1. Public and private keys
  2. Transaction inputs and outputs
  3. Broadcasting and confirmations
  4. Why do some bitcoin transaction confirmations take so long?
  5. How much are bitcoin transaction fees?
Bitcoins exist as records of Bitcoin transactions

We define a bitcoin as a chain of digital signatures. Each owner transfers bitcoin to the next by digitally signing a hash of the previous transaction and the public key of the next owner and adding these to the end of the coin. A payee can verify the signatures to verify the chain of ownership.

— Satoshi Nakamoto, Bitcoin Whitepaper

Bitcoins do not "exist" per se. There are no physical bitcoins, nor do Bitcoin owners have an "account." Instead, there's a 'blockchain,' which you can think of as a ledger, or a record, of all the transactions that have ever taken place between Bitcoin addresses. These transaction records are updated by the Bitcoin network participants (nodes) and shared across each of its nodes as balances increase and decrease. You can use a 'block explorer' if you want to see the history, as well as current balance, of any given Bitcoin address.

Public and private keys

To send Bitcoin, you must have access to the public and private keys associated with the amount of bitcoin you want to send. When we talk of someone "owning" bitcoins, what it actually means is that person has access to a 'key pair' comprised of:

  • a public key (an address) to which some amount bitcoin was previously sent
  • the corresponding unique private key (a password) which authorizes the bitcoin previously sent to the above public key (address) to be sent elsewhere.

Public keys, also called bitcoin addresses, are randomly generated sequences of letters and numbers that function similarly to an email address or a social-media site username. As the name implies, they are public, so you are safe sharing them with others. In fact, you must give your Bitcoin address to others when you want them to send you bitcoin. The private key is another sequence of letters and numbers, also generated randomly. However, private keys, like passwords to email or other accounts, are to be kept secret. Never share your private key with anyone that you do not 100% trust to not steal from you.

Read more: Make sure your digital assets are safe with these simple tips.

You can think of your Bitcoin address as a transparent safe. Others can see what's inside, but only those with the private key can unlock the safe to access the funds within.

Transaction inputs and outputs

Although it would be possible to handle coins individually, it would be unwieldy to make a separate transaction for every cent in a transfer. To allow value to be split and combined, transactions contain multiple inputs and outputs. Normally there will be either a single input from a larger previous transaction or multiple inputs combining smaller amounts, and at most two outputs: one for the payment, and one returning the change, if any, back to the sender

—Satoshi Nakamoto, Bitcoin white paper

Let's break down that section of the Bitcoin white paper by looking at a sample transaction in practice:

Mark wants to send 1 BTC to Jessica. To do this, he uses his private key to 'sign' a message with the transaction-specific details. This message, which must be broadcast to the network, will contain the following:

  • Inputs. This contains information about the bitcoin previously sent to Mark's address. For example, imagine Mark previously received 0.6 BTC from Alice and 0.6 BTC from Bob. Now, in order to send 1 BTC to Jessica, there might be two inputs: one input of 0.6 BTC previously from Alice and one input of 0.6 BTC previously from Bob.
  • Amount. In this case, the amount Mark wants to send is 1 BTC.
  • Outputs. There are outputs. The first is 1.2 BTC (0.6 BTC + 0.6 BTC) to Jessica’s public address. The second is 0.2 BTC returned as 'change' to Mark.

This might seem confusing, but it's done this way to improve efficiency - and the good news is that knowing the behind-the-scenes details of Bitcoin transactions is not required to send or receive bitcoin. Your Bitcoin Wallet takes care of that!

Broadcasting and confirmations

In the above example, Mark (via his wallet software) will broadcast his proposed transaction to the Bitcoin network. A special group of participants in the network known as 'miners' verify that Mark's keys are able to access the inputs (i.e. the address(s) from where he previously received the bitcoin he claims to control. Miners also gather together a list of other transactions that were broadcast to the network around the same time as Mark's and form them into a block. Any miner who has completed the 'Proof of Work' is permitted to propose a new block that will be added or 'attached' to the chain and by referencing the last block. That new block is then broadcast to the network. If other network participants (nodes) agree it's a valid block (ie. the transactions it contains follows all the rules of the protocol and it properly references the previous block), they will pass it along. Eventually, another miner will build on top of it by referencing it as the previous block when proposing the next block. Any transactions that were in the previous block will now have been 'confirmed' by the next miner. As blocks are added to the chain, the number of confirmations of Mark's transaction increases.

Why do some bitcoin transaction confirmations take so long?

Each block can only contain a certain number of transactions, and that number is determined largely by the space available in each block, or the 'block size,' which is 1MB. The limited space gives rise to the fee market, where miners, who collect fees, choose to include in the next block only those transactions which have included a high enough fee. Thus higher fees act as incentive for miners to prioritize your transactions.

Note that the block size is an arbitrary limit, but the Bitcoin community has chosen to keep the block size as small as possible in order to make it easier for people to operate Bitcoin nodes. Bitcoin Cash, which is a fork of Bitcoin, has a larger block size and therefore requires (much) lower fees for transactions.

Read more: Understand how the Bitcoin network decides on critical issues like the block size.

How much are bitcoin transaction fees?

Fees for sending bitcoin could be anywhere from a few cents all the way up to $100. The reason for the big variation is that Bitcoin fees depend on both supply and demand (ie. how congested the network is at a given time) and the "size" of your transaction. Size is affected primarily by inputs, so if your transaction has many inputs, it will take up more block space, and demand a higher fee. For example, if you want to send 10 BTC, there's a good chance your transaction will require more inputs than if you want to send 1 BTC. The 10 BTC transaction might consist of 5+2+1+1+1 (so a total of 5 inputs) while the 1 BTC transaction might be just two inputs as in our Mark/Jessica example above.

Many wallets, including the Bitcoin.com Wallet, allow users to manually set transaction fees. This helps you to avoid overpaying. For example, if you're not in a rush, you can set the fee the lower such that it will be picked up by a miner when the network is less congested. You can also ensure your transactions are processed immediately by increasing your fee.

Read more: Understand the ins & outs of sending bitcoin.

Was this helpful?

Related guides

Start from here →
Learn the basics

Get a simple introduction to Bitcoin and why it matters.

Read this article →
How do crypto exchanges operate?

How safe is it to store your crypto on centralized exchanges?

Read this article →
What is Bitcoin governance?

How does the network operate and decide on critical issues?

Read this article →
What is Bitcoin?

Bitcoin is based on the ideas laid out in a 2008 whitepaper titled Bitcoin: A Peer-to-Peer Electronic Cash System.

Read this article →
What is Bitcoin Cash?

Bitcoin Cash is a decentralized peer-to-peer electronic cash system that does not rely on any central authority like a government or financial institution.

Read this article →
Start from here →
Start investing safely with the Bitcoin.com Wallet
Over 20 million wallets created so far

Everything you need to buy, sell, trade, and invest your Bitcoin and cryptocurrency securely

Bitcoin.com in your inbox

A weekly rundown of the news that matter, plus educational resources and updates on products & services that support economic freedom