• Hash256
  • Hash160
  • Reverse Bytes
  • Hexadecimal
  • Satoshis

Sending

Making your first bitcoin transaction.

You’ve got some bitcoin. Now you want to move them to a different address.

To do this you need to make a transaction.

1. How do you make a transaction?

This is the same for any bitcoin wallet you use:

  1. Enter the address. This is where you want to “send” the bitcoins.
  2. Enter the amount. The amount of bitcoins you want to send. Will most likely be in BTC or Satoshis.
  3. Set the fee. (optional) This sets the “priority” for how quickly the transaction will become finalized.

Then just click “send” and you’re done.

All wallets have roughly the same functionality.

From here you’ll just be waiting for the transaction to get confirmed

Note: When you send the transaction your wallet should give you a TXID, which is like a unique reference number for the transaction. You can use it to check the transaction’s status on a blockchain explorer.

2. What happens when you make a bitcoin transaction?

When you click “send”, your wallet sends your transaction in to one of the nodes on the bitcoin network. From here it gets relayed from node to node until every node on the network has a copy of your transaction.

Nodes relay transactions to other nodes.

At first, your transaction gets stored in the memory pool of each node, which is like a temporary “waiting area” for transactions that have been recently broadcast across the network.

Every node has their own memory pool.

After roughly 10 minutes, one of the nodes on the network will add the latest transactions from their memory pool on to their blockchain, and share this new block of transactions with the other nodes.

Nodes verify new blocks of transactions before adding them on to their blockchain.

As a result, each of the nodes has updated their blockchain to include the latest transactions on the network. These transactions have now been confirmed.

The blockchain is permanent storage for bitcoin transactions.

Lastly, this process repeats itself so that new blocks of transactions are continuously being added to the blockchains on the network at regular 10-minute intervals.

So in summary, after you make a transaction you are basically waiting for it to be added to the blockchain, which is referred to as being “confirmed”.

3. How does a transaction make it in to the blockchain?

Each node has the opportunity to try and add the transactions from their memory pool on to their blockchain. This process is known as mining.

To add transactions on to the blockchain, a miner gathers transactions from their memory pool in to a container called a candidate block. From here, the node uses energy to try and “mine” this block on to the top of the blockchain.

Miners must work to try and add a new block on to the blockchain.

Tip: Any node on the network can become a miner. But it’s cool if you just want to be a node (and not mine blocks).

As a result the mining process is basically a network-wide competition, where any node on the network has a chance of mining the next block. A node that can mine faster has a better chance of mining the next block, but the process of mining is unpredictable, so no single node is in control of adding blocks to the blockchain.

Any of these miners could be the one to mine the next block on to the blockchain.

After about 10 minutes (on average), one of the mining nodes will eventually mine the next block and share it with all the other nodes. Each node then checks the block (to make sure it has been mined correctly) and adds it to their blockchain.

Nodes across the network update their blockchain with the newly-mined block.

Now everyone has the latest block. From here, each miner contructs a new candidate block (with new transactions from the memory pool) and starts trying to mine the next block on to the chain.

So in summary, miners are constantly working to extend the blockchain with new blocks of transactions.

Why do transactions have to be mined?

The mechanism of mining provides the following benefits:

  1. Prevents conflicting transactions from being written to the blockchain. If two conflicting transactions were sent in to the network (e.g. trying to send the same bitcoins to two different places), thanks to mining only one of those transactions will actually be written to the blockchain.
  2. Any node can mine the next block of transactions. Due to the fact that the mining mechanism is unpredictable, any node can be the one to add the next block, which means that no single node is in control of the transactions that get added to the blockchain.
  3. Transactions cannot be removed from the blockchain (easily). Mining a block requires energy, which makes it difficult for any individual to acquire enough energy to be able to mine blocks quickly enough to rewrite the blockchain.

All in all, mining is what allows multiple computers to agree upon the same copy of a regularly updating file, which is essential for a digital currency that depends upon having a shared ledger of transactions across computers.

