Posted on February 15, 2025
Developments in Cryptographic Hash Algorithms
-
Input: Any message of any length (up to 2^64 – 1 bits).
-
Output: A fixed-size 256-bit (32-byte) hash value.
-
Purpose: To produce a fingerprint of data where even a small change in the input results in a dramatically different output, making it suitable for data integrity verification and digital signatures.
-
The message is padded so that its length is congruent to 448 modulo 512. This is done by appending a ‘1’ bit, followed by as many ‘0’ bits as necessary, and then appending the original length of the message in bits as a 64-bit big-endian integer.
-
Formula: new_length = (original_length + 1 + padding_zeros + 64) % 512 == 448
-
The padded message is broken into chunks of 512 bits each. Each chunk is further divided into 16 words of 32 bits (4 bytes).
-
SHA-256 begins with eight 32-bit words initialized to the first 32 bits of the fractional parts of the square roots of the first 8 primes (2, 3, 5, 7, 11, 13, 17, 19).
h0 = 0x6a09e667
h1 = 0xbb67ae85
h2 = 0x3c6ef372
h3 = 0xa54ff53a
h4 = 0x510e527f
h5 = 0x9b05688c
h6 = 0x1f83d9ab
h7 = 0x5be0cd19
-
Expand Message Block: The 16 32-bit words are expanded into 64 words through a series of bitwise operations:
-
W[16..63] are derived from W[0..15] using:
W[i] = σ1(W[i-2]) + W[i-7] + σ0(W[i-15]) + W[i-16]
where:-
σ0(x) = ROTR^7(x) XOR ROTR^18(x) XOR SHR^3(x)
-
σ1(x) = ROTR^17(x) XOR ROTR^19(x) XOR SHR^10(x)
-
ROTR is right rotation, SHR is right shift.
-
-
-
Initialize Working Variables: Set a, b, c, d, e, f, g, h to the current values of h0, h1, …, h7.
-
Compression Function: Apply the main SHA-256 operation 64 times:
-
For each iteration t from 0 to 63:
T1 = h + Σ1(e) + Ch(e, f, g) + K[t] + W[t] T2 = Σ0(a) + Maj(a, b, c) h = g g = f f = e e = d + T1 d = c c = b b = a a = T1 + T2
Where:-
Σ0(x) = ROTR^2(x) XOR ROTR^13(x) XOR ROTR^22(x)
-
Σ1(x) = ROTR^6(x) XOR ROTR^11(x) XOR ROTR^25(x)
-
Ch(x, y, z) = (x AND y) XOR (NOT x AND z)
-
Maj(x, y, z) = (x AND y) XOR (x AND z) XOR (y AND z)
-
K[t] is a constant from a table of 64 constants derived from the cube root of the first 64 primes.
-
-
-
Update Hash Values: Add the current hash values to the results from the compression function:
h0 += a h1 += b h2 += c h3 += d h4 += e h5 += f h6 += g h7 += h
-
After processing all chunks, concatenate h0 through h7 to get the 256-bit hash.
-
SHA-3 (Keccak):
-
Development: Selected after an open competition by NIST in 2012, SHA-3 is based on the “Keccak” algorithm. It uses a different construction known as “sponge construction” which differs from the Merkle-Damgård structure used in SHA-2.
-
Advantages: SHA-3 is considered more resistant to certain types of cryptanalytic attacks compared to SHA-2. It’s not specifically designed to replace SHA-2 but to provide an alternative with different security properties. It’s particularly noted for its resistance to length extension attacks, which SHA-2 is susceptible to.
-
Variants: Includes SHA3-224, SHA3-256, SHA3-384, and SHA3-512, with SHA3-256 providing more cryptographic strength for the same hash length as SHA-256.
-
-
BLAKE2:
-
Development: BLAKE2 is an evolution of BLAKE, which was a finalist in the SHA-3 competition. It’s known for its performance optimizations for both 32-bit (BLAKE2s) and 64-bit (BLAKE2b) systems.
-
Advantages: BLAKE2 offers similar security strength to SHA-3 but with better performance in terms of speed. It’s designed to be fast, secure, and flexible, making it suitable for both software and hardware implementations.
-
-
Post-Quantum Cryptography (PQC) Hash Functions:
-
While not directly competing with SHA-256 in the classical sense, PQC research has led to hash functions like SPHINCS, which are designed with quantum resistance in mind. These algorithms aim to be secure against quantum computing threats but often come with performance trade-offs.
-
-
Other Notable Mentions:
-
Skein, Grøstl, and JH were also SHA-3 competition finalists. Each has unique features but hasn’t gained as much traction as SHA-3 or BLAKE2 in practical applications.
-
-
Security: SHA-256 is still considered secure for most applications today, but SHA-3 provides additional security assurances.
-
Performance: BLAKE2 is often cited for its speed, which can be critical in certain applications.
-
Use Cases: The choice of algorithm might depend on specific requirements like speed, implementation simplicity, or resistance to particular attack vectors.
-
There are discussions on platforms like X about exploring even newer or hybrid approaches to hashing, but these are more speculative and less formalized in standards or widespread use.
-
Slothcoin (SLOTH): One of the cryptocurrencies explicitly using SHA-3. It was designed with the idea of being fun and revolutionary, akin to Dogecoin but with SHA-3 for its encryption algorithm to level the playing field between different GPU manufacturers.
-
MaxCoin (MAX): This cryptocurrency also uses SHA-3 (Keccak). It was created with a focus on being fast and secure, leveraging SHA-3’s properties.
-
Cryptometh (METH): Another cryptocurrency employing SHA-3, aiming to provide a different mining experience compared to SHA-256 based coins.
-
SHA-3 Variants: While specific cryptocurrencies might use the standard SHA-3 versions like SHA3-256, there are also variations or adaptations of Keccak used in cryptocurrencies. The exact details can vary, but the principle of using a SHA-3-like function remains.
-
List of SHA-3 Coins: According to web sources like CryptoRival, there are approximately 8 cryptocurrencies listed that use the SHA-3 algorithm. However, the exact list might not be exhaustive or up-to-date, but it includes the ones mentioned above and potentially others not detailed in the current data set.
-
Adoption Rate: SHA-3’s adoption in cryptocurrencies isn’t as widespread as SHA-256 or some other algorithms due to SHA-2’s established use and acceptance. However, its adoption is growing, especially in new projects looking for alternatives with different security profiles.
-
Security and Future-Proofing: The interest in SHA-3 for cryptocurrencies often stems from its design for being potentially more resistant to future cryptanalytic attacks, including those from quantum computing.
-
Performance: For mining, SHA-3 can behave differently on hardware, potentially offering a more level playing field between GPU brands or even enabling ASIC resistance in some configurations.
Posted on February 14, 2025
Ethereum hard forks
Ethereum, like Bitcoin, has undergone several hard forks, both planned and contentious, since its inception. Here’s an overview of some significant Ethereum hard forks:
DAO Hard Fork (July 2016):
Reason: Following the DAO (Decentralized Autonomous Organization) hack, where around 3.6 million ETH was stolen, the Ethereum community decided to revert the transactions that led to the theft through a hard fork.
Outcome: This resulted in two chains:
Ethereum (ETH): The new chain where the DAO funds were returned, and the protocol was updated.
Ethereum Classic (ETC): The original chain, which did not revert the hack, advocating for the principle of “code is law.”
Byzantium (October 2017):
Part of Metropolis: This was part of the Metropolis upgrade, introducing several Ethereum Improvement Proposals (EIPs) like EIP-140 for REVERT opcode, EIP-658 for reducing gas costs, and EIP-196 for precompiled contracts for modular exponentiation.
Purpose: Aimed at improving privacy, efficiency, and preparing the network for future scalability solutions.
Constantinople (February 2019):
Delay: Initially planned for late 2018 but delayed due to security concerns regarding one of the EIPs.
Changes: Included five EIPs focusing on reducing block reward from 3 ETH to 2 ETH, making the network more efficient and preparing for sharding.
Istanbul (December 2019):
EIPs: Implemented six EIPs, with a focus on improving privacy (like EIP-152 for BLAKE2 compression function) and preparing for Ethereum 2.0.
Muir Glacier (January 2020):
Purpose: A minor hard fork to delay the difficulty bomb (also known as the ice age) that would increase mining difficulty, which was initially set to encourage the transition to Proof of Stake.
Berlin (April 2021):
EIPs: Focused on gas cost optimizations and included EIP-2929 for reducing gas costs for certain operations, aiming to improve the efficiency of the network.
London (August 2021):
EIP-1559: Introduced a new fee market mechanism where a base fee is burned rather than given to miners, aiming to make transaction fees more predictable and potentially deflationary for ETH supply.
Arrow Glacier (December 2021):
Purpose: Similar to Muir Glacier, it further delayed the difficulty bomb to give more time for the Ethereum community to transition to Proof of Stake with Ethereum 2.0.
The Merge (September 2022):
Merge: Not a hard fork in the traditional sense, but the event where Ethereum transitioned from Proof of Work to Proof of Stake, effectively merging the Ethereum 1.0 chain with the Beacon Chain.
Ethereum’s hard forks have generally been about improving network performance, security, and preparing for scalability solutions. They reflect Ethereum’s ongoing development towards Ethereum 2.0, which promises significant upgrades in terms of scalability, security, and sustainability. Each hard fork has had its implications on the Ethereum ecosystem, from community consensus to changes in network economics.