Bitcoin Transactions: How Do They Work?

January 31, 2019 Quick read

Bitcoin is the most popular cryptocurrency there was and from the looks of it, it definitely looks like this crypto supremo is not going anywhere for a while. Here’s why you should know how Bitcoin transactions actually work.

In the crypto world, it is simple. Bitcoin is the ruler and the rest of the crypto sectors love this digital currency. And everyone has a good reason to.

Bitcoins are fast, reliable and secure. The price value is mouth-watering. And Online Bitcoin Exchanges are seemingly only being transitioned more and more with time. Having an idea about how Bitcoin transactions will always be favourable to you especially if you are a part of the crypto industry. A quick buck is not only palpable but extremely equitable when it comes to Bitcoin.

Also if you are someone who is curious about what goes down when a Bitcoin transactional exchange is instigated or simply looking to develop new Blockchain innovations with Bitcoin, it’s great to be in flow and actually know what is happening on the Bitcoin network. After all, a little knowledge never hurt anyone.

Allow us to paint a brighter picture.

Bitcoin transactions are the bottom pillars that supports the Bitcoin blockchain once it has been forged on it. Bitcoin transactions are not very complex, on the contrary developers can manage to get by easy and code transactional forms that can even be customized. That is because Bitcoin transactions are a beautiful myriad of non-complex data structures, non-turing scripting and brilliant cryptography.

Before you plan to set out on a Bitcoin venture, it is important to analyse certain transactional prospectives. How does the recent transaction triggered by you is posted to the Bitcoin network by the client that you are associated with? What happens once someone receives it?

This post is a more active, extensive insight to Blockchain and a Bitcoin network. It will involve cognizances to Cryptography, Hashing and Peer-to-Peer networking. Let’s see.

Bitcoin Transactions: A Breakdown

A Bitcoin is an amalgamation of two important sections: The nodes and a Blockchain. A simple node handles the Blockchain version and updates it timely when a newer, longer version is introduced.

To keep it simple, the Blockchain is a haven of blocks and these blocks have Bitcoin transactions taking place.

So what exactly is a transaction fabricated from? How can one send a Bitcoin to someone?

A simple pay-to-PK-hash transaction is the sole perpetrator for about 99% transactions that sanction over the Bitcoin blockchain. It is like a typical banking scheme. You send a Bitcoin to a person, the person will receive the money that was to be sent and you on the hand, only have access to the balance that was left over.

Although this is different than what happens in real life, no money is sent back to the sender and nothing is added to the remaining balance in case there is any. This indicates that the Bitcoin has its own inputs and outputs. Without further ado, let’s peep into the insights.

Bitcoin transactions: An Insight                             

Bitcoin transactions look like your basic everyday transaction. When you break open a Bitcoin transaction, you will see three things foremost – A header, the input and the output.

The header, input and output collectively give shape to a raw transaction; raw transactions happen when a simple transaction between two peers happens, it gets broadcasted on a live Bitcoin network.

The Header

·       hash: The hash that exists and is stable throughout the entire Bitcoin transaction. The header is an amazing way to check the integrity of the data where the hash values confirm the identities.

·       lock_time: The lock_time is basically the earliest time that can get a free block to be added on the Blockchain. The block will hold the date and the transactional details involved. The lock_time is described in block height or unix timestamp.

·       ver: The ver describes the version of the transaction; the number that highlights the version will be used to verify the block. The most recent version became functional in December 2015 and was imported through a soft fork.

·       vin_sz: The vin_sz describes the total number of inputs associated with this particular Bitcoin transaction. Likewise, the vouz_sz counts the total number of the outputs.

The Input(s)

·       previous output hash: The previous output hash is a pointer that specifically points to a former Unspent Transaction Output (UTXO). Also, the money that is going to be spent by you for this transaction is contained in this output.

·       n: A detailed index that tabulates an outputs list of the former transaction, the actual output to be spent is highlighted here.

·       scriptSig: A permission slip, this spending script showcases if the person who has initialized the Bitcoin transaction is awarded permission to spend the money or not.

The Output(s)

·       value: The amount of Satoshi involved in the Bitcoin transaction where 1 BTC = 100,000,000 Satoshi. A satoshi is the smallest unit of Bitcoin.

·       scriptPubKey: The second script involved in a Bitcoin transaction, this script points to a relevant hashed public key of the recipient.

Verification of Bitcoin Transactions

Keeping a tab on the transactions is necessary, the Bitcoin node has to crosscheck and verify if the transactions incurred are genuine; there should be no data redundancy, Cryptocurrency Exchange tampering or unwanted people on the Blockchain.

Ø  Every single output that has been warranted by an input involved in the Bitcoin transaction is present in the UTXO pool. The outputs that have never been spent are only valid to be warranted once.

Ø  If the scripts conjointly return a true value post execution then it indicates that every signature on each input of the transaction is valid.

Ø  Every UTXO can only be spent once in a lifetime during the particular Bitcoin transaction.

Ø  Every Bitcoin transaction output value is positive.

Ø  The total sum of all the inputs involved in the transaction is higher than the total sum of all values of the outputs.

pay-to-PK-hash transaction

Every Bitcoin owns a custom scripting language that is so robust that most Blockchain developers when familiar with the system, can create their own custom transactions.

The first thing that is required in every transaction is that it should be true, this can be achieved by a combined scriptSig/scriptPubKey that is accessed during the transaction. First, the scriptSig should be executed and later the scriptpubKey of a warranted transactional output should follow lead as both of these scripts are allotted to a singular stack. The truth is that Bitcoin addresses are in reality, hashes that make it hard for every sender to know the difference between a public key and a private key.

When the execution time finally occurs, the involved constants are arranged in the same stack as soon as they concur. As for operations, as soon as the evaluation process commences, the unwanted items are detached from the stack.

The pay-to-PK-hash is an extremely forthright transaction type, only the Bitcoin deliverer possessing an appropriate key (private or public) can claim the transaction and finally, spend the Bitcoin. Once, all the standards are set and above objectives, met; your transaction is deemed genuine to be a placed into a block for a standard Bitcoin Exchange picturised exactly the way you wanted it!