Homework on Hash Functions - Questions

They are fundamentally different in regard that Elliptic curve is used for deriving public keys and generate signatures and to encrypt/decrypt messages.
Hash functions on the other hand are used to generate fingerprints of data that anyone can input and recalculate the hash, not only the ones that have either public (to verify signature) or private (to decrypt) key. :slight_smile:

1 Like
  1. Functions that give an output for an input but cant be reversed.

  2. Each block contains the hash of the previous block which means that if you change the end block you change all blocks which just doesn’t work.

  3. Means that two inputs will have the same output. (On rare occurrence.)

1 Like
  1. Describe hash functions with your own words
    Irreversible function that produces a unique digital fingerprint.

  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).
    When mining, hash functions are used to add new transactions to
    the blockchain.

  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 each input will have its own unique
    hash so that no 2 inputs with the same hash.

1 Like

Okay, Whatever that is

Q1 Describe hash functions with your own words

A1: Hash functions return a unique 256 bit value (fingerprint) for a specified string input.

They can be referred to as “one-way” functions since it is almost impossible to determine the value of an input from the ‘hash’ output - aka processing of 'reverse hashing’

Q2: How are hash functions used in cryptocurrencies like bitcoin?

A2: Cryptocurrencies like Bitcoin use blockchain and hashing technologies providing an exceedingly high level of security.

Each blockchain is a linked list of transactions (blocks) and the processes of storing the hash of each previous block prevents them from being tempered with.

Q3: What does it mean when we say that hash functions need to be collision resistant?

A3: Basically, a hash function is collision resistance if it never creates (outputs) the same “hash” for two or more given unique inputs.
In other words, the output (hash) is always unique for each and every unique input.

Reference(s):

1 Like

Hash Functions

  1. Describe hash functions with your own words
    Hash functions take input of variable length and deterministically output a string of fixed length. This process is irreversible, such that it is very easy to get to the output (i.e. the hash) from a known input but very hard (ideally impossible) to get to the original input from a known output. Any unique input is supposed to generate an equally unique output and this avoid collision.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    In the case of Bitcoin the SHA-256 is used as one step in the creation of new addresses and also lies at the heart of its proof of work algorithm.

  3. What does it mean when we say that hash functions need to be collision resistant?
    Collision resistance of a function means that it is extremely unlikely to find 2 inputs to that function that have identical output. Such a collision would, for example, break the important notion of each newly created Bitcoin address being unique.

1 Like
  1. Hash functions use a unique input and produce unique outputs based on the exact input, slight changes in inputs will drastically change the output. Making it hard and nearly impossible to go from output to input.

  2. Hashing functions are used to verify and add new transactions to the blockchain.

  3. Hash functions need to be collision resistant because of the “birthday paradox”. It seems very unlikely but it could be possible to have two of the same inputs that could produce the same output, so we need to avoid this by using collision resistant hash functions.

1 Like
  1. Describe hash functions with your own words

Hash functions are a tool used to create a unique ID output for a specific input. You are not supposed to be able to deduce the input from the output, and 100 percent of the time the same in put will give you the same output and 100 percent of the time a different input gives you a different output.

  1. How are hash functions used in cryptocurrencies like bitcoin?

It is used to mine new transactions on the blockchain. The new transaction is the input and the out put is the hash.

  1. What does it mean when we say that hash functions need to be collision resistant?

Collision resistance means that you will find it impossible or near impossible to find two different inputs to give you the same out put.

1 Like
  1. Hash functions = a function that is used to generate a unique code (hash) that represents an input value of any length. The input can be any size - the output is always the same size. A hash function can only work one way - input to output - you can’t figure out the input based on the output of the hash function. The output will always come out the same if given the same input - if a slight change is made, the output will be totally different.

  2. Hash functions are needed for Proof Of Work in Bitcoin - also used for generating crypto wallet addresses and passwords

  3. Collision resistant = the hash function should be so complex that it doesn’t produce the same output hash for any two or more random inputs - making it collision resistant.

1 Like

