區塊鏈上的交易是突破性的發明之一，它使比特幣成為第一種去中心化的加密貨幣。成功的主要原因是因為中本聰解決了 ‘雙花‘ 的問題。如果您是比特幣的接收者，如何確定沒有將其發送給其他人？有效地在先前的交易中（或更多）發出相同數量的比特幣或加密貨幣。
中本聰透過 點對點 網絡技術，將交易用''哈希''作時間標記 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.
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.