Homework on Hash Functions - Questions

  1. Hash functions are functions that are not reversible, and that give a unique output to an input.
  2. Hash functions are used to add transactions to the blockchain in a secure way
  3. Collision resistant means it is difficult to find two inputs with the same output.
1 Like

Well, will review my thoughts for this topic:)

  1. A Hash Function is a one-way irreversible function. In other words, it is so complex that knowing the function’s outputs will not help a hacker or codebreaker determine the input.

  2. Hash functions are the way that blocks are encrypted on the blockchain. A new block is added for every transaction keeping the immutable bitcoin ledger accurate and complete. To add new information to the blockchain, it must be encrypted and the hash function performs the encryption.

  3. In hash functions, a collision is when two discrete inputs share the same output. Because hash functions employed by blockchains are so complex, collisions rarely happen. However, it is important for programmers to be aware of the probability of collisions. Thus, collision resistance is the measure of how often these output doubles occur. The fewer collisions that occur, the more a hash function is considered ‘collision resistant.’

1 Like
  1. Describe hash functions with your own words
    The hash function gives any piece of data it’s own ‘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).
    The hash function in cryptocurrencies like bitcoin is used to cryptographically secure the transactions on the blockchain. Every block has its own hash number as well as the hash of the previous 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 the input to the algorithm can not hash the same output

1 Like
  1. Describe hash functions with your own words.
    A hash is a function where a specific input of any length produces a specific output of a set length (64 characters) that cannot be reverse entered. Any change to the original input will produce a completely different result.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    Transaction information sent from one point to the next is sent as a 64 character combination that produces exactly the same result at the point it is sent to when rehashed.

  3. What does it mean when we say that hash functions need to be collision resistant?
    A hash collision is where two sets of inputs lead to identical outputs. These collisions produce security risks, and hackers have used them in the past. By mapping out possible collusions, this can be reduced.

1 Like
  1. Hash functions gives to an unique input an unique output. The most important thing is that it is impossible to go from the output to the input.
  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.
  3. Collision resistance is a property of hash functions: a hash function is collision-resistant if it is hard to find two different inputs that hash to the same output.
1 Like

Are functions that each unique input will give an unique output, lets say you where to write “ABC” the output would always be “ABC” but if you change the “ABC” to a “ABc” the whole output would be different.
Why is that? Well, we give the digital fingerprint for that input / output and if we were to change the input the output will always be different.

if we were to only have the output we could not know the input without knowing the fingerprint of that input (pgp encryption solves this with providing the public key - digital signature) so verify that output comes from the correct “sender” or input… but you can never go from output to input regardless.

with the functions we learned about earlier you can calculate what the output would be…

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.
The miners get rewarded by providing correct hash that consist of at least 18 zeros.
Look at example here - https://www.blockchain.com/btc/block/000000000000000000e907ebdb890c7f46c0649829b60e98ff5cb5e2b83fcc77
3
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) - Cryptographic hash functions are usually designed to be collision resistant. However, many hash functions that were once thought to be collision resistant were later broken. MD5 and SHA-1 in particular both have published techniques more efficient than brute force for finding collisions.[3][4] However, some hash functions have a proof that finding collisions is at least as difficult as some hard mathematical problem

  1. Describe hash functions with your own words
  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).
  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).
1 Like
  1. Hash function is a way of creating a digital fingerprint for different sets of data.
  2. Hash functions are used with each transaction, so each transaction on the chain creates a block, and that block is derived from a specific set of data which includes the previous hash as well as a specific set of other data.
  3. Collision resistance is a term used in hashing, and what this means is that this hash function must not allow for different inputs to create the same hash.
1 Like
  1. Describe hash functions with your own words

Taking an input and turning it into a base sequence of #s and letters.

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

Moving transaction information anonymously. password verification. Signature generation and verification. Verifying file and msg integrity.

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

If two inputs equal the same output then the Hash Function has been broken.

