Introduction.
Blockchain, which in Italian means “chain of blocks,” is a digital technology for the secure transfer of assets such as money. Often, people confuse the Blockchain system with the most famous virtual currency, Bitcoin (BTC), but let’s clarify that these are two different things:
- Bitcoin is a cryptocurrency based on Blockchain technology, on which other virtual currencies also rely.
- Blockchain is actually a meta-technology that uses various components such as hash cryptographic tools (sha512), public-key cryptography (RSA), shared protocols, distributed ledger technology (DLT), and P2P network.
Blockchain fundamentally solves the problem of transferring money between two entities differently than usual, but lately, we also hear about Metaverse in the context of cryptocurrencies and blockchain, from which it is deduced that this technology is currently in strong expansion.
The Blockchain structure is characterized, as the term itself says, by a chain of blocks, each of which contains different information depending on the type of application that uses it. The important aspect is that such information is bound together, and each block is linked to the previous one and partly also to the next one. The following figure illustrates this concept:

The initial block of the chain is called the “genesis block,” according to the application used, which in this case refers to the used cryptocurrency. The block can contain various information; in the case of Bitcoin, a block contains information about various transactions, particularly about who transferred the money and the recipient and the amount transferred. Obviously, the identities of the parties involved in the transactions are not clear and decipherable by the naked eye but are represented by their respective public key used by the asymmetric RSA encryption. A cryptographic key is nothing but an alphanumeric code of bytes used as input to the encryption algorithm to encrypt transactions in virtual currencies. To understand the potential vulnerabilities in the Blockchain system, it is necessary to thoroughly analyze its structure and how it works with blocks.
Blocks.
Each block seen in the previous figure basically contains:
- Data relating to transactions
- The hash of the previous block
- The hash of the current block
- Hash of the next block (inserted later but only as a reference and should not be included in the calculation of the hash of the current block).
These parameters represent a kind of fingerprint of the block itself, while to generate the “digest,” i.e., the output generated by the hash function, Blockchain uses the SHA-256 algorithm, which ensures its integrity, theoretically avoiding any manipulations of the data inside the block itself, if it were to happen, it would generate a different hash that would alert the system.
It is important to note from the beginning, but we will return to the topic later, that the SHA-1 algorithm was massively replaced with SHA-2 and SHA-3, after Google announced its violation through mathematical techniques of binary alteration, a category of attack of purely mathematical nature and probative calculation, whose correct term would be “Birthday paradox” attack. In reality, a violation of SHA-1 occurred a few years earlier, in 2005, when a team of Chinese cryptographers managed to generate effective collisions in the algorithm.
Resuming the discussion of the hash of the current block of the Blockchain, by “current” I mean the active one to distinguish it from the others, it is generated by providing the following parameters as input to the SHA-256 algorithm:
- Data relating to the transactions belonging to the current block
- Hash of the previous block
- A value called nonce (random number to be searched and tested through the Proof-of-Work)
As I said earlier, if an attacker modified the content of a block, the hash of that block would change, consequently invalidating all the hashes of the subsequent blocks. However, the attacker could still recalculate all the other blocks. In fact, it is not so complex to rework a series of hashes in order to regenerate a valid chain, but this reworking is made more complex by the so-called Proof-of-Work (PoW), which complicates this calculation.
Proof-of-Work (PoW).
Proof-of-Work (PoW) is a mechanism that slows down the creation of new blocks and, together with the massive use of hashes and asymmetric cryptography, allows for a high level of security in the Blockchain. Essentially, PoW is a computationally complex cryptographic problem, but the verification of the result obtained is very simple.
In practical terms, it consists of finding with consecutive attempts a random value called “nonce” such that the hash (using SHA-256 or later), of the data, transactions, the hash of the previous block, and the nonce itself is generated in such a way as to have a defined number of initial zeros (for example, 4 initial zeros: 0000HGD636…).
What does this sentence mean?
Nothing complex, it just means solving a cryptographic puzzle through the use of computing power provided by CPUs and GPUs, so increasing the number of zeros required for the hash to be validated also means increasing the degree of difficulty for Miners with PoW. As of the date of writing this article, this value should be set to 19 initial zeros.
Who solves this cryptographic puzzle?
The Miners of the Blockchain network.

Let’s see an example of an attack on this system.
Example of an attack on Blockchain.

