From Transaction to Blockchain

Blockchain, mining, proof of work, full node. I believe that for a new user this may be too much information. So let’s summarize it and track our transaction. What exactly happens after pressing the send button?

Right after sending, your transaction spreads across the Bitcoin network. The transaction is sent to the first node in the network, which verifies it and then forwards it to other nodes. This process repeats until the entire Bitcoin network receives the information. At this moment, however, the transaction is still unconfirmed – it has not yet been included in any block.

Before it reaches the blockchain, it is first placed into the mempool – the place where all transactions that have not yet been processed by miners are stored. Here they are sorted according to the transaction fee – the higher the fee you pay, the more likely it is that your transaction will be processed sooner.

Now it is the miners’ turn. Their task is to select transactions from the mempool and assemble a new block. Each miner tries to create the most profitable block – logically, they mainly choose transactions with higher fees, because they receive a direct reward from them. I would like to remind you that a block has a size limit, meaning not all transactions will fit. The remaining unprocessed transactions must wait to be included in the next block.

The miner assembles their block in this way. Now the most demanding part begins – proof of work. Miners are trying to find the correct number – the so-called nonce, which, together with the other block data, creates a hash that meets the requirements of the Bitcoin network. This process is based purely on randomness – the more computational power a miner uses, the higher the chance of success.

When one of the miners finally finds the correct solution, they immediately announce their new block to the entire Bitcoin network. Other nodes in the network verify this block. They check whether all transactions in the block are valid, whether there is any attempt at double spending, and whether the block hash meets the required criteria. If everything is correct, the block is added to the blockchain and the transactions in it become officially confirmed.

This process – from sending the transaction, through the mempool and mining, to the final confirmation – is the heart of the Bitcoin network.

But what if two miners find the block solution at the same time? In that case, the network temporarily splits – two versions of the blockchain are created, each with a different latest block. This situation is called a fork. Both chains are valid, but the network will eventually decide which one survives.

There is a simple rule – “the longer chain wins.” Miners continue working, and when one of these two chains is extended by another block, it becomes the official version of the blockchain. The block that was not part of the winning chain is called an orphan block – its transactions return to the mempool and wait for new processing.

Basically, we can say that all transactions will sooner or later be confirmed and recorded in a block. However, if you are sending or receiving a larger amount of funds, it is better to wait for six confirmations (six blocks). Why six? Because with every additional block, the probability that the transaction could be reversed (for example due to a chain reorganization) decreases exponentially.

Of course, you don’t always have to wait that long – for everyday payments it is enough to wait for the first confirmation, which usually takes around 10 minutes. Does that feel too long? Think about how long you sometimes wait for money sent from another bank, another country, or even another continent. In the case of Bitcoin, distance plays no role – we are all equal.

The 51% Attack

We have already said that the Bitcoin network is decentralized, which means that there is no central authority deciding which transactions are valid and which are not. Transaction validation is distributed across thousands of nodes worldwide. For a new block to be considered valid, it must be approved by the majority of the network.

This system makes Bitcoin extremely secure, because no single person or organization can arbitrarily change the rules or falsify transactions. However, there is a hypothetical threat called the 51% attack.

A 51% attack occurs when a single person or group of miners gains control of more than half of the Bitcoin network’s total hash rate (computing power). If this happened, that entity could theoretically manipulate the network:

  • the attacker could prevent certain transactions from being included in new blocks, effectively censoring them,
  • the attacker could perform a double-spend attack – they could create a transaction, spend bitcoins, and then secretly rewrite the blockchain so that the transaction never existed.

Even with 51% control, the attacker could not steal bitcoins from other users or change Bitcoin’s fundamental rules (such as the 21-million supply limit).

Let’s imagine an example:
The attacker sends 10 BTC to an exchange and exchanges them for dollars. Meanwhile, they secretly mine an alternative blockchain where this transaction does not exist. After withdrawing the dollars, the attacker publishes their longer alternative chain. According to the “longest chain rule,” the Bitcoin network accepts this chain as valid, meaning the transaction disappears. The attacker keeps both the bitcoins and the withdrawn money – this is a successful double-spend.

Is this threat real?

In the early years of Bitcoin, this concern was much more realistic because the network had far less computational power and a single miner or a small group could gain dominance.

Today, however, the probability of a successful 51% attack is extremely low. The reason is simple – Bitcoin mining requires an enormous amount of energy and highly specialized hardware. An attacker would need to invest billions of dollars into equipment and electricity.

Even if the attacker gained majority hash power, full nodes could still reject fraudulent blocks. In reality, it would be far more profitable for the attacker to simply collect mining rewards than to risk everything for a double-spend.

Bitcoin is designed to be resilient, secure, and decentralized. If a real threat of a 51% attack ever appeared, the community could react quickly and modify the protocol to prevent such a scenario.