See Mining for more details.

4. What are transaction fees?

A bitcoin transaction can include a sum of bitcoins as a fee. This fee will be collected by a miner, and acts as an incentive for miners to include your transaction in their candidate block.

Why?

Because a candidate block can only hold a certain amount of transactions (or data to be precise), so if a lot of people are making transactions at any given time, there may be more transactions inside the memory pool than can fit inside a block.

A block can hold about 1MB of transaction data1, but the memory pool can hold 300MB+2.

Therefore, miners will choose to populate their candidate blocks with transactions that have the highest fees on them, because they can collect these fees (via the coinbase transaction) if they are successful in mining the block.

Most miners want to make as much money as possible from mining.

Tip: The memory pool is like a queue, and the transactions with the highest fees are at the front.

So when there are a lot of transactions in the memory pool, the higher the fee you place on your transaction, the higher the effective “priority” that transaction has for getting included in a block.

A good wallet will allow you to set your own fee, and gives an estimate of how long it will take for the transaction to be mined.

When you set a fee on your transaction, you are effectively determining it’s position in the memory pool, and how quickly you’d like the transaction to be mined.

What fee should I put on my transaction?

This depends on how many transactions are currently in the memory pool.

Mempool Size:    22154 transactions (17.38 MB)
Candidate Block:  1950 transactions (1.34 MB)

A good wallet uses the current size of the memory pool to recommend various fee sizes based on how quickly you’d like your transaction to be mined.

Within 2 Blocks:   68 sat/byte
Within 3 Blocks:   68 sat/byte
Within 4 Blocks:   68 sat/byte
Within 5 Blocks:   65 sat/byte
Within 10 Blocks:  65 sat/byte
Within 25 Blocks:  59 sat/byte
Within 144 Blocks: 1 sat/byte
Within 432 Blocks: 1 sat/byte

I’m getting the fee estimates above using Bitcoin Core’s bitcoin-cli estimatesmartfee command. Many popular bitcoin wallets use this command to help provide suggestions for fees.

Note: These are just estimates. Nobody can guarantee when your transaction will get mined. More transactions could enter the network push you toward the back of the queue.

However, you can always choose to set your own custom fee on your transaction. You can check out the current status of the memory pool yourself and decide on a fee that you think will work best:

But in general:

Tip: Don’t put too high a fee on your transaction unless you really need to.

Note: Transactions are sorted by sat/byte, which is the size of the fee (in satoshis) divided by the size of the transaction in bytes. This is because miners want to get the most in fees for the amount of space each transaction takes up in a block.

What happens if I put too low a fee on my transaction?

By setting a low fee on your transaction you’re putting it at “the back of the queue” in the memory pool. This is fine, but it means that you’re going to be waiting for a quiet period where the the memory pool is cleared out so that your transaction can be included in a block.

Lower-fee transactions will eventually get included in a block if there are no higher-fee transactions left in the memory pool.

However, transactions will only stay in a node’s memory pool for 72 hours (usually3), and after this time period a node will remove the transaction from its memory pool. As a result, it’s like your transaction never happened.

Transactions only wait around in the memory pool for a set amount of time.

Warning: Don’t consider a bitcoin transaction as being final until it has been confirmed (i.e. mined in to the blockchain). Transactions in the memory pool may end up not being confirmed if the fee is low and/or there are lots of transactions being sent in to the network.

Tip: If your transaction doesn’t get mined within 72 hours, you can always re-insert it back in to the network for the chance to get mined again.

5. How many confirmations should I wait for?

A “confirmation” refers to your transaction getting mined in to a block. Additional confirmations are when further blocks are mined on top of the block your transaction was included in.

The number of confirmations is how deep your transaction is in the blockchain.

Why does this matter?

Well, I know I sait that you cannot remove a transaction from the blockchain, but it is technically possible. Due to the way blockchain works, a bad miner with a lot of mining power could use their energy to build a new longer blockchain for nodes to adopt, and replace blocks (and transactions) that are currently in the chain.