We can see in Block #5 the three main parameters it contains:
- Transaction data (for example, €100,000),
- the hash of block #4
- nonce = p##@1
As mentioned before, the nonce is that random value sought through the mining operation with consecutive attempts such that it produces a valid (SHA-256) hash of the block, i.e., a hash that starts in this example with seven consecutive zeros 0000000P3X22A. The nonce and the hash found constitute the PoW solution for Block #5.
Similarly, Block #6 contains similar data:
- an example transaction of €350,000
- the hash of Block #5,
- the nonce = p##@1 is repeated, which also produces a valid hash in this block.
The same nonce and hash found also constitute the PoW solution for Block #6.
For Block #7?
Finding solutions of this type with these required zero settings is not a complex operation, but a considerable amount of energy is required for the necessary computing power.
This is just an example, but PoW could be further complicated with other applications based on the level of security that one wants to achieve.
To make a fraudulent modification to the input data of the hash algorithm, for example, increasing the transaction value in Block #5 from €100 to €100,000,000, will affect the correctness of the block’s hash, which may no longer be structured with seven initial zeros 0000000P3X22A and therefore be invalidated by the Blockchain system.
To achieve his goal, the attacker who has modified a transaction by appropriately manipulating a “mining” operation, must find a new nonce for the block in which he has made the modification, so that the PoW is verified again with the system of zeros.
Then the attacker should perform a new mining operation to find a new nonce for the next block, also verifying its PoW. He should also perform this operation for every block in the Blockchain, from the position where he intervened onwards.
This clearly demonstrates the concept of Blockchain and its ability to handle the immutability of data. If the attacker could recalculate all the PoWs of every Blockchain block, then his fake transaction could succeed. Generally, with the computing power at play, for the Bitcoin case, calculating a PoW takes about 15-30 minutes per block, but Blockchain security is guaranteed by the computational difficulty of the Proof-of-Work, and this level is further increased by using a Peer-to-Peer (P2P) network and a Distributed Ledger.
Ledger.
Each node in the Blockchain network has a synchronized and complete copy of the Blockchain itself (Distributed Ledger). The Ledger is decentralized and visible to all nodes, it is not held by any particular entity, nor by a central unit (Trusted-Third-Party), thus guaranteeing both security and the immutability of the register itself. The various nodes can enter and exit the P2P network, and each time a node returns, it receives an updated copy of the Ledger.
An attacker who has been able to recalculate Blockchain blocks (as in the previous example) should therefore also gain the consent of at least more than 50% of the P2P network nodes in order to make the fraudulent modification to Blockchain accepted as valid. If this does not happen, the nodes in possession of the false Blockchain copy will be reduced in number, and the anomalous Blockchain copy will be immediately discarded. The system, based on the P2P network and the concept of a public and distributed Ledger, is able to guarantee its own security autonomously without relying on third parties.
Quantum Collision Attack SHA256 and SHA512.
University researchers, computing centers, and other entities such as IACR, are studying this type of attack based on hash collisions exploiting probabilistic calculation and using Quantum computers for this purpose.
These innovative processors are able to significantly improve the execution time of calculations and performance, exploiting the laws of quantum physics and mechanics, while processing data in the form of a fundamental unit called a Qbit instead of the traditional Bit used in electronic computing.
At Eurocrypt 2020, Hosoyamada and Sasaki proposed the first quantum attack dedicated to hash functions, specifically SHA-2 and SHA-3. In reality, they reproduced an improved version of the classic “Birthday Attack” that generates collisions on the output of hash algorithms, exploiting probabilistic calculation as a violation technique. This work, purely aimed at mathematical analysis and cryptanalysis, opens a new perspective towards the security of the algorithms used by hash functions. For the moment, it remains a university research study, also because not everyone has these powerful and expensive processors at home. We can conclude that Blockchain is an apparently secure system. I say “apparently” because, as we have seen, it enjoys multilevel security, but like any technology, it could have potential inherent vulnerabilities that with the advent of new integrated technologies such as the Metaverse, for example, could expand the attack surface, causing the entire fortress that the Blockchain system has built around itself to collapse.
Dr.ing Curzi Fernando L. (CyberSecurity analyst, Ethical hacker, certified pentester, Computer Engineering graduate)
Author of the ebook Hackerpunk available on Amazon
Ing. Fernando Curzi