1 Like

Describe hash functions with your own words
Has functions are a way to fingerprint the data.

How are hash functions used in cryptocurrencies like bitcoin? 

Hash functions are used in the mining process to add new blocks to the chain

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

You need collision resistance so that 2 different inputs do not produce the same output.

1 Like
  1. Hash functions are one-way algorithms that convert unique inputs to unique outputs.
  2. Hash functions are used to create each block of transactions. In that process, the transactions are hashed and so is a portion of the previous block which connects the blocks together and secures the integrity of the block chain.
  3. Collison resistance means that every unique input creates a unique output. In other words, collision resistance means it extremely unlikely that two different inputs to a hash would create the same output and collide.
1 Like
  1. Describe hash functions with your own words. A hash function is a way to create a unique output from any given input, another way to describe this would be to “encrypt” and given 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). Any given transaction in Bitcoin is hashed to create a unique output (code/string/fingerprint), and this “fingerprint” is passed to the next transaction/block in the blockchain where it is used as an input to create the output/fingerprint for that subsequent transaction. This is the blockchain, where subsequent transactions are “chained” together the hash functions.
  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). A collision resistant hash function is one in which the output from any combination of inputs will always create a unique output. If two different sets/bitstreams of input were to generate the same output/fingerprint, then that would be referred to as a “collision”. No hash function is 100% collision resistant, but they can be sufficiently complex so as to render the probability of a significant number or collisions impossible or statistically irrelevant.
1 Like
  1. Hash Functions are one way functions which transform input text to unique output.
  2. Hash functions are used to encrypt the transaction data so its secure and only the intended recipient can decrypt it.
  3. Each input is transformed to unique output and probability of two different inputs transforming to same output is infeasible if not impossible.
1 Like

thank you :slight_smile:

  1. A hash is an irreversible mathematical function that generates a unique, consistent, uniformly sized,
    output for every distinct input.

  2. The Bitcoin protocol relies on a hash function to create a unique hash value representing each block.
    Each block also contains a hash of the immediately prior block in the chain, simultaneously
    providing a sanity check and making it even more difficult to corrupt any given block,
    as it would require rehashing every prior block.

  3. A collision resistant hash is highly unlikely to generate the same output for two
    distinct inputs. While it may not be 100% guaranteed, it should be virtually impossible to generate
    such a “collision.”

2 Likes
  1. Hash functions are functions that are able to encode any input data into an output data with a constant format.
  2. They are able to encode the transaction data giving you a very specific hash code to locate your transaction in the blockchain. Miners are given a hash of the previous block and compete to find the hash for the next block.
  3. 2 different strings of data should never give you the same output data.
1 Like
  1. A hash function takes an input and produces an output based on an algorithm. One of the desirable features in a hash algorithm is that it be collision resistant. That is, each unique input produces a unique output.

  2. Hash functions are used in cryptocurrencies to create new transactions in the blockchain through the mining process…

  3. A hash function is collision resistant when a unique input produces a unique output.

1 Like
  1. Hash functions are a mathematical representation of data that has been encrypted.
  2. Hash functions are used as a way to provide and verify unique data when mining on the block chain.
  3. That you can’t use to different input hash’s to get the same output hash.
1 Like
  1. hash function is like a code in a specific words or input that can’t be crack down.

  2. I think because its easier to validate the chain by the miners.

  3. Collision resistant is when you have the same hash of different input.

1 Like
  1. Describe hash functions with your own words

Hash functions convert any data to a unique, alphanumeric string that changes completely when any part of the input data changes.

  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 convert the nonce to a hash that is used as a digital fingerprint for each block in the blockchain. Miners solve the block by using hash functions to find a hash that met certain conditions. Once these conditions have been met, the block has been solver, the miner receives their reward, and the blockchain is continued from the solved 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).

Hash functions are collision resistant because it is nearly impossible to find two inputs that produce the same output.

1 Like