Bitcoin Forum
May 02, 2024, 07:32:54 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Does the block hash function need to be cryptographically secure?  (Read 81 times)
SapphireSpire (OP)
Jr. Member
*
Offline Offline

Activity: 49
Merit: 38


View Profile
January 15, 2024, 07:18:54 PM
Last edit: January 22, 2024, 05:30:01 AM by SapphireSpire
 #1

Cryptographically secure hash functions are irreversible so that ciphertexts can't be decrypted by running the function in reverse. But none of the data in a block is encrypted. The block hash is just a checksum, so it shouldn't need to be cryptographically secure. Am I wrong?
1714678374
Hero Member
*
Offline Offline

Posts: 1714678374

View Profile Personal Message (Offline)

Ignore
1714678374
Reply with quote  #2

1714678374
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714678374
Hero Member
*
Offline Offline

Posts: 1714678374

View Profile Personal Message (Offline)

Ignore
1714678374
Reply with quote  #2

1714678374
Report to moderator
1714678374
Hero Member
*
Offline Offline

Posts: 1714678374

View Profile Personal Message (Offline)

Ignore
1714678374
Reply with quote  #2

1714678374
Report to moderator
tromp
Legendary
*
Offline Offline

Activity: 978
Merit: 1080


View Profile
January 15, 2024, 07:44:48 PM
 #2

Cryptographically secure hash functions are irreversible so that ciphertexts can't be decrypted by running the function in reverse. But none of the data in a block is secret, so the block hash is just a checksum, and shouldn't need to be cryptographically secure. Am I wrong?
If someone find SHA256 pre-images, i.e. given y, find an x with SHA256(x)=y, in time 2^240, i.e. 2^16 times faster than brute force, then SHA256 would be considered broken, and in need of replacement, although not urgently.

Such an attack need not have any bearing on the cost of bitcoin mining though.
The latter corresponds to find *partial* preimages.

As long as finding a preimage to n leading 0s, for n up to say 100, takes time roughly 2^n, then bitcoin mining is unaffected. If someone has a partial preimage attack where they can get by with say 2^{0.9n} then they get an unfair advantage at mining.
odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3214



View Profile
January 15, 2024, 08:46:14 PM
Last edit: January 26, 2024, 09:01:58 PM by odolvlobo
Merited by vjudeu (1)
 #3

Cryptographically secure hash functions are irreversible so that ciphertexts can't be decrypted by running the function in reverse. But none of the data in a block is encrypted, so the block hash is just a checksum, and shouldn't need to be cryptographically secure. Am I wrong?

A hash function does not do encryption, but still your question is valid. My understanding is that a secure hash function is not strictly necessary for mining because any flaw would presumably be exploited by all miners, and that would simply increase the difficulty.

Edit:

However, as Pooya87 points out below, a less-than-secure hash function introduces problems related to block chain integrity.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
vjudeu
Hero Member
*****
Offline Offline

Activity: 677
Merit: 1552



View Profile
January 15, 2024, 09:30:50 PM
 #4

Quote
the block hash is just a checksum, and shouldn't need to be cryptographically secure
If so, then introduce a given weakness, for example in regtest, and then just write some tests to find out.

Quote
My understanding is that a secure hash function is not strictly necessary for mining because any flaw would presumably be exploited by all miners, and that would simply increase the difficulty.
You cannot increase difficulty "ad infinitum". There are cases, where things are so broken, that you need some additional "fix". For example: imagine that you replace regular SHA-256 with just SHA-256, reduced to the first 16 rounds. Then, you would need to change consensus rules, for example into "SHA-256 should give this hash, and SHA-3, applied on the same data, should give a number below given target". Because if you don't, then everyone will exploit that weakness. And there is always a limit, how "weak" you can make something, without making it "totally broken".

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10529



View Profile
January 16, 2024, 04:22:47 AM
Merited by hosseinimr93 (2), odolvlobo (1)
 #5

You are confusing a lot of concepts. In your comment you are closer to the definition by calling it a "checksum" than calling it "encryption". We aren't doing any kind of encryption in Bitcoin and there is no ciphertext either.

What we have in hash functions is a digest, a fixed length result that is irreversible regardless of whether the function was cryptographically strong like SHA256 or not like Murmur3.

The reason why a cryptographically strong hash algorithm is needed in something like Bitcoin is their characteristics such as collision, pre-image and second-preimage resistance.

For example if a non-cryptographic hash were used for Bitcoin PoW the problem won't just be faster computation and higher difficulty. The problem will be the fact that anyone could easily change anything in the mined block and produce the same hash hence effectively nullify Bitcoin's blockchain's immutability since such functions lack resistance against attacks I mentioned.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!