Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    A hash function is a special function which takes a string (input) and turns it into an alphanumerical piece of information (output) up to 256 digits. A minor change in the input gets a completely different input. The output can’t be reversed into the input.

  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).
    The input is information for the hash are new unconfirmed transactions which some additional info on time and reference to the previous block.
    By hashing the transactions transactions are turned into the alphanumeric piece of information. This is the hash and when the hash meets the target difficulty a new block is mined.

  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).
    This means that 2 ore more different inputs cannot produce the same output

1 Like
  1. Hash f is a one way only f, where for the given input a unique hash or digital fingerprint is created.
    2.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).
  2. CR means that there should not be the same hash output for two different inputs.
1 Like
  1. Describe hash functions with your own words

Hash functions are functions for which you can give input to produce output, but can´t use the output to get input.

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

SHA-256 hash algorithm is used to generate computational challenges for miners. The algorithm generates a SHA-256 hash that miners need to guess. A value lower than current target solves a block.

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

Collission resistance means that it is difficult to find the correct input to generate an output that is being guessed.

1 Like
  1. Describe hash functions with your own words

Hash functions are functions that can map an input of arbitrary size to an output with fixed size, and it is irreversible by nature. This means that one cannot get the input based on the given output.

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

In bitcoin, has functions are required to successfully generate a new block and write new transactions into the blockchain through the mining process.

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

Collision resistant is a property of cryptographic hash function where it is almost impossible to find two different input that has the same output. The minimal requirement for a hash function to be collision resistant is to have 160 bits length.

1 Like
  1. hash is the system used to store the output of the input without the observer of the output knowing the input
  2. through sha 256 the input is hashed and irreversably found from the output

what happened to answer number 3?

oops…yeah answer number 3= virtually impossible to generate an input that would give the exact same output of a different input.

1 Like
  1. Hash functions are unidirectional or linear computations that takes imputed data and produce a set of alpha numeric digits as output, which are digital fingerprints unique for it’s input.

  2. Hash functions are used in cryptocurrencies like bitcoin for consensus algorithm, unconfirmed transactions as well as additional info like refers ce to previous block and timestamp are hashed by the hash algorithm producing a 256 alphanumeric digits as it is with bitcoin, with the SHA-256 hash algorithm, when Miners meet the target difficulty by solving for a value lower than has then a new block is mined and added to the blockchain

  3. When we say a has function is collision resistant it means that it is computationally infeasible for two inputs to produce the same hash.

1 Like

Repost of my own work.

Describe hash functions with your own words

Hash functions are special for two reasons. Firstly, for each unique input will result a unique output. It will give a fingerprint for each input. Secondly, one can go from input to output but you can not reverse output to input. A hash function is a one way function.

How are hash functions used in cryptocurrencies like bitcoin?

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.

The US National Security Agency (NSA) developed the SHA-256 hashing algorithm in 2001 which is the primary hash function used by Bitcoin’s blockchain.

This particular hash function is used because of these properties:

Unique hash value: For every input, it produces a unique output

High hashing speed: For each given input the computation is fast.

Secure hash function: It is almost computationally infeasible to reverse the function and make it two-way.

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

Collision resistance is a property of cryptographic hash functions: a hash 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 such that H ( a) = H ( b ). Every hash function with more inputs than outputs will necessarily have collisions.

1 Like

Answers:

  1. Hash-functions are one-way functions that change a piece of information to a new output (usually in a shorter size version). When using a Hash-function, he same piece of information will always give the same output. Hash-functions outputs cannot be reverted to the original message and in that way the information is secured.
  2. Hash-function use in cryptocurrencies are used to create the private-public keys that allow transactions on the blockchain. I know this is a short answer :rofl:
  3. Collision resistant means that two different inputs cannot give the same output.

If a != b and H(a) = H(b) the H function is not collision resistant.

1 Like
  1. hash functions are one way functions that takes a unique input and returns a unique output or digital fingerprint.

  2. In Bitcoin it is used to hash transaction data, and 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

They are cryptographically encoded outputs. Meaning that a each input produces an output of a number of letters and numbers that are completely different. This is a one way process that can’t be back engineered and means that an output can’t be linked to its input.

  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 part of the block hashing algorithm used to write new transactions into the blockchain.

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

Collision resistance is a property of cryptographic hash functions. 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 functions is a function that takes an input, and converts it into a non-reversible fingerprint consisting of numbers and letters.
  2. How are hash functions used in cryptocurrencies like bitcoin?
    Hash functions are used to write new transactions on to the blockchain through the mining process.
  3. What does it mean when we say that hash functions need to be collision resistant?
    This means that for any two different inputs, the output of the hash function should not be the same.
1 Like

Answer 1 - A Hash function produces a unique fingerprint equivalent output for every unique input

Answer 2 - Bitcoin uses SHA-256 hash function

Answer 3 - As per Wikipedia - " In cryptography, collision resistance is a property of cryptographic hash functions: a hash function H 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) "

1 Like
  1. It’s an one way function. We can’t go back on input starting from outputs.
  2. BTC uses hash functions in mining to generate verifiably random" numbers in a way that requires a predictable amount of CPU effort
  3. Two different inputs can’t give the same output.
1 Like

Hash functions is a specific and unique string of code that is generated as an output based on the data or media that is input. Any changes to the input would result in a completely different output or code. It is by design a one way function which means you can only use the Input to generate the Output and never use the output to generate the input.

Hash functions in cryptocurrencies are used to ensure data integrity.
A transaction hash is given to every transaction that has been verified and added to the blockchain.
Cryptographic hash functions can also be used in cryptocurrencies to transfer transaction information anonymously.

It should be impossible for 2 inputs to produce he same output. If hash functions produce the same output for 2 different inputs that would compromise the safety and integrity of the data and thus the blockchain

1 Like
  1. Hash functions take data and convert it into a digital fingerprint, composed of numbers and letters) that is always the same length.

  2. Hash functions are used in bitcoin mining to create new blocks within which new transactions are verified

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

1 Like
  1. A hash function converts any type of data into a string of a specific length (in this case, 256 bit). It is a one-way street and there’s no way to convert a hash back into the original data. So it’s one good way to encrypt data like passwords, convert them into a hash that cannot be easily hacked.
  2. Each transaction on the Bitcoin blockchain is encrypted with a hash function.
  3. Collisions are basically duplicates, where two users or transactions could have the same hash function. This would result in a massive issue because one user could steal another one’s money, and the data would become unreliable. Sha256 currently has no known collisions, but if there were any we would move to Sha512.
1 Like

Hash functions are functions that produce an output with a unique digital fingerprint and fixed length.

Hash functions are used to encrypt Bitcoin transactions.

Two inputs can’t have the same outputs.

1 Like

Homework on Hash Functions - Questions and Answers

  1. Describe hash functions with your own words

    A cryptographic algorithm used to take a unique input and product a unique output. One-way.

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

    Bitcoin Miners compete by computing / running the SHA 256 algorithm and comparing the out received against a target number.

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

    Ensures that no 2 inputs produce the same output.

1 Like