1-> a Hashfunction converts input to a unique fingerprint output but can`t reverse from the unique fingerprint output to the original input
2-> to secure the string of blocks on the blockchain, when someone or something try to change the data in one of the blocks the hashfunction changes and changes all the hashfunctions in the blockchain and then the nodes are coming in to play
3-> the possibillity that 2 different inputs get the same output / hash

1 Like
  1. A hash function is taking a data input and creating a unique output that represents the original data.

  2. Hash functions in Bitcoin are used to verify and record transactions and create Bitcoin addresses.

  3. Collision resistant means that 2 different inputs do not get the same output.

1 Like
2 Likes

1- A hash function is a function that can take an input of an arbitrary size and get a fixed output.

2-In cryptocurrencies like bitcoin, transactions are used as an input and the output of a fixed length will be obtained using the algorithm: SHA-256.

3-This means that hash function should not have two different input that produce the same output.

1 Like
  1. A hash function takes any string of data and converts it into 256 bits. This process is impossible to reverse and provides a unique identifier for your data.
  2. In Bitcoin the Hash function is used to hash transaction data. Also mining and finding a nonce requires finding a number that generates a specified hash in combination with data unique to that block.
  3. Collision resistant means two different things not getting the same hash.
1 Like
  1. Describe hash functions with your own words

Hash functions are algorithms that calculate a uniqie value with a fixed bit lenght. In case of SHA 256 it is 256 Bit long. There is no way to determine the input value backwards. If only a single bit in the input value would be changesd, the reult of the hash function would be completely different.

  1. How are hash functions used in cryptocurrencies like bitcoin?

In cryptocurrencies like Bitcoin hash funktions are used during mining and on transactions in the Blockchain. In mining there is a number to be found that generates a special hash which starts with a certain number of 0 digits combined with the haash of the hash of this block. This is very computing power consuming task.

  1. What does it mean when we say that hash functions need to be collision resistant?

This means that it is hard to find two inputs that as result would show the same output hash.

1 Like

1- A hash function is a one-way computational function that takes in a string of text and generates a unique output
2- In cryptocurrencies, Hash functions are used to generate new transactional hashes that added to the chain via the mining process
3- Collision resistance is the property of a cryptographic hash function that makes it infeasible to have 2 separate inputs hashing the same output

1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words

A hash function is a tool used to produce a unique hash of a fixed length for any string of data or arbitrary number. A hash is a one way function and cannot be reversed.

  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 used in Bitcoin to hash the transactional data contained in the previous blocks, it is also used to combine the transactional data with the nonce and time stamp.

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

This means it is hard to find two find two input that hash together to make the same output. Not impossible but hard.

1 Like
  1. Hash functions are functions that you pass a unique input and it returns a unique output. With hash functions it is not possible to go from output to input.

  2. With bitcoin the transactions are taken as input and run through the hash function/algorithm (SHA 256) which gives an output of a fixed length.

  3. This means that the probability of two different input giving the same output is highly unlikely.

1 Like
  1. Describe hash functions with your own words

Hash functions are one way functions in the sense that it can be provided with an input that will be converted to an output. It is almost impossible to obtain the input from the output. Hash functions gives data (input) a digital finger print (output) seeing that each unique input the has function is given a unique output is provided.

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

With Bitcoin, transaction data is stored on what is known as blocks. Each block has a unique hash provided through the SHA-256 hash algorithm. Even a slight change in the data will cause the hash of the block to change. Each block contains the previous block’s hash. If the hash of a block changes it breaks the chain in the block cain rendering the block invalid.

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

Having two different inputs providing the same output is known as a collision. No hash function can be 100% collision free. For a hash function to be collision resistant there has to be a very low probability for a collision to occur.

1 Like
  1. Hash function is a security for your network and it is an easy way to check if someone did not change the input.

  2. Hash is a mathematical operation that used for proof of work what is the vital component in consensus. When a miner solves the math true nonce. Then it’s send as a block and the other miners check iff the hash is correct and then it’s added to the chain of blocks(blockchain).

  3. When it’s not colusion resistant it means that 2 inputs can get the same out put. Iff that happens You kind off destroy the concept. Thats why it is important that the hash function needs to be collision resistant

1 Like