Homework on Hash Functions - Questions

  1. It’s a function that outputs data into a uniform format and (ideally) cannot be used to determine the input data using only the output data.

  2. Transactions are hashed onto the public ledger which hide things like private keys but show a record of the transaction.

  3. It’s when the same address is generated twice, giving both parties access to the private keys and thus the entire wallet.

1 Like
  1. Describe hash functions with your own words
    It is a fingerprint because each content gets his own fixed-lenght digit code. It is till now not possible to find the data .

  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).
    It is used for passwords or digital signatures.

  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).
    H 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
Hash functions turn input into digital footprints/outputs. They are only one way functions.

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 are used in ledgers. Each transaction input is turned into a fingerprint/output grouped together that formed into a 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).
No input will produce the same output.

1 Like

1.Hash function works in one direction,and give a unique answer each time ,like a finger print.
2.Hash function used in mining to create new bitcoin
3.Collision resistant means that there can not be the same answer for a single question

1 Like
  1. Describe hash functions with your own words
    Hash functions are functions which take an data input and convert it too 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 used in the mining process to allow verification of new transactions on the chain.

  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).
    It basically means that no two inputs will result in the same output.

1 Like

1- A hash function is a complex mathematical function takes an input string of any length and produces an output string of fixed length. Even small changes in input result in great changes in the output.

2- They are used in cryptocurrency mining.

3- It is (almost) impossible to find two inputs that result in the same hashed output. Such inputs do exist but they are impossible to find in reality, i.e. with current computing power, because of the length of time it would take.

1 Like

1)Describe hash functions with your own words: hash functions are functions such every unique input produces a distinct output such that is possible to determine the output from the input , but where it is not feasibly possible to determine the input from the output.

2)How are hash functions used in cryptocurrencies like bitcoin? Hash functions are used to produce distinct outputs that are feasibly determinable from their inputs (where outputs have the same dimensions (number of characters) regardless of how many characters the input had, etc.

3)What does it mean when we say that hash functions need to be collision resistant? Collision resistant means that the odds of H(a) being equal to H(b) (where a and b are distinct) is very unlikely (meaning that the range from which characters can be chosen would need to be very large), etc.

1 Like

Hash functions are not used for the generation of public keys, for that the elliptic curve is used. Collision resistance describes the possibility of two inputs resulting in the same output. :slight_smile:

1 Like

There are no passwords in the blockchain and digital signatures use public key cryptography not hash functions. The most important use of hash functions on the blockchain is for cryptographicaly linking blocks in a chain, thus the name :wink:

1 Like

It is practically impossible to guarantee that a hash function will not have collisions since the number of possible inputs (basically infinite) is still larger than the number of possible hash numbers (2^256 for sha256) but it is highly unlikely :slight_smile:

1 Like

Describe hash functions with your own words

Hash is a one way (Input to Output) that derives a fixed width unique string for each unique 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).

Hash is used to validate transactions. Miners take the unverified transactions (unique inputs) and output the hash storing it on 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 is when two distinct inputs generate the same output.

1 Like
  1. Describe hash functions with your own words
    Creating a digital fingerprint from an input that is not reversible (you can’t figure out from the output what the input was). As soon as you slightly change the input, its hashed digital fingerprint will be completely different.

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

E.g. for doing transactions via API I need to hash my API key and my API secret/signature

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

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

1 Like
  1. Describe hash functions with your own words.
  • Hash functions are like regular functions where they receive a unique input and give out a unique output but they are not similar when it comes to converting an output into an input because measures have been taken to make sure it is infeasible to do so.
  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 conjunction with Data Structures(Pointers & Linked Lists) to link blocks in the blockchain to the previous and next blocks in a secure way.

  2. 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).
    -In probability, the birthday paradox states if you have “N” number of possibilities on an event happening. you need the square root of N random items for them to have a 50% chance of collision/matching.In hash functions, suppose you have a 128-bit hash with 2^128 different possibilities, this means you have a 50% chance to break the collision resistance at the Sqrt(2^128) = (2^64th) instance.

1 Like
  1. Describe hash functions with your own words

A hash function is an equation that uses an input runs it with a protocol for bitcoin SHA-256 and gives a unique 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).

Bitcoin uses the SHA-256 hash to generate random numbers in a way that requires a predictable amount of difficulty. SHA-256 allows bitcoin to set the difficulty level for mining 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).

A collision happens when two different data inputs result in the same hash output. This would result in multiple BTC miners receiving the same block that was mined and a duplicate in the chain. Collision resistant means it is nearly impossible for two inputs to result in the same output.

If the blocks would be the same there would be no problem (same input). :slight_smile:

1 Like
  1. Hush functions are always one way functions which transform input text to unique output.
  2. Every transaction in cryptocurrencies like bitcoin uses hush functions with 256 character hash regardless of the size of input.
    3.It means every output is unique.
1 Like
  1. Describe hash functions with your own words
    It transforms data of any size into an output of 256 bits (SHA 256). Hash functions protect the original data from being discovered and makes the work of nodes easier during their maintenance task based on their structure.
  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 happens in the form of Merkle trees. This procedure make storing data very efficient.
  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).
    It means that every hash is unique. Each input will have his own hash. How more bits you have in the hash algoritm, how safer/secure it is to say that the chances that a hash refers to two different data, is almost nonexistent.
1 Like

Merkle tree is a tree of hashes, it is a data structure that contains hashes of the transactions that have been hashed beforehand. Its true that intermediate nodes inside the tree are hashed all the way up to the root, so we get the Merkle root that is then used in the block hash combined with the previous block hash :slight_smile:

1 Like

That is a much more complete anwser. Thank you!

  1. Hash functions take in an input of any size, run it through an excepted Hash algorithm (Bitcoin SHA 256) that gives a fixed output that is the same for that particular input. If anything about that input changes then so does the hash output.

  2. One way they are used in Bitcoin is as anchors. After the genesis block, each block is anchored to the next by attaching the hash of the prior block.

  3. The term collision resistant refers to the input and means that no two inputs can have the same hash.

1 Like