Bitcoin Guide - How a Bitcoin transaction occurs #Part3

Bitcoin Guide - How a Bitcoin transaction occurs #Part3

By Roberto D. | CryptoFarm | 20 Feb 2020


How a Bitcoin transaction occurs

So far we have explored how digital signature allows authorizing transactions, but let's see how the nodes keep track of the balance of the accounts linked to each individual.

And here comes the fun part, in reality there is no track anywhere on the balance! But then how can you tell if an individual A has enough BTC when he requests to send another individual B?

Instead of keeping track of the balance, the verification is done by linking the current transaction to the previous transactions.

To send 5 BTC to B, A must report other transactions where it has received 5 or more BTC.

The transactions that are reported in this mechanism are called inputs.
The other nodes that verify the (current) transaction will also check the inputs to see if A has received 5 or more BTC.

Below is a figure that specifies the mechanism of reference to previous transactions as input.

A figure specifying the mechanism for referring to previous transactions as input.

Let's take an example of a real transaction.

The transaction to which we refer can be viewed at the following address: https://blockexplorer.com/tx/a117c441aa5bd3fcb442e3c47a180c584420bcd9f93c68dab9feddd1d26b767e

Example figure below:

351665157-ffa98afaeec56305d252dbf98395aed8670a420b508df1696746cc8c9b25be9d.png

There are 6 inputs to this transaction, for a total of 139,616 BTC. In the outputs instead there are 2 transactions.
The first is a transaction that returns back to the sender as "rest", this is because the output you want to send is less than the sum of the inputs and therefore we must receive the difference back.

Thanks to these inputs that are reported for each transaction, a sort of chain is formed thanks to which possession of the BTC is transmitted, where the validity of each transaction depends on the validity of the previous transactions.

How can we trust previous transactions?

I can't trust a priori and I have to check their inputs too.
For this reason, the first time you install a wallet for Bitcoin (wallet software where your BTCs are kept), this software verifies the validity of every transaction carried out so far, going back to the first transaction.

We must always keep in mind that since we are dealing with complete strangers it is good to do all the necessary checks.
This process can take a long time (only if you use a desktop wallet software) but the verification up to the first transaction must be done only once.

A transaction, once used, is considered as "already spent" and cannot be used again, otherwise someone could report it again giving rise to the problem of double spending.

In fact, when the nodes verify a transaction, they must also verify that the inputs have not already been spent.
That is, the nodes must verify all other transactions to be sure that the inputs have not already been used.

This may seem very time consuming, but is actually made faster by an index of transactions not yet spent.

Therefore instead of keeping track of account balances, a giant list of transactions is tracked in Bitcoins: having Bitcoins simply means that there is a transaction in this list that has your address as recipient and that has not yet been spent (i.e. it is not used as input in any other transaction).

To get the balance of your account (address), therefore, just scroll through the list of transactions and add all those that have their address as recipient and that have never been used as input.

Another relevant fact regarding transactions: complex transactions that do not concern only a recipient address can be sent, for example mechanisms such as that of escrow can be used.

In the outputs, as we have seen previously, there are not 2 simple addresses but a kind of mathematical puzzle that must be solved.

Sending money with bitcoins is very similar to putting them in a safe and attaching a mathematical puzzle that acts as a key to opening.

The puzzle is made in such a way that only the owner of a public key can solve it, but there may also be more complex conditions: in the case of the escrow, 2 out of 3 signatures may be necessary to carry out the transaction.

Another example is the first transaction made through Bitcoin (January 3, 2009) which was in fact a puzzle that anyone could solve.

 

 


Useful/Stonks link ALL TRUSTED:

My Exchange:

Airdrop/Giveaway:

Faucet:

Cloud Mining FREE:

Earn for internet connection:

How do you rate this article?

1


Roberto D.
Roberto D.

Born, and still living, in Italy. Passionate about cryptocurrencies since I discovered ethereum in 2016 https://linktr.ee/robertod


CryptoFarm
CryptoFarm

All about crypto and airdrop

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.