Homework on Hash Functions - Questions

  1. Describe hash functions with your own words

It’s a linear function where a certain input creates a certain unique output, and the process cannot be reversed. That means, the output cannot be broken down to the original input. THis creates a unique output for every unique input, and if the input changes just a little bit, the output is completely different.

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

They are used to create unique, secure keys/digital fingerprints (such as private keys) that nobody can break down (or it’s very difficult, almost impossible, to do) and this provides safety and security for Bitcoin and the users/investors/traders. And it provides data integrity as well.

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

It’s very difficult to find a hash function where a two different inputs create the same output.

1 Like
  1. A hash function is comparable to taking an apple, putting it into a machine that slices it a very unique way. If there were 2 genetically identical apples, the resulting set of apple-slices would be identical. otherwise, every apple will produce a different set of slices. The slicing mechanism is sufficiently complex so that it’s impossibile to reconstruct the original apple from its slices. :rofl:

  2. In cryptocurrencies like bitcoin, the hash function is used for incoming data of not yet confirmed transactions as well as additional data such as time stamps. Mining basically is the work of computers trying out different data to feed into the hash algorithm until the outcoming hash starts with the ever changing requirement of number of zeros at the beginning of the hash.

  3. A hash function is higher in collision resistance the harder it is to obtain 2 identical hashes from different inputs.

1 Like
  1. Describe hash functions with your own words

They are functions that give unique output for every 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).

bitcoin uses hash functions to sign transactions with the private key, or for mining by hashing the block of transactions and locking it in 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).

that every input gives a different output.
if it is not collision resistant there can be two different inputs that give the same output.

1 Like
  • A Hash function is a computation that performs an operation (Calculation) on a sequence or string of data and converts that data into a UNIQUE fingerprint that uniquely represents the original data. No other output will ever equal or be exactly the same as this Hash output. The Output is a variable-length hexadecimal string.
  • How are hash functions used in cryptocurrencies like bitcoin? The Hash output from the hash algorithm is used in Bitcoin to ensure that the information stored in this encrypted format can NEVER be REVERSED back into the original data so that it is NOT possible to counterfeit the original data or copy it.
  • What does it mean when we say that hash functions need to be collision resistant? This means that NO 2 outputs of a hash can ever be the same for 2 different Inputs so every Output is unique.
    [/quote]
1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    A hash function is a one-way function that gives a unique output of a fixed length.

  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 in Bitcoin are used to hash the transactions of a 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).
    Two different inputs should never give the same output.

1 Like

Yes but there will always be more inputs (basically infinite) than there are possible outputs (2^256). So every hash function will have collisions, its the probability of these collisions to occur. :slight_smile:

1 Like

Private keys are just random numbers generated by a computer and to derive public keys the elliptic curve function is used. Bitcoin utilizes hash functions in the PoW and to generate txids. :slight_smile:

  1. Describe hash functions with your own words
    Answer: This is a maths formulae to produce an output of fixed length no matter the input and that output is always the same if the input is the same. The output cannot be reverse-engineered to find 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).
    Answer: Hash function is comprised of 6 features. 1. Deterministic - always the same output for a given input. 2. Quick computation - makes it suitable for use. 3. Pre-image Resistance - Output cannot be used to calculate the input. 4. ANY change in input changes the output. 5. Collision Resistant - because of the large numbers used, it is very unlikely there will be a collision. 6. Puzzle Friendly - allows for using numbers of high value such that is nearly impossible to guess the input, and so unlikely. All when applied to a chain of blocks, means that any change attempted by a hacker on one block, would result in altering data in the next and subsequent blocks and even previous blocks and therefore fail.

  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).
    Answer: Collision Resistant - because of the large numbers used, it is very unlikely there will be a collision.

1 Like
  1. The hash function is the process of creating a digital fingerprint (fixed) , from any given input.
    2.Hash functions used in the crypto space are used to create these digital fingerprints (fixed output) , wich contain recent or not yet confirmed transactions , with also some extra information like time stamps , and reference to the previous block).
  2. Collision resistance is the property of a hash function that it is computationally infeasible to find two colliding inputs. This property is related to second preimage resistance , which is also known as weak collision resistance .
1 Like

Thank you Alko, all suggestions and comments welcome. John

Yes, but do you know what a collision is?

  1. Hash functions create unique outputs from each input and it’s impossible to find out what the raw input is from the output.

  2. Hash functions are part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining process.

  3. It means that it is hard to find two inputs that hash to the same output.

1 Like

1.Hash functions are unidirectional functions where one unique input produces one unique output.
2. In Bitcoin, it is used to hash transactions, so every transactions, gets its own digital fingerprint.
3. A hash function is collision resistant when it is impossible to find two inputs that lead to the same output

1 Like
  1. Hash functions make it very difficult to reverse engineer the input from the outcome of a hashed equation.
  2. Hash functions are undefined and are used by miners to validate transactions on the B/C
  3. Collision resistance offers the safety measure which makes it extremely difficult for two different outcomes to be generated by the same hash.
1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    A) Hash functions basically have two key focal points
    1. Each input gives a unique output (fingerprint)
    2. You are good to go from input to output but not vice-versa.

  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).
    A) Got this from Coindesk:
    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.
    …and they are also used for passwords.

  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) If they’re not collision resistant their security can be breached.

1 Like

True, but can you explain what collision resistance is? :slight_smile:

  • Describe hash functions with your own words

It is an output of the function where the input can create letters, numbers or even media files.

  • 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 which is used to write new transactions into the blockchain through the mining process.

  • 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 is hard to find two inputs that hash to the same output. Collision resistance doesn’t mean that no collisions exist; simply that they are hard to find.

1 Like
  1. Hash functions are one directional functions that take a unique input and create a unique output.
  2. Hash functions are used in cryptocurrency to verify the legitimacey of all data that passes through the blockchain. Since Hash functions create a unique digital fingerprint for all data. It becomes simple to verify the legitimacy of transactions and data.
  3. Hash functions need to be collision resistant. In the sense that it is infesable to find two inputs that result in the same output.
1 Like

I really like your reply to this. You summarized this well, I was a little confused on the second question but your explanation was actually quite simple. Thank you!

this is what Wiki says
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 ab but H ( a ) = H ( b ) The [pigeonhole principle] means that any hash function with more inputs than outputs will necessarily have such collisions; the harder they are to find, the more cryptographically secure the hash function is.

To me this means - if there are 2 different inputs it is not going to equal the same output thus they collide instead of marrying the result - something like that.

1 Like