Functions, Hash Functions, Cryptography - Discussion

One thing I can’t really understand about hash functions @Alko89 . You say that it “should” be impossible to predict. But considering advancements in tech all the time, is it not just a matter of time until an AI in 2030s can solve it and therefor destroy bitcoin?

I’m imagining a scenario where Bitcoin is the dominant currency of the world. If one day someone successfully predicts the SHA-256 Hash, it breaks bitcoin. That would mean a overnight crash of the world currency, which somehow sounds even worse than the slow but sure decay like FIAT currency.

Can bitcoin change what hash system it works on, or how does it 100% guarantee that no advancements in technology by AI or human can predict it?

Its true that with advancement of technology its only a matter of time until SHA256 gets broken, but this won’t be because of AI in particular.
In any case when (or even better before) this happens the network will have to hard fork to a new algo to remain secure. :slight_smile:

Thanks @Alko89, makes it a bit clearer! And new algo means new hash function that replaces SHA256? So hard forks will continuesly come so that the used hash function is always one step ahead of the technology to predict?

i am unable to grasp the concept of a function in the ways presented to me please elaborate
-dumb hoe john doe

https://www.youtube.com/watch?v=0WiTaBI82Mc This video may help.

1 Like

Someone can explain me the concept of collision resistance please ?

In cryptography, collision resistance is a property of cryptographic hash, let take an example a hash function H(x), we can only say this function is collision-resistant if it is hard to find two inputs that hash to the same output; that is, two inputs a and b where a ≠ b but H ( a ) = H( b ).

2 Likes

Hi i know we weren’t particularly expected to know the answers to these due to it not being covered yet but could i get some feedback if i was on the right track? :slight_smile:

Hash function homework

  1. Hash function is a way of uniquely identifying a data input by giving it its own unique output, any change even in the slightest will alter the output dramatically, conversely if the data is changed back to the original input, the output will also return to the original provided the same hash algorithm is used.
  2. Hash functions in cryptocurrencies are used to detect any attempts in changes of data, the hash pointer points to the transactional data/ledger in the previous block. Any attempt to change or hack the data would be immediately noticed by the preceding blocks and nullified due to the changing of the outputs using hash functions.
  3. Collision resistance means each input will have its own unique hash, having 2 different inputs that result in the same hash.
1 Like

Just another question, i’m new to inputs/outputs and hashing but i think i grasp the concept.

Is it correct in me saying that in crypto/blockchain that the hash function works in reverse? If a current block is tampered with/hacked then the hashes of all the previous blocks would notice immediately and reject the change?

1 Like

Correct, because blocks in bitcoin are interconnected if someone messed with data it will affect the whole chain.

What differentiates a normal transaction from a false one and what methods are there to try to hack a block? Is it simply trying to broadcast a false transaction? If thats the case i guess the consensus model would verify you never had the funds and reject it, but how does this affect the hashing? Is the hashing and consensus function (checking if funds are available) one in the same?

if someone broadcast a false transaction the nodes will reject the transaction. Miners accept only valid transactions and hash them, The hash is get affected if someone tries to change a data in a block let say the current block height is 100, and the hacker try to manipulate the data for block height 90, this will affect the hash for all blocks that come after block 90 because. Because those blocks contains the hash value of their previous block and hash function is like a finger print for every input it has its unique output, so if the hacker changes any data the hash will be changed for block 90 and also for every blocks that is linked after it.

But the hackers main form of attack to “change the data” in a block would just be broadcasting a fake transaction is that correct? So the hashing is the method the nodes use to reject or accept a transaction? I havent learnt about mining and block height yet. You just mentioned that the fake transaction will affect the hashing after block 90, does this mean hashing doesnt affect previous blocks because they are already “completed blocks” and only the hashing of future blocks is what determines consensus?

No, nodes do a series of checks for a transaction, nodes don’t hash a transaction to check if it is valid or not. https://smartereum.com/8970/how-do-bitcoin-nodes-verify-transactions/

https://blockgeeks.com/guides/what-is-hashing/ this may answer your questions relating to hashing.

Please i don’t understand, is there a vide of the functions has functions and cryptography session somewhere or am meant to ask about it here and get a answer, because I don’t know anything about it

No, this thread is for discussion and also if you have questions related to Hash Functions and Cryptography.

1 Like

Oh thank you very much maki, am grateful! :heart:

Person A sends person B a public key.
B puts his private key with A’s public key and creates a hash.
B sends this hash to A.
A mixes this hash with his private key to produce another hash.
A sends this hash to B.

Both A and B now have unique private hashs that are used to decrypt each other’s messages… Right?

I am not quite understood your idea. But If person A and B want to exchange a message in the open internet and want to make it safe, person A can encrypt the message with the person B’s public key and person B can decrypt the message with his private key. Or Person signed by hashing the message with a hashing algorithm and his private key. This produces a hash digest, which can only be recreated through use of one of the keys in the key pair created by the person A. Person B’s then receives the message, the hash digest, and the person A’s public key, if they did not already have it. The recipient then uses the sender’s public key to hash the message they have received. If the resulting hash digest matches the hash digest that has been sent along with the message, then the identity of the sender has been confirmed. This also confirms that the data has not been changed in transit.