Blockchain technology can seem complex; however, it can be simplified by examining each component individually. At a high level, blockchain technology utilizes well-known computer science mechanisms and cryptographic primitives (cryptographic hash functions, digital signatures, asymmetric-key cryptography) mixed with record keeping concepts (such as append only ledgers). This section discusses each individual main component: cryptographic hash functions, transactions, asymmetric-key cryptography, addresses, ledgers, blocks, and how blocks are chained together.
Cryptographic Hash Functions :
An important component of blockchain technology is the use of cryptographic hash functions for many operations. Hashing is a method of applying a cryptographic hash function to data, which calculates a relatively unique output (called a message digest, or just digest) for an input of nearly any size (e.g., a file, text, or image). It allows individuals to independently take input data, hash that data, and derive the same result – proving that there was no change in the data. Even the smallest change to the input (e.g., changing a single bit) will result in a completely different output digest. Table 1 shows simple examples of this. Cryptographic hash functions have these important security properties: 1. They are preimage resistant. This means that they are one-way; it is computationally infeasible to compute the correct input value given some output value (e.g., given a digest, find x such that hash(x) = digest). 2. They are second preimage resistant.
This means one cannot find an input that hashes to a specific output. More specifically, cryptographic hash functions are designed so that given a specific input, it is computationally infeasible to find a second input which produces the same output (e.g., given x, find y such that hash(x) = hash(y)). The only approach available is to exhaustively search the input space, but this is computationally infeasible to do with any chance of success.
They are collision resistant. This means that one cannot find two inputs that hash to the same output. More specifically, it is computationally infeasible to find any two inputs that produce the same digest (e.g., find an x and y which hash(x) = hash(y)). A specific cryptographic hash function used in many blockchain implementations is the Secure Hash Algorithm (SHA) with an output size of 256 bits (SHA-256). Many computers support this algorithm in hardware, making it fast to compute. SHA-256 has an output of 32 bytes (1 byte = 8 bits, 32 bytes = 256 bits), generally displayed as a 64-character hexadecimal string (see Table 1 below).
This means that there are 2256 ≈ 1077, or 115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936 possible digest values. The algorithm for SHA-256, as well as others, is specified in Federal Information Processing Standard (FIPS) 180-4 [5]. The NIST Secure Hashing website [6] contains FIPS specifications for all NIST-approved hashing algorithms.
Collision Resistance and the Role of Hash Functions in Blockchain:
Since there are infinitely many possible input values and only a finite number of possible output digest values, it is theoretically possible for a collision to occur—where:
hash(x) = hash(y)even though x ≠ y
In other words, two different inputs could produce the same hash digest.
However, modern cryptographic hash functions such as SHA-256 are designed to be collision resistant, meaning that finding such a collision is computationally impractical.
How Difficult Is It to Find a SHA-256 Collision?
To find a collision in SHA-256, one would need to perform approximately:
hash operations on average.
This equals:
This number is astronomically large.
Putting This into Perspective
In 2015, the entire Bitcoin network had a hash rate of approximately:
Even at that enormous rate, it would take roughly:
to manufacture a single SHA-256 collision.
For comparison, the age of the universe is estimated to be:
1.37 × 10¹⁰ years
This demonstrates how practically impossible it is to generate a collision using current or foreseeable computational power.
Furthermore, even if two inputs x and y were found that produce the same digest, it would be highly unlikely that:
Both inputs are valid blockchain transactions
Both are accepted by the network under protocol rules
Uses of Cryptographic Hash Functions in Blockchain
Within a blockchain network, cryptographic hash functions serve several critical purposes:
1. Address Derivation
Hash functions are used to derive blockchain addresses from public keys, ensuring both uniqueness and security.
2. Creating Unique Identifiers
Transactions and blocks are identified using hash digests, which act as unique fingerprints.
3. Securing Block Data
When a node publishes a block:
It hashes the block’s data.
The resulting digest is stored in the block header.
Any modification to the block data changes the hash, immediately revealing tampering.
4. Securing the Block Header
The publishing node also hashes the block header itself.
If the blockchain uses a Proof-of-Work (PoW) consensus mechanism:
The node repeatedly hashes the block header.
It changes a special value called the nonce each time.
This process continues until the resulting hash satisfies the network’s difficulty requirements.
The hash of the current block header is then included in the next block’s header. This creates a chain of cryptographic links, ensuring that:
Altering any previous block would change its hash.
That change would invalidate all subsequent blocks.
The integrity of the entire blockchain is preserved.
Conclusion
Although hash collisions are theoretically possible due to mathematical limitations, SHA-256’s collision resistance makes such events practically impossible. This security property is fundamental to blockchain systems, ensuring data integrity, immutability, and trust in decentralized networks.
Cryptographic Nonce :
A cryptographic nonce is an arbitrary number that is only used once. A cryptographic nonce can be combined with data to produce different hash digests per nonce: hash (data + nonce) = digest Only changing the nonce value provides a mechanism for obtaining different digest values while keeping the same data. This technique is utilized in the proof of work consensus model (see Section 4.1). 3.2 Transactions A transaction represents an interaction between parties. With cryptocurrencies, for example, a transaction represents a transfer of the cryptocurrency between blockchain network users. For business-to-business scenarios, a transaction could be a way of recording activities occurring on digital or physical assets. Figure 1 shows a notional example of a cryptocurrency transaction. Each block in a blockchain can contain zero or more transactions.
For some blockchain implementations, a constant supply of new blocks (even with zero transactions) is critical to maintain the security of the blockchain network; by having a constant supply of new blocks being published, it prevents malicious users from ever “catching up” and manufacturing a longer, altered blockchain (see Section 4.7). The data which comprises a transaction can be different for every blockchain implementation, however the mechanism for transacting is largely the same. A blockchain network user sends information to the blockchain network.
The information sent may include the sender’s address (or another relevant identifier), sender’s public key, a digital signature, transaction inputs and transaction outputs. A single cryptocurrency transaction typically requires at least the following information, but can contain more: • Inputs – The inputs are usually a list of the digital assets to be transferred. A transaction will reference the source of the digital asset (providing provenance)
either the previous transaction where it was given to the sender, or for the case of new digital assets, the origin event. Since the input to the transaction is a reference to past events, the digital assets do not change. In the case of cryptocurrencies this means that value cannot be added or removed from existing digital assets. Instead, a single digital asset can be split into multiple new digital assets (each with lesser value) or multiple digital assets can be combined to form fewer new digital assets (with a correspondingly greater value). The splitting or joining of assets will be specified within the transaction output.
Inputs –
- The inputs are usually a list of the digital assets to be transferred. A transaction will reference the source of the digital asset (providing provenance) – either the previous transaction where it was given to the sender, or for the case of new digital assets, the origin event. Since the input to the transaction is a reference to past events, the digital assets do not change. In the case of cryptocurrencies this means that value cannot be added or removed from existing digital assets. Instead, a single digital asset can be split into multiple new digital assets (each with lesser value) or multiple digital assets can be combined to form fewer new digital assets (with a correspondingly greater value). The splitting or joining of assets will be specified within the transaction output.
0 Comments