How do Bitcoin transactions work? Bitcoin and crypto transactions are carried out through a sequence of digital signatures in a chain. We validate Bitcoin and Crypto transactions through nodes in the network. Each block that follows the transaction on the blockchain provides further confirmation.
Transactions on the blockchain are one of the groundbreaking innovations which makes Bitcoin the first viable decentralised crypto currency. This is largely due to the fact that Satoshi solved the ‘double-spend‘ problem. Meaning if you’re the receiver of Bitcoin, how can you be sure it hasn’t been sent to someone else first? Effectively spending the same amount of Bitcoin or Crypto in a prior transaction (or more).
Satoshi’s solution to this is through a peer-to-peer network which time stamps transactions by hashing them into an ongoing chain of hash based proof-of-work, which forms a record that cannot be changed without redoing the proof-of-work. The longest chain not only serves as proof of the sequence of events witnessed. But also proof that it came from the largest pool of CPU power. As long as a majority of CPU power is controlled by nodes that are not cooperating to attack the network, they’ll generate the longest chain and outpace attackers. Proof of work is covered in the mining section.
Satoshi defines an electronic coin or Bitcoin as a chain of digital signatures. Each owner transfers coins to the next by digitally signing a hash of the previous transaction. Also by adding the public key of the next owner to the end of the coin. Furthermore a payee can verify the signatures to verify the chain of ownership. (See Encryption & Wallet for explanation of hash, digital signatures, and public vs private keys).
Below is a graphic for Bitcoin Transactions as described in their ‘White Paper‘:
The historical solution to ‘double spend’ is to introduce a central authority (banks) or mint to check every transaction. This is the centralised 3rd party trust system. This solution is problematic as it is subject to hacks, corruption and fraud. Any past financial crisis will indicate how unsafe your money is when managed or kept by someone else. The Beauty of Crypto Currency is the lack of need to trust, and the ability to self verify.
Each time a Bitcoin transfer takes place, it’s broadcasted by the sender and nodes will perform its own validation ensuring the transaction is valid. Therefore validation checks multiple factors, for example:
- Checks the sender has the amount of Bitcoin they would like to transfer
- Validate the ownership of said Bitcoin
- Checks the receiving address is valid to receive Bitcoin
If the transaction is not valid, the node will drop it. If the node concludes that it is a valid transaction, it will propagate throughout the network. Then the transaction will end up in the queue of miners. When they mine the transaction it forms the latest block in the blockchain. Each subsequent block after it serves as confirmation. 2 blocks after the block that contains your transaction is a +2 confirmation. +6 confirmation is considered secure and irreversible. However, it all depends on the threshold set by individuals and businesses.
Small negligible transfers can be considered complete as soon as it can be seen on the network. Bigger value transfers such as exchanges and other businesses, would often wait for 6 or more confirmations. Because the consequences of double spend is way more severe.
NOTE: It is possible for a transaction to never be mined – this will be explained in the Mining section.
Input / Output:
If you look into any Bitcoin transaction, it’ll consist of Input and Output. Either a single input from a larger previous transaction or multiple inputs combining smaller amounts. Consequently, the transaction also has two outputs: one for the payment, and one returning the change, if any.
It is also possible to send multiple payments to different addresses through “sendmany” Command although most wallets do not currently support this. An example of single transaction to multiple addresses would be mining pool payouts.