Bitcoin was designed to be peer-to-peer electronic money. It is important to fully understand the process of a bitcoin transaction, regardless of whether you are accepting or spending it.
Bitcoin transactions are messages that are digitally signed with cryptography using email. They are sent to the entire Bitcoin network for verification. The ‘blockchain’ digital ledger, which contains transaction information, is open to the public. Each transaction in Bitcoin has a history that goes back to the moment when the bitcoins were created or mined.
Bitcoins are 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. Bitcoin owners do not have an account or physical bitcoins. Instead, you have a “blockchain”, which can be thought of as a record of all transactions between Bitcoin addresses. As balances change and increase, these transaction records are kept up to date by participants in the Bitcoin network (nodes). They can be shared among all nodes. If you would like to view the history and current balance of any Bitcoin address, you can use block explorer.
Public and private keys
You must have to access the public and private keys that correspond to the bitcoin amount you wish to send to be able to send Bitcoin. If someone is referred to as “owning” bitcoins it means that they have access to a key pair consisting of:
- A public key is an address to which bitcoins were previously sent.
- The corresponding private key (a passcode) authorizes bitcoin to be sent to another address (public key) previously sent to it.
Public keys are also known as bitcoin addresses. They are random sequences of letters or numbers that are generated randomly and function in a similar way to an email address, username, or social media account. They are public and can be shared with anyone, as their name suggests. You must share your Bitcoin address with others if you want them to send bitcoin to you. Another sequence of numbers and letters, called the private key, is also randomly generated. Private keys like passwords for email and other accounts must be kept secret. You should never share your private keys with anyone you don’t trust 100% do not steal them.
Your Bitcoin address can be thought of as a transparent safe. While anyone can see the contents, only the owner of the private key has access to the safe and can open it to access the funds.
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 look at an example transaction to see how it works in practice.
John would like to send 1 BTC directly to Mary. He uses his private key for this purpose. The following information must be included in the message that is broadcast to the network:
- Inputs. These contain information about bitcoins that John has received previously. Imagine John receiving 0.7 BTC and Matt previously sending him 0.7 BTC. To send 1 BTC to Mary you might need to input 0.7 BTC from Matt, and 0.7 BTC from Will.
- Amount. John would like to send 1 BTC.
- Outputs. The first is 1 BTC sent to Mary’s home address. The second is 0.4 BTC which was returned to John as ‘change.’ The second output is the sum of all inputs (0.7 + 0.7 =1.4), minus John’s desire to send [1 BTC].
It might sound confusing, but this is done to increase efficiency. The good news is that you don’t need to know the details behind Bitcoin transactions to send or receive Bitcoin. This is what your Bitcoin wallet does!
Broadcasting and confirmations
John will transmit his transaction proposal to the Bitcoin network via his wallet software in the example above. The network’s special group known as “miners” verify that John’s keys can access the inputs (i.e. The address from which he received the bitcoins he claims to have. The block is also formed by miners who gather together other transactions broadcast to the network at the same time as John’s. Anyone who has completed the Proof Of Work is allowed to propose a block to be added to or ‘attached to the chain, referencing the previous block. The new block is broadcast to the network. If the network participants (nodes) agree that it is a valid block, (ie. They will forward it if they agree that the transaction it contains is compliant with protocol rules and properly references the previous block. It will eventually be built upon by another miner who refers to it as the previous blocks when proposing the next one. The next miner will have ‘confirmed” transactions from the previous block. The number of transactions confirmed by John increases as more blocks are added to this chain.
Why does it take so long for some bitcoin transaction confirmations?
A block can only hold a limited number of transactions. This number is determined by how much space is available in the block or the block size, which is 1MB. This limited space leads to the fee Johnet. Miners who make fees choose to include only transactions that have been charged a high enough fee in their next block. This is why miners are more likely to prioritize transactions that have higher fees.
The block size is not a fixed limit. However, the Bitcoin community chose to keep it as small as possible to make it easier to run Bitcoin nodes. Bitcoin Cash is a fork that uses Bitcoin. It has a larger block and requires lower transaction fees.
What are the bitcoin transaction fees?
Sending bitcoin can cost anywhere from a few dollars to $100. Bitcoin fees are subject to both supply and demand. How congested the network is at any given time and how large your transaction is. Inputs are the main factor that affects size. If your transaction contains many inputs, it will take more space and charge a higher fee. If you send 10 BTC, your transaction will likely require more input. A 10 BTC transaction could have 5+2+1+1+1+1, which would be a total of 5 inputs. However, a 1 BTC transaction may only require two inputs like in the John/Mary example.
Wallet allows users to set transaction fees manually. This allows you to avoid overpaying. If you aren’t in a hurry, you can set your fee lower so that it is collected by miners when the network becomes less busy. Your fee can be increased to ensure that transactions are processed quickly.