Homework on Hash Functions - Questions

1. Describe hash functions with your own words

  • An inputs one way transition to a string of data - resulting in a unique output which acts as a Digital Fingerprint for the initial input.
  • Any minor change on the hash input and it will be a completely different output. Yet every exact same input will always have the same output.- this acts as form of system integrity.

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

  • Block Information is hashed and the hash(outputs) are stored in every individual block - resulting in linking them together.
  • The hash of the original block is then stored in every ongoing block receiving the information,

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

  • When two completely different inputs are enabled to create the same output.
  • Any Hash functions with more inputs than outputs are prone to collisions.
  • Weak Hash Functions are more vulnerable to brute-force attacks if the hash function is not collision resistant.
1 Like
  1. Hash functions are the throughput by which input is given a fingerprint with an amount of comfort that the output cannot be reverted via attack such as brute-force.

  2. Hash functions are used in many other cryptocurrencies. The considerable difference to take into account is that network reliability (security) is determined by confidence (translated via mining strength).

  3. Collision resistance- As we learned from the lecture and additional research, collision is disagreement. Thus, being resistant to disagreement translates to a high trust factor in a blockchain. A specified amount of computation power must be provided to establish a satisfactory level of trust.

1 Like
  1. Functions that turns unique data input into unique fixed-length outputs.
  2. Hash functions are used to hash transactions - where the transaction data is hashed in order to get a unique transaction ID; hashing block headers in order to get a unique block ID; mining.
  3. It means that it should be hard to find two inputs that has to the same output.
1 Like
  1. A one way system to make your data unique and protect from any changes and attack
  2. Creating longer hash by using different hash generator so it’s harder to find collision opportunities.
  1. a hash function takes in a data input, runs a formula, then cryptographically outputs an unidentifiable but unique set of data called a hash.

  2. hash functions are used to produce blocks as well as keep private and public keys secure.

  3. it means resistance to the outcome that different data inputs will not produce identical data outputs

1 Like

Homework on Hash Functions - Answers

  1. Describe hash functions with your own words.
    • Each unique input creates a unique output, like an individual digital fingerprint
    • Is a 1 way function. Input to output (never output to input)
    • Converts input text (string) into a fixed length sequence of letters and numbers (hexadecimal output, sha-256)
    • Each input always creates the same unique output, slight change gives out completely different output

  2. How are hash functions used in cryptocurrencies like bitcoin?
    • Part of the block hashing algorithm, used to write new transactions onto the blockchain through the process of mining
    • For bitcoin, input functions are for all the most recent and yet to be confirmed transactions (and time stamped references to previous block on the chain)
    • Crucial to the proof-of-work mining algorithm

  3. What does it mean when we say that hash functions need to be collision resistant?
    • That no two different inputs can arrive at the same hash output (imperative to digital safety)
    • Without collision resistance, algorithm would be vulnerable to collision attacks

blockchain.Ronin

1 Like
  1. A hash function takes any input and translates it to a unique alphanumeric fingerprint. And it is a one way function.
    2.When I want to transfer BTC, the transaction is translated to a hash to keep it free from tampering.
  2. Hash functions need to be collision resistant to ensure that 2 different inputs do not result in the same output.
1 Like

Collision is the probability of two inputs to a hash function to result in the same output. It doesn’t have to do much with mining itself. :slight_smile:

1 Like

What about the second question?

Do you know collision is? :wink:

  1. Using hash algorithms/functions each unique input will produce each unique hash output. We can say that raw data input is changed to its hash output. SHA256 uses hexadecimal format.
    Second crucial thing with hash functions is their irreversible nature. Hash functions only operate in one direction (one way functions). You can go from a input/raw data to an output/hash. But knowing only hash u cant get the input/raw data.
    Third important characteristic of hash functions is that a slightest change made on the input level will produce completely different hash output. This is useful on automation level, where computers can monitor and compare just hashes between each other to guaranty that the data are correct and haven’t been compromised.

  2. In Bitcoin blockchain blocks are linked between each other. Every subsequent block must match to the previous ones + include additional data (transactions still to be confirmed). Knowing that even slightest change on the input side will result in totally different hash, this mechanism prevents any possible error or compromised data to be included into the blockchain. This is the core of the Bitcoin invention IE prevents double spending of BTC.

  3. Collision would mean that two different raw inputs would produce same hash. That would result in a broken hash function. Hash algorithm to be useful must be collision resistant. In theory collisions are not mathematically completely excluded, but probability of them to appear is so tiny that in practice we can ignore this issue.

