Bitcoin Transactions How do they work and what should you consider?

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 by means of cryptography and sent to the entire network for validation. Also, since transactions on the Bitcoin network are public, they can be easily found within its blockchain. And in it, each and every transaction can be verified since the creation of the first bitcoin.

How are the transactions shaped?

Now, you will surely wonder what elements make up a Bitcoin transaction. Well, these elements are the following:

  1. Inputs. Inputs are references to an output from a past transaction that has not been used in any other transaction. These allow us to confirm the origin of the assets that will be used in a transaction and are the ones that contain the address where the bitcoins were originally received.
  2. Outputs. These contain the address to which the transfer is made and the amount sent. In addition, they contain the directions of change or return where the returns of the transactions are sent, so that a transaction can contain more than one output.
  3. Identifier (TXid). Each transaction made will have its own hash. This hash is generated from the inputs and outputs. This value is what makes it possible to identify a transaction in a unique and unrepeatable way within a blockchain.
  4. 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 output, since the miner who will receive that fee is not known. To do this, what is done is leave a certain amount without associating it with any output, and this will be understood as a commission for the miners.

In the following image we can see each of these sections within a bitcoin transaction.

Parts or sections of a Bitcoin transaction from Bit2Me Block ExplorerPartes o secciones de una transacción de Bitcoin desde el explorador de bloques de Bit2Me

How a transaction works

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 security. At all times, this data goes through a cryptographic hashing process and 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 Bitcoin transactions currently respond to this scheme:

OP_DUP OP_HASH160 b2089ebaad05c87a6d714cc33fbaa8cf181a4e30 OP_EQUALVERIFY OP_CHECKSIG

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 owns control of an address with 1 bitcoin. If she only wants to send Pedro 0,3 bitcoins and the concept of “inputs” does not exist, there would be no way for the system to know what part of that 1 is the 0,3 sent, and it can be resent. For this reason, there is the concept of inputs, 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:

return bitcoin addressesdirecciones bitcoin retorno

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  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, keeping 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, which are nothing more than a random set of numbers and letters without a definite pattern. The private key is what allows us to sign and send a transaction as owners of certain bitcoins, while the public address works like an email address or a bank account number where we are going to make or receive the transaction.

Types of existing transactions in Bitcoin

Coinbase

A coinbase transaction is one that allows miners to generate or activate new cryptocurrencies, with which they can receive mining rewards. In the case of Bitcoin, the first transaction made was called a coinbase. And it was not carried out from one person to another, but rather it was carried out 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 What is coinbase transaction?

UTXO

UTXOs are unspent coins. In the Bitcoin protocol, transaction inputs (inputs) are also called UTXOs from a previous transaction. That is, outputs from a transaction that are not spent or used. And they basically contain the change or returns product of 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 transaction with a higher mining commission in which the UTXOs of an unconfirmed transaction are moved. This is to make the parent transaction that generates them commit faster.

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 highly advanced and random mathematics. Thus, the address (the public key) follows a determined 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.

I send bitcoin transactionsenvio transacciones bitcoin

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.

Xổ số miền Bắc