The infographic below shows the key elements of a bitcoin transaction, from origination to appending a new block to the blockchain.
For more information about the report quoted in this post please visit: https://canadianpaymentsinsights.com
The following points provide important context for the transaction process:
- Bitcoin is an open source protocol that defines how transactions should be conducted and verified
- It works on the basis of a decentralized ledger
- Everyone in the Bitcoin system knows everyone else’s transactions
- No one in the system is trusted – they are all anonymous strangers
- Math-based functions protect every part of the system, which means that trust is not needed
- It is made up of bitcoin users – those who trade using bitcoins (either fiat or goods/services for bitcoins), and miners – those who verify transactions and create new currency (who are also likely to be users)
- Anyone can use the Bitcoin system and improve it (fork it). There have been hard forks which have created new virtual currencies.
- When a user creates a Bitcoin wallet, they generate a cryptographic key pair, made up of a private key, which is embedded in the wallet and a public key, which represents their Bitcoin address
- When a Bitcoin wallet is first set up it checks the validity of every transaction ever made
- The balance in the wallet is determined by examining inputs to the wallet, and inputs to those inputs, etc. A single balance figure is not maintained.
- The sender can include specific conditions in the script for onward transmission of funds, for example, two out of three signatures, before the funds can be unlocked (e.g. for escrow)
- If a user loses their private key (e.g. because of a hard drive crash without sufficient backup), the bitcoins owned by that user are lost to both the user and the Bitcoin system). Over time, then, it is likely that Bitcoin will be deflationary.
The Distributed Ledger
- An important aspect of the Bitcoin network is that everyone knows the complete transaction history of all bitcoins, and by implication, balances by account, in the ledger.
- The distributed ledger serves to place transactions in a temporal order so that double spending can be prevented.
- Each node maintains its copy of the ledger by adding transactions that have been verified to the ledger.
- In theory, trust is maintained by having all of the ledgers in the network in agreement.
- Miners are the ‘power users’ in the system that verify transactions and maintain the security of the Bitcoin system.
- They enter and leave the system at will.
- Each miner represents a node in the system.
- When a miner joins the system, they request a copy of the ledger from other nodes.
- They will adopt a ledger that they believe they can trust – i.e. it will be based on the majority of the ledgers they receive being in agreement.
- The cryptographic puzzle that miners must solve can only be solved by guessing the answer and seeing if it works.
- The more guesses that a miner makes, the more likely it is that they will be the first to solve the puzzle.
- The puzzle is computationally difficult and requires miners to invest in sophisticated hardware and energy to solve it. In other words, there is a cost to solving the puzzle, and solution of the puzzle constitutes ‘proof-of-work’.
- The time to solve a block in the Bitcoin system is in the neighbourhood of 10 minutes.
- As the processing power of hardware increases, the difficulty of the puzzle is adjusted. In the Bitcoin system the difficulty adjustment is made every 2016 blocks, which equates to every two weeks.
- When a miner solves the puzzle, they are rewarded with new bitcoins (currently at a rate of 25 per block), and the verified transactions in the block are added to the blockchain (with appropriate hashes)
- The verification and puzzle solution (with the guess, or nonce, that the miner used to solve the puzzle) is broadcast to the network so that other miners can verify that the winner did indeed solve the puzzle, and they add the new block to their copy of the blockchain
- The block added to the blockchain includes the hashes of the previous block (which has the hash of the block prior to that). If any participant in the network attempts to change any prior block, the hashes will change and the all subsequent blocks will be rejected.
- Every node in the network mistrusts every other node in the network and checks their calculations back to the origination of the blockchain, if necessary, to ensure that all of the security conditions (which might have arisen through an attempt to disrupt or defraud the system) are met.
- The recipient has access to funds once the block containing his or her transaction has been solved.
- After 6 blocks have been solved the recipient can be ‘reasonably sure’ that the transaction is valid.
- The further down in the chain that a block has reached (i.e. the older the confirmed block) the more secure the transaction is.
Thousands of developers are actively working on improvements, enhancements, modifications, upgrades, changes and bug fixes. Changes and challenges are debated freely in a myriad of open forums. Specific areas that are receiving priority include:
- Wallet security
- Improvements in the payments model – improvements in both the user and merchant experience (e.g. transaction accounting, etc.)
- Transaction fees, which could skyrocket as the limit of Bitcoin production is approached
Changes to the Bitcoin protocol and software are determined by majority rule, and they may take a while to propagate to all nodes (which has in some cases caused problems with different forks developing).
In principle it would be possible for a malevolent node to issue false verifications, either in its own interest (for example, to double spend coins), or to bring the network down. The Bitcoin system is designed to ensure that there is a cost associated with verifying transactions, and there has to be proof-of-work demonstrated to do so. Furthermore, miners are incentivized for verifying transactions through the issue of new currency, and in some cases a transaction fee. Much has been debated about the 51% attack, where 51% of the mining power is concentrated on a malevolent objective, and in theory this could have dramatic implications for the currency.
For more information on the reports referenced in this post please see https://canadianpaymentsinsights.com