Homework on Hash Functions - Questions

  1. A hash function is like a digital fingerprint for a data object. Essentially you put a string on any length in and get a fixed length output. The output for a given string should always be the same (using the same hashing function).
  2. The inputs in to the bitcoin hash function are the most recent none confirmed transactions. The hash is run on this by miners who try to calculate the hash to add the new block to the chain.
  3. Collision resistant means it is statistically unlike to generate the same hash for a different input.
1 Like
  1. A hash function or hash algorithm create a unique digital fingerprint of data. Digital fingerprint of data also called digest.
  2. The SHA-256 hashing algorithm is to hash a bitcoin transaction and produce a unique 256 character hash. No matter the size of the original input.
  3. It should be hard to find 2 inputs that produce the same output
1 Like
  1. Hash function is an algorithm that creates a certain string of characters from the given input. It only works one way and it cannot be inverted.

  2. Hash function algorithm in BTC is called SHA-256 (secure hash algorithm) and it has 256 bits. It takes an input of the available transaction data on the block and turns it into a hash. Then miners working with that hash and trying to solve a really complicated mathematical puzzle to verify and create new blocks.

3.Collision resistant means that it is very hard for 2 different inputs any length to create the same hash.

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    A input produces a unique output. Its a one way function. The hash function produces a string of alpanumerical numbers.

  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).
    They are used to fingerprint an input. Bitcoin uses currently SHA 256. Once it is encrypted you cannot go back from the output to read the input.

  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).
    While possible it is highly unlikely that 2 different inputs produce the equal output.

1 Like
  1. A hash function is a function that takes an input and generates a unique output that cannot be reverse calculated to find out the input.

  2. Hash functions are mainly used to create digital signatures for cryptocurrencies. Hash functions take a public key which is posted on the blockchain and creates a private key that is only known to the owner of the account that is used to sign each unique transaction. The signature can then be verified on the blockchain without compromising anyone’s account.

  3. A hash function that is collision-resistant means that the hash function rarely generates the same output from two different inputs. A hash function that generates very long ouputs is more collision resistant than one with less.

1 Like
  1. Hash function gives unique input and output. It is a one-way function where output is not equal to input.

  2. Hash function is used for mining in Bitcoin to create new blocks. This is also the proof-of-work system. Bitcoin uses hashing algorithm SHA-256. Hash function enables Bitcoin to be decentralized and secure. The properties of Bictoin hash function includes pre-image resistance, pivacy, efficient, collision resistance and randomness.

  3. Collision resistance refers to any hash output must be unique. This is the signature of a hash. If any two hashes have the same output, this is no longer secure.

1 Like
  1. Describe hash functions with your own words
    A one way function that takes an input and generates a unique output.

  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).
    They are used to encrypt the blocks on the chain.

  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).
    It’s hard to find two inputs that hash the same output.

1 Like
  1. a hash function is a one way function where for each unique input i get a unique output which can be compared to a digital fingerprint.

  2. in cryptocurrencies the transactions are taken as input and run through the hashing algorythm which gives an output of fixed lenght. The inputs are the not-yet confirmed transactions and other information like timestamp and reference to the previous blocks.

  3. it means that running different inputs thorugh the hash funciton and getting the same result must be infeasible/ extremely low probability as no system can be 100% collision resistant.

1 Like
  1. Describe hash functions with your own words
    A hash function takes an input of arbitrary length and creates an output of a given length, for example in case of SHA256 the output has a length of 256 bits.

  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).
    Hash functions create a unique fingerprint of a given input. These functions are one way functions, so you cannot figure out the input when you only have the output created. But it is very easy to verify the hash function knowing the input data. So it is very hard to solve the mining puzzle, if the difficulty is very high. You will have to perform a huge number of tries in order to find a hash with enough leading zeros to match the criteria of the given difficulty. On the other hand it is very easy to confirm a mined block using the input data and create the SHA256 hash on your own. Calculation of a block is very hard, because you will have to perform a huge number of attempts. But verifying a block can be done in an instant, because you only have to use the known input data, calculate the hash and check if is the same.

  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).
    Collision resistance means that two different inputs, deliver the same result using a certain hash function. This is due to the fact, that you have an arbitrary input length and therefore an infinite number of inputs, but only a finite number of outputs. In case of SHA256 the total number of outputs is 2^256. If a hash function would not be collision resistant this would be a huge problem for the Bitcoin network, because the transaction data in a block could be tampered and you still would get the same hash as an output. In this case the fingerprint created by the hash function would no longer be unique and tied to a single set of input data.

