Homework on Hash Functions - Questions

  1. Hash functions are very complex one way functions that provide a unique output for a specific input without the possibility of doing the opposite and therefore finding the source input starting from the hash

  2. Hash functions are the base of cryptography and cryptocurrency mining. Each hash consists of a random number between 0 and 256 bits. To succesfully create and add a block to the chain, the hash you have generated has to be within that range. If it’s not, your software tries again adding additional data to the previous hash. When this happens, this new number cannot be more than 4x its previous numbers so that it becomes easier and easier until you succesfully solve the block and verify the transaction. (please help, i hope this makes sense!)

  3. Hash collision resistance is a property of hash functions that makes it almost impossible to find to different inputs that result in the same output. This is necessary to prevent collision cyber attack.

1 Like
  1. complex, unidirectional equations that are difficult to understand and apparently practically impossible do backwards. They leave an alphanumeric output
  2. Using the hash function, miners or nodes, or rather the computational systems of them, solve equations of information and leave the alphanumeric output on the block once they have reached consensus. (?) These include the transactions of cryptocurrencies such as BTC and many different alt coins.
  3. Finding a collision would mean reverse solving the hash function, they found the output–>input and that whole language is basically no longer secure. So if the hash function is “collision resistant” it should be theoretically so difficult to do that is nearly impossible to make the output H ( a ) = H ( b ) and the output of a = b.
1 Like
  1. Hash function is a way of secure data, each input has a unique output and you can only go from input to output and not the other way around. You can call hash functions as a digital fingerprint and is a good way to do a security check of big data sets.

  2. It is used to write new transactions in the blockchain through mining. If you solve a hash function in the bitcoin ecosystem you will be rewarded by 1 bitcoin. It is also a way to encrypt the transactions.

  3. It is collision resistant if it is hard to find two inputs that hash to the same output.

1 Like
  1. A hash function involves a unique input and a unique output. It is a ‘one-way’ street from input to output.
  2. Hash functions are how miners mine bitcoin and build on the blockchain. They solve equations and when the hash is equal to or less than the target hash the miners are rewarded for bitcoin.
  3. Collision resistant is when it is hard for a function to have two unique inputs to equal one unique output. i.e. f(a)=c f(b)=c therefore f(a) = f(b)
1 Like
  1. Describe hash functions with your own words: one way functions that also ensure results are unique
  2. How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now). BTC is based on PoW, and this wok is based on finding (better posed, guessing) a hash of the previous block which is lesser than the target hash (which I don’t understand how it works yet)
  3. What does it mean when we say that hash functions need to be collision resistant? (We didn’t use the term “collision resistant” in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, that’s how you learn best). That it should be incredibly hard that two inputs applied to the same hash function result in the same output.
1 Like

1.) hash functions are are mathematical expressions that are used to scramble an input function into something that has an output function of a fixed length.

2.) Hash functions take input values and convert them into fixed output values. These out put values can be used to validate transactions on the block chain. Or can be used for mining purposes for Bitcoin etc.

3.) Hash function collision resistance - is a method of checking or validating the hashing algorithm to check that the output hash for two different inputs cant be the same. Poor constructed hash algorithm have flaws where the output hash of two different documents can create the same out put hash.

Example: say our algorithm for hashing only removes vowels out of words to make an output hash.

say I am hashing a word as pizza. My algorithm only solves by removing vowels.

Pizza hashed in my algorithm . Input (Pizza) = output (Pzz) so my output hash is (pzz)

now for example I take another word, such as PIZZE. in Italian it means many pizzas.

Input ( Pizze) = output hash (Pzz)

now you can see that input pizza = pzz output
and the input pizze = pzz output.

this two have the same hash output which is a big problem. So to prevent this from happening the hashing algorithm has to be strong or created in a way the out put hashes cant be the same.

credit for this example goes to Adam Smallhorn.

1 Like
  1. Each unique input will produce a unique output and get a unique fingerprint.

  2. Each transaction get a input with a unique fingerprint then come to a unique output. Which means it is not easy to alter or to change anything. That make this currency secure and transparent 'cause you can access all the data on the chainblock

  3. It is almost impossible that you get 2 inputs that hash the same output.

1 Like

-Describe hash functions with your own words
Hash functions are basically the hash algorithms that produces unique hashes, in order to add data into the blockchain.

How are hash functions used in cryptocurrencies like bitcoin?
Hash functions are used in criptocurrencies in the mining process. In order to add a new block to the blockchain, miners have to find a hash that meets the target difficulty.
Each block contains a blockheader with the number of the block, the hash of the previous block and a “nonce”, which includes a timestamp

What does it mean when we say that hash functions need to be collision resistant?
a hash function is collision resistant if it is hard to find two inputs that hash to the same output

1 Like
  1. Describe hash functions with your own words

A hash function is an extremely complex algorithm that will produce a unique output for every unique input. It creates a digital/mathematical fingerprint for every input, and the input cannot be mathematically deduced from the fingerprint itself.

  1. How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now).

Blocks contain hashes of previous blocks in the chain, meaning that they carry a unique signature/fingerprint generated by the previous input. Hashes are also used for various other parts of cryptocurrency, such as creating unique cryptocurrency addresses.

  1. What does it mean when we say that hash functions need to be collision resistant? (We didn’t use the term “collision resistant” in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, that’s how you learn best).

A collision is when there are two or more inputs that create the same output. If this were to occur, the hash function’s ability to create unique signatures for any input would be proven false and would compromise the entire blockchain system. Hence, hash functions must be collision resistant.

1 Like

1- Hash functions generate a unique output given a unique input, that can not be reversed.
2- In Bitcoin the hash function is used to condense all the information at that time, the transactions made. After is given an unique hash, were the slightest change would completely change hash.
3- Two different inputs can not give the same output

1 Like

Hash functions are complex functions that can be used as unique codes to validate a specific input. It is not possible to identify an input by its output, so it is secure.
Hash functions for currencies are used for verification. A miner uses their computing power to try to solve the complex hash function, but because it is completely random, it requires a lot of power. To stop this from being a one computer beats all sort of deal, the functions get harder.
Collision resistance is important because if the input hash is ever discovered, it nullifies blockchain

1 Like
  1. Describe hash functions with your own words.
    Hash functions is a linear and irreversible process that has the ability to create a unique digital fingerprint.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    Hash functions are used during the process of consensus to verify the data.

  3. What does it mean when we say that hash functions need to be collision resistant?
    It means that in order for the hash function to be reliable and secure, all possible inputs should produce a unique output. Collision resistance avoids different inputs to produce the same hash.

1 Like

Since hash is a random number when mining the hash number must be below the specified target. If the hash is higher than the target, the miners change the nonce number and try again. In that sense they don’t add any additional data, just try different nonces until they find the desired hash that is lower than the target. :slight_smile:

1 Like

The function always remains the same, the only thing that changes is the target difficulty that determines what hash outputs are accepted as valid.

A collision is not a reversal of the hash function but explains the probability of two different inputs resulting in the same output. :slight_smile:

  1. Hash functions it is encryption method that can take any form of data (input) and generate random coded output. It is impossible to figure out input looking at output. This process is done to ensure authenticity of any written text and if certain text (input) has been tempered with or changed.

  2. From what I understand, is that each block has its own hash so in order to mine it, miners need to guess the digital input of certain block they want to mine that can create certain hash target.

  3. In order for hash function to be collision resistant the hash function can not have two different inputs for the same hash.

1 Like

Amazing! Thanks for the clarification :slight_smile:

SHA256 is not used to derive public keys if that is what you mean, for that the elliptic curve function is used, however the public key is hashed to get the address. :slight_smile:

Okay thanks, I wasn’t clear on that part.

  1. Hash functions are essentially digital finger prints.

  2. To do things like create private and public wallets to use the BTC.

  3. It needs to be collision resistant because if it were not there could be multiple inputs providing the same hash.

1 Like
  1. these functions letting you to output your information in a hash code which is not tracable, you cannot uncode it
    . 2. as I understand using hash functions you do the transactions safe, because you make imput with your data and the output come in unctrackable formula where you are safe with your transfer
  2. not getting the same hash from the two different imputs
1 Like