This has not yet happened in Bitcoin.

The deeper a transaction makes it in to the blockchain, the more exponentially difficult it becomes for a miner to remove it.

So this is why it’s commonly recommended to wait for 6 confirmations (or more) to be sure a transaction cannot be reversed, because at this point it’s no longer “computationally feasible” for a miner to replace that number of blocks. However, unless you’re protecting yourself from a bad miner performing an attack against the entire network, this is overkill.

A more reasonable amount of time to wait to be confident that a transaction isn’t going to be undone is 2 confirmations. This is just because the top block in the blockchain has a tendency to change around with another block during natural chain reorganisations.

Chain reorganisation happen roughly once every 37.4 days (once every 5,589 blocks)4.

So when your transaction makes it past the first block, you can be confident that it isn’t going to be undone via natural causes.

Chain reorganisations happen when two blocks are mined at the same time and compete for the same spot in the chain.

6. How can I check the status of my transaction?

One of the coolest things about bitcoin is you can use blockchain explorers to see the details of transactions as they’re in the memory pool or blockchain.

When you make a bitcoin transaction, your wallet should give you the TXID for that transaction. This is like a unique reference number for the transaction, and you can use it to find the transaction in a blockchain explorer:

Now, a blockchain explorer is basically just a website that acts as a window in to a bitcoin node. So by entering your TXID, you’re just asking the explorer to look in to its blockchain (or memory pool) and show you the details of a transaction it has received.

Block explorers just show you the data in their memory pool and blockchain.

I won’t cover all the details of what explorers can show you, but some of things I find most useful are:

Anyway, your wallet will probably tell you the basic information about your transaction (such as whether it has been confirmed or not), but a blockchain explorer allows you to dig in to the details of the transaction, which is pretty cool.

You can also find the transaction in your own Bitcoin Core node with: bitcoin-cli gettransaction [txid]

Summary

Here are my top tips:

You’ll get the hang of it after your first few transactions.

This has been one excellent guide (you’re welcome), but experience is the best teacher.


  1. A block used to only be able to hold 1MB of data, but the method for working out the amount of data a block can hold changed in July 2017 thanks to Segregated Witness. As a result blocks can now hold around 1.7MB of transaction data.↩︎

  2. Each node can set the maximum size of their memory pools with the -maxmempool option (default is 300MB).↩︎

  3. Each node can set how long they hold on to memory pool transactions for with the -mempoolexpiry option (default is 72 hours).↩︎

  4. You can see the number of chain reorganisations your node has experienced by running bitcoin-cli getchaintips and looking at the number of valid-forks. This data is based on my node which has been running continuously since 17 December 2016.↩︎

  5. Bitcoins can be locked up in a variety of different ways. See Script for more information.↩︎

By Greg Walker,

Last Updated: 21 Jul 2020
  • 21 Jul 2020: redirected and renamed files from /guide/ to /technical/
  • 13 Apr 2020: tooltip css class updates and /guide/address calculator from hash160
  • 28 Mar 2020: updated html for h1 headers and subheadings - now dynamic from yaml
  • 28 Mar 2020: updated html for h1 headers and subheadings
  • 28 Feb 2020: edit
  • 28 Feb 2020: edits
  • 27 Feb 2020: /beginners/sending - typos
  • 27 Feb 2020: /beginners/sending - live data in code blocks
  • 27 Feb 2020: /beginners/sending - fee estimate alignment
  • 27 Feb 2020: /beginners/sending - confirmations consistency
  • 27 Feb 2020: /beginners/sending - reversed fee estimate order
  • 27 Feb 2020: /beginners/sending - fix scientific format for feerate from bitcoin-cli
  • 27 Feb 2020: /beginners/sending - first draft
Back to Top

Hey there, it's Greg.

I'll let you know about cool website updates, or if something seriously interesting happens in bitcoin.


Don't worry, it doesn't happen very often.