In our previous article (How Do Bitcoin Transactions Work?), we delivered a basic understanding of how bitcoin transactions occur. Its time now to go more in detail and explore the various complexities of a bitcoin transaction.
Its important to understand that your bitcoin wallet (if you have one) doesn’t store your bitcoins. Bitcoin is not a physical entity like cash, coins or stock. Bitcoins do not exist on a hard drive, spreadsheet, bank account or a server. Actually, it is registered as a transaction. The blockchain can be conceived as a record of transactions between several bitcoin addresses.
According to Satoshi Nakamoto, the inventor of Bitcoin:
“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.”
So, your bitcoin wallet doesn’t hold bitcoins, but your bitcoin address. This address contains a log of all your transactions, hence your balance. Your bitcoin address is a lengthy string of 34 letters and numbers combined. This is also called your “public key.” Now, each address, or public key, also has a “private key” which contains a combination of 64 letters and numbers. This private key is secret and is supposed to be kept safe and secure by its holder.
Also, it’s important to know that a private key cannot be derived from the public key. A private key is used to “sign” a transaction issued from a bitcoin address, by inputting the private key and transaction details (number of bitcoins sent and to whom) into a bitcoin software that exists on a laptop, PC or smartphone.
Once this information is entered, the software will produce a digital signature that will be transmitted to the bitcoin network for the transaction to be verified. This transaction verification process confirms that the sender owns the bitcoins and is transferring them to another address and that the amount has not already been sent to a previous address. This is executed by inputting the signature and the public key into the bitcoin program. The clever part is that had the signature been composed by using the private key which corresponds with the public key, the program would verify the transaction without identifying the private key.
The network then scans your address history and verifies that you have not previously spent the amount you are transferring. The network can do this since it knows your address (public key) and because all transactions are publicly recorded on the bitcoin ledger.
What happens after verification?
After validation, your transaction is then added into a “block” next to other transactions. Now each block contains, along with other data, a hash of the preceding block. So, what is a hash?
A hash is formed by a “hash function” which is an intricate mathematical equation that condenses text or data into a 64-character string. It should be noted that this minimization is not a random production, as repeated input of that specific data will bring forth the same 64-character string. However, even if a single character is altered (e.g. a comma), a different 64-character string is generated. And that is how the blockchain verifies that a particular transaction has not been altered.
Therefore, if any tampering of the previous block will alter the hash of the current block. So, in order to transform anything in the previous block, the current block’s hash will also have to be changed, as the present inclusion is now incorrect. This is a very difficult endeavor because before you may have successfully changed the current block’s hash, a new block will have been added on top of the current one, which will also have to be altered. That is why the blockchain is fool-proof.