Lhe transactions (also sometimes called TX) are an essential and indispensable part in the operation of cryptocurrencies as Bitcoin. These represent the backbone of this entire crypto payment system. And they are the ones that allow us to use and enjoy our funds quickly, safely and easily.
Therefore, knowing what a transaction is and how it works is of vital importance to understand and know how cryptocurrencies operate. Besides that this knowledge will help us to understand in a better way, the infinite possibilities that this system offers us every day.
In a basic concept, a transaction is a shipment or transfer of a value between two parties. In Bitcoin, these transactions can be understood as the sending of bitcoins between various people who use the network. But in reality, all these transactions are nothing more than records stored within the blockchain Bitcoin. In other words, a flow of information.
So Bitcoin transactions are simple messages that contain information. Messages that can be programmed AND digitally signed through cryptography and sent to the entire network for validation. This is the reason why they say that Bitcoin is programmable money. Also since transactions on the Bitcoin network are public, they can be easily found within your blockchain. And in it, each and every transaction can be verified since the creation of the first bitcoin.
Now you will surely ask yourself: How do these transactions work and how far can they take us? Well, discover that and much more below.
How do Bitcoin transactions work?
Bitcoin transactions are understood as the sending of bitcoins from one person to another using the Bitcoin network. At this point, all of these transactions are nothing more than records kept on the blockchain. The same principle also applies to other cryptocurrencies such as Ethereum, Dash o Bitcoin Cash.
Now, to carry out these transactions we need a client for the cryptocurrency, better known as purse or wallet. These are nothing more than a piece of software that allows us to manage our funds. Thanks to them we can send and receive cryptocurrencies, that is, carry out or receive transactions that originate from a certain blockchain.
If you want to know what wallet options you have to manage your funds, at Bit2Me we have this excellent article prepared for you. But continuing with our previous point, to understand how transactions work it is important to first know how they are formed. That is what we will study next.
How are the transactions shaped?
Now, you will surely wonder what elements make up a Bitcoin transaction. Well, these elements are the following:
Inputs. Entries are references to an output from a past transaction that has not been used in any other transaction. These allow us to confirm the provenance of the assets that will be used in a transaction. And they are the ones that contain the address where the bitcoins were originally received.
Outputs. These contain the address to which the transfer is made and the amount shipped. They also contain the directions of change or return where the returns of the transactions are sent. So in a transaction it can contain more than one output.
Identifier (TXid). Each transaction made will have its own hash. This hash is generated from the inputs and outputs. This value is what allows to identify a transaction in a unique and unrepeatable way within a blockchain.
Commission rate. The fee is the small payment miners receive for processing a transaction. Thus, the miner that generates a new block will receive a fee for each transaction processed within said block. The commission does not come explicitly in the content of a transaction, that is, it is not associated with any exit, since the miner who will receive that fee is not known. For this, what is done is to leave a certain amount without associating any output, and this will be understood as a commission for the miners.
Cryptocurrency transactions all have the basic structure shown above. This structure has a curious design, with entrances and exits, but with a very specific objective: to maintain safety. At all times, this data goes through a cryptographic process of hash y asymmetric cryptography. This is what makes the information can be properly secured and validated.
In Bitcoin, this process that makes all of this possible is handled by the Bitcoin scripting. This is nothing more than a powerful programming language that makes it possible for Bitcoin to have enormous potential. Thus, and although its potential is very great, the vast majority of transactions in Bitcoin currently respond to that scheme:
This scheme is repeated to some extent in other cryptocurrencies, but of course each of them have their peculiarities that can improve or facilitate the handling of transactions.
An example of how a transaction works in Bitcoin
Imagine that Maria is in control of an address with 1 bitcoin. If you only want to send Pedro 0,3 bitcoins and the concept of "entries" did not exist, there would be no way that the system could know which part of that 1 is the 0,3 sent and can be forwarded. For this reason, there is the concept of entries, to which the bitcoins that arrive at an address are associated.
In this way, enough tickets are collected to reach the desired amount. If to reach 0,3 you have had to select 3 inputs of 0,12 each, the result being 0,36, the remaining 0,06 are sent to your own address, indicating it as the output next to the address to which you are assigned. I wanted to send 0,3.
That is, we would have this scenario of inputs and outputs:
The proper address where the remaining 0,06 BTC is sent can be the same address associated with the inputs or a new one. This is called direction of change o return address. It is where the laps are sent.
It is also important to understand that in the same transaction there can be as many entries from the same address, or several, as desired. The same goes for the exits. This allows multiple shipments to different people with a single commission payment to the miners in the same transaction. This functionality is exploited by some wallets to save costs.
Internally, the protocol for rewarding miners comes from funds that are not allocated to any address. All remaining bitcoins in a transaction that are not assigned to any address the miner keeps them that mine the block with your transaction inside and they are impossible to recover.
So, with these points clear, to carry out a transaction on the Bitcoin network, the issuer must have access to both the public addresses and the private keys associated with those bitcoins. They are nothing more than a random set of numbers and letters without a defined pattern. The private key is the one that allows us to sign and send a transaction as owners of certain bitcoins. While the public address works as an email address or a bank account number where we are going to make or receive the transaction.
Types of existing transactions in Bitcoin
A coinbase transaction is one that allows miners to generate or activate new cryptocurrencies. With which they can receive the rewards of mining. In the case of Bitcoin, the first transaction made was called a coinbase. And it was not performed from one person to another, but rather that it was performed by the same network as a generating transaction. Through which the entire Bitcoin system was brought to life.
Mining nodes can add only one coinbase transaction for each new block generated. Thus, the system ensures that the miner receives only the reward that corresponds to him and that new coins that have never been inside the blockchain come into circulation.
In the coinbase, the fees of the transactions processed by the miner are also added. So this type of transaction contains the sum of the block mining reward plus the commissions of the processed transactions. It is generally located as the first added transaction within a new block.
If you want to go deeper into this interesting topic, we invite you to take a look at our article Which is a coinbase transaction?.
UTXOs are unspent coins. In the Bitcoin protocol, transaction inputs are also called UTXOs from a previous transaction. That is, exits from a transaction not spent or used. And they basically contain the change or returns resulting from a transaction.
For example, if you have 1 BTC in your wallet, these are likely to come from multiple UTXOs. Which can be 4 of 0.25 BTC each. If you want to spend a total amount of 0.30 BTC on any product, you will see that you do not have any UTXO with that specific amount. Although your wallet will show a balance of 1 BTC in total to simplify things.
The truth is that UXTOs cannot be divided. So when you trade for 0.30 BTC, what you are actually sending is 0.50 BTC (2 UTXOs in this case). And your wallet creates two exits: one for the merchant who you are going to cancel the 0.30 BTC and one for you with 0.20 BTC How do I change or turns. The existence of the UTXO is what allows the operation of transactions Child Pays for Parents (CPFP). This is a higher mining commission transaction in which the UTXOs of an unconfirmed transaction move. This is to make the parent transaction that generates them be confirmed more quickly.
What is the process to create transactions that send cryptocurrencies?
To send cryptocurrencies you need two things: one address and a private key. Both parts are managed by the cryptocurrency wallet or wallet.
First of all, the address is actually the public key of the private key of the owner of the cryptocurrencies. It can be, for example, the keys that give access to some bitcoins. What makes these keys so secure is that they are both a sequence of letters and numbers generated by means of very advanced and random mathematics. Thus the address (the public key) follows a specific and unrepeatable pattern that begins with the character "1". The fact that it starts with one indicates that it is a Bitcoin address and not another type of cryptocurrency. Of course, each cryptocurrency has a first character that differentiates it from the rest.
In turn, the private key is generated from a unique and unrepeatable seed that you or the software you use automatically assigns to you. The fact that they are unique and unrepeatable guarantees that no person has identical keys and is an essential part of security. In this way, brute force attacks that could jeopardize our funds cannot be carried out.
The outline of this process would be more or less the following.
But going back to the scenario of Maria and Pedro, we have that when María wants to send bitcoins to Pedro, she uses her key or private keys to sign each one of the entries of the transaction (the origin). This is done transparently by the wallet, that is your task.
For example, Bitcoin uses asymmetric public and private key encryption. In this way, the nodes they can quickly validate if the transaction is authorized by its holder. For this, they can corroborate the validity of the source address, which is the public key, as we have previously said. Once approved, this transaction is retransmitted and shared by all nodes in the network, registering it in their corresponding blockchains.
Some nodes are also miners. They will use that transaction along with thousands more to solve a mathematical problem. In this way, we can send Bitcoins (and other cryptocurrencies) completely safely and in seconds, anywhere in the world.
Falsifying a cryptocurrency transaction is impossible. Once a transaction has been issued, confirmed and added to the network, it cannot be altered or modified in any way. It is also not possible, for example, to indicate a transaction that does not exist, because the blockchain contains each and every one of these operations from the start of the network of said cryptocurrencies. In this way we can be sure that there is no way to fake a transaction in cryptocurrencies.
What if I only want to send part of a bitcoin or another cryptocurrency?
A concern of many who start the world of cryptocurrencies, is how to send a payment to a person, considering that the unit of many cryptocurrencies exceeds the value of a dollar or a euro. Well the trick is that many cryptocurrencies have the ability to divide and reach up to 8 decimal places. That is, they are capable of sending quantities as small as one hundred millionth of their value.
In Bitcoin, the units of account allow us a wide variety of micropayments. In fact, the smallest unit the "satoshi" (in honor of the creator of Bitcoin, the unknown "Satoshi Nakamoto“) Is the least value we can have in Bitcoin.
However, in Bitcoin there is a sending limitation that prevents sending values less than 546 satoshis (0,00000546 BTC), known as dust transactions. This is a measure of protection to the network to avoid dusting attacks on the network.
Similar measures apply to other cryptocurrencies, all created in order to avoid network congestion and attacks that can prevent it from working properly.
Advantages of Bitcoin transactions
While making a transaction through the traditional financial system requires hours or even days for approval or denial. In Bitcoin, everything is much faster, easier and cheaper.
It does not require intermediaries to process and approve the operations. Rather, your system is based on a network of interconnected nodes that validate the information contained in the transactions. Making the process much faster, safer and more reliable.
Once a transaction is made in Bitcoin and it is added to the blockchain, it is practically impossible to reverse or modify. Also, cancellations or refunds are not available in this system, after the transaction is made. Which generates a great advantage in various areas of the economy and finance.
Bitcoin transactions are made using public addresses and private keys. Where private keys give you the right to spend bitcoins as if it were a pin or password. And public addresses allow you to send or receive bitcoin transactions without the risk of theft.
The fees paid to miners to process a transaction are really low. This compared to the percentages requested by banks or other traditional systems.
A transaction with cryptocurrencies, regardless of the amount sent, can cost only a few pennies. Since commissions are not calculated based on the amount of the transaction, but based on the size of the transaction.