Bitcoin is the very first cryptocurrency ever. All transactions have always been neatly recorded on the blockchain. These are publicly viewable, from the latest transactions, probably a second ago, back to the very first block ever. By now, countless users worldwide have made Bitcoin transactions at least once or twice.
But how does such a transaction work? In this article, we discuss how a transaction gets from point A to B in the Bitcoin network.
The blockchain is like a ledger
What is important to know is that Bitcoin is not actually sent or received. Not physically, but not digitally either. Instead, transactions are recorded on Bitcoin's blockchain.
The blockchain is the fundamental data structure that drives the Bitcoin network. This blockchain is best compared to a ledger: a list in which all mutations in data are consistently recorded. This "database" is not manipulable by anyone.
What is transmitted, however, are the changes in the blockchain that determine who owns what amount. The receiving and sending addresses are called public keys, each linked to a private key used to sign and execute transactions. In other words, no actual bitcoins are sent, only changes to the database.
What does a Bitcoin transaction consist of?
A Bitcoin transaction has three main components: the input, the quantity, and the output.
- The input is the Bitcoin address from which someone wants to send Bitcoin. This address must already have BTC on its balance, otherwise there is nothing to send.
- The output is the receiving address. This address is allowed to have an empty balance.
- The quantity is the amount someone wants to send from A to B.
A transaction may have multiple inputs and outputs. As long as the amount of the inputs is greater than the amount of the outputs, the transaction is valid.
To "send" Bitcoin, the sender signs a message containing the transaction data with their private key. This message contains the inputs, outputs, and amount. After this, nodes verify that the input address has sufficient funds to send the transaction.
The transaction, after being sent to a node, is passed through the network until it reaches a mining node. A miner will eventually ensure that the transaction goes into one of the next blocks. Once confirmed, this block is immutable and is passed on to all other nodes in the network so they can include a copy of it in their copy of the blockchain.
Time is money
The Bitcoin network uses transaction fees, which can be set at different levels. These fees are paid to encourage miners to confirm some transactions faster than others. The more fees someone sends along, the more likely the transaction will be completed soon.
A transaction is immediate: it is immediately visible on the network and in the mempool, waiting for confirmation. However, confirmation may take a while. How long this takes depends on the fees sent along, the hashrate, and how busy the network is. Generally, it takes about an hour.
The information provided in our articles is intended solely for general informational purposes and does not constitute (financial) advice.