1 Like
  1. A hash function is a one way mathematical function that is used to describe an input as a fixed length ā€œstringā€/number. This is useful because the result varies wildly based on subtle changes to the input.

  2. They are used to describe all the transactions of the previous block and also is the primary component of the puzzle used for finding new blocks.

  3. It is possible that two different inputs into a hash function produce the same output. Collision resistance means that your K value is sufficiently high enough that it will take quite a long time to guess similar K values that the concatenation of K and X will equal the same Y
    f (K|x) = Y

1 Like

1- taking an input and getting an output of any fixed length
2- in crypto currencies, the transaction is the input and it gives us a fixed output.
3- having 2 Different inputs with the same hash is a collision. No hash is collision free but it takes so long in the timeline, it doesn’t matter

1 Like
  1. Describe hash functions with your own words
    A mathematical function that can be performed on an input leading to a deterministic and unique output without the possibility of using the output to go back to the input that was used.

  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).
    1.To create a new block and get a reward, miners are required to solve a problem by using a hash function, once the problem is solved ( guessed by hashing ) a new block is created.
    2.In each new block the entire previous block is hashed with a pointer to the previous block thereby creating a linked list between all the blocks in the chain.
    3.Each transaction is hashed as well as the concatenation of transactions ultimately leading to the merkle root hash. Then it all begins again with the next block.

  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).
    Collision resistant means that it should be difficult to find 2 individual inputs that hash to the same output.

1 Like
  1. Hash functions create a unique output for every input you start with.
  2. Hash functions are used in crypto by creating a unique output like a fingerprint for fro every input. Which allows you to verify if a transaction is true and not falsified.
  3. Collision resistant means that it is nearly impossible to find two unique outputs for the same input. that would cause a collision. since every unique input causes a separate output.

It means that 2 different inputs would produce the same hash. (not that 1 input produces 2 different hashes)

1.An hash function takes an input of any lenght and delivers an output of fixed lenght. Every unique input gives a unique output. Even the slightest change to the input generates a radical change in the output.
2. When a new block arrives, its content is hashed. Now, a nonce (a new string) is created. This new string is hashed again. If the resulting string is lesser than the difficulty level of the moment, than the block is added to the blockchain. Otherwise, another nonce is created untill the result is found. Hash functions are also used in merkle trees within Bitcoin blockchain.
3. Saying that hash functions are collision resistant means that each input has its own unique output. Not feasible to find two inputs that generate the same output.

1 Like
  1. A hash function is a unique hexadecimal fingerprint of any piece of data. The input creates the hash in such a way as it cannot be deciphered back to the input.

2, Bitcoin transactions are taken as input and put through a hashing algorithm. Bitcoin uses SHA-256 to create the output code. The transactions can be of any length but the output is always a fixed length.

  1. Collision resistance means that different types of data do not create the same output code. This might not always be possible however.
1 Like

1 - Hash functions are one way functions. You can only obtain the output from the input and not the other way around. There is no way to find an input from the output. Each input produces a unique output, if you change anything in the input the output will change.

2- In the bitcoin protocol, hash functions are part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining process.
In bitcoin mining, the inputs for the function are all of the most recent, not-yet-confirmed transactions (along with some additional inputs relating to the timestamp and a reference to the previous block).

Changing a small part of the input for a hash function results in a completely different output. This property is crucial to the ā€˜proof of work’ algorithm involved in mining: to successfully ā€˜solve’ a block, miners try to combine all of the inputs with their own arbitrary piece of input data in such a way that the resulting hash starts with a certain number of zeroes.

  1. It means that is very unlikely that different inputs will produce the same output.
1 Like

Hash functions are a computation that causes a unique input to produces the exact same output every time.
Hash functions produce the bitcoin addresses used to move bitcoin securely between owners.
A hash function needs to be collision resistant - meaning two inputs should only rarely hash to the same output.

1 Like
  1. Describe hash functions with your own words

Hash functions are a one-way, input/output computation. Input is entered, and through the hashing process a likewise output is created. Each fingerprint is unique, and if one detail of the original input is changed so is the output that follows.

  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).

Hash functions are a vital, very important component for cryptocurrencies. I’d argue this technological process is the backbone of most cryptocurrencies. All transactions on a given blockchain are created and verified using hash functions. Hash functions are involved with the sending/receiving, verification/mining, encryption/keys, and is the process in which blocks are strung together.

  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)

When we say hash functions need to be ā€˜collision resistant’, we are referring to that fact that each input needs to reach a unique, non-duplicated output. Given input and its subsequent output must be resistant to identical fingerprints ā€˜colliding’.

1 Like

The functions are generating different keys as output, from different inputs.
You cannot turn back outputs, in to the original input… Hash functions are very sensitive, if the slightest part of the input is being changed, the output change totally as well.

For example used to digitally sign a piece of software
They helping replace the need of a 3rd parties…
Hash functions are used to identify, compare and run calculations

If the hash functions are not collision resistant, an adversary can break the function with little effort