2 Likes
  1. Describe hash functions with your own words
    A function that is 1 way and creates for each unique input 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 part of the block hashing algorithm used for transactions

  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 the higher the resistance the harder it is to get the same hash output with 2 unique inputs

2 Likes

Oh i might have been missed that!
Collision is when two or more pieces of content produce the same hash

2 Likes

Hash Functions are the mathematical algorithms that Bitcoin miners are rewarded for solving. They are at the center of blockchain technology and the Proof of Work consensus protocol.

They are used to compress and convert any data input into a string of 64 characters. This process is not reversible, which is how immutability is enabled. It is also used for on-chain verification as even the slightest change to the data source will result in an entirely different string of characters.

If 2 different inputs result in an identical output string, this would be considered a collision. Therefore for a hash function to be collision resistant, this must have an incredibly low chance of occurring.

1 Like
  1. Describe hash functions with your own words:
  • Hash function is a function that takes in an arbitrary length, not fixed-size string as an input and produces fixed-size output (which size varies depending on used hash algorithm).
  1. How are hash functions used in cryptocurrencies like bitcoin?
  • Hash functions are extensively used in bitcoin, but they are primarily leveraged in the mining process (PoW consensus mechanism) and public keys creation.
  1. What does it mean when we say that hash functions need to be collision resistant?
  • Hash function is deemed as collision resistant when it is infeasible to produce the same output for two different inputs.
2 Likes
  1. Each unique input will produce a unique output.
  2. "* 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."(https://themoneymongers.com/bitcoin-hash/)
    3." 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 )."(https://cryptography.fandom.com/wiki/Collision_resistance)
1 Like
  1. Hash functions are algorithms which secure and change data to present it in a very specific coded formatting.

  2. Hash functions are used to encode transactions and also ensure that proof of work is completed by checking(confirming) that the same results are given for each process/ transaction.

  3. Collision resistance means that two separate inputs don’t give the same hash output. IF this were to occur transactions and block chain functions would or could be deemed ambiguous as the output would not necessarily always be unique to each input.

1 Like

It means it is impossible to use or it is very difficult to have two inputs that produce the same output.

2 Likes
  1. A hash function is a one way mathematical formula that takes a unique input of any length and content, chops it up, mixes it up to produce a unique output of a specific length and in a specific alphanumeric format. This is a one-way formula, so the best use of a hash is to compare it to the hash of another seemingly identical input to verify its integrity.

  2. In crypto, the transactional information of each block is hashed several times to produce a Top Hash, which is given to the next block to use it it’s own hashes and so on. In this manner, each block in succession contains all of the compounded hashes from every previous block in the chain. This hash information is used by miners to validate transactions, achieve consensus, and move onto the next block.

  3. SHA-256 has 10^77 possible combinations or outputs. Technically, there could be more than 10^77 possible inputs. Therefore, 2 inputs (or more), may produce the same output. This is called a collision. Because of the time-sensitive way in which blocks are created and validated, the probability of a collision is unrealistic and negligible.

1 Like
  1. Describe hash functions with your own words

    A one way mathematical instruction that is applied to a given ā€œinputā€ which results in a fixed length ā€œoutputā€.

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

    Miners use hash functions to prove (Proof-of-Work) that they are creating a block and that leads to consensus.

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

    A hash function must not create the same result for 2 or more different ā€œinputsā€.

1 Like
  • Describe hash functions with your own words
    A hash function uses a mathematical formula to create a unique key based upon the data input, the hash must not allow the original data to be recreated for it to be classed as secure and, the hash must be the same for any given input

  • 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 hash forms part of the information used to write new transactions in the blockchain

  • 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 term refers to the need to ensure that two different inputs do not generate the same output

1 Like