Homework on Hash Functions - Questions

Hash Function is what is returned when input is computed. It is important to note that each particular input will only produce that one same particular output, if however, you change any part or parts of the input, an entire different output will be computed. Based on which SHA you use, the alphanumeric code that you get will change. The SHA-256 Hash Function will compute a 64-bit alphanumeric code. Needless to say, it is impossible to reverse a hash function and it is impossible to decipher what the original input was by using the output as input data.

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.

Simply put, we need to make sure that it is difficult to find two inputs that hash to the same output.
2021-04-13T22:41:00Z

2 Likes
  1. Describe hash functions with your own words: A hash function is a string of unique numbers, letters and symbols that get created for a specific name, image, basicly any digital media.

  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 to register new blocks once miners validate the data of the transsaction - In general terms new data comes in, minnig starts, miner solves, network consensus and the block gets the previous hash within the new block together with the new unique hash function for the incorporated 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): It means that if I hash “Estefano” i will get H(e) but what happens if I hash “estefano” I get T(e) - It has to be resistant to having two same inputs result in the same hash function…I am assuming a doble spend problem.

1 Like
  1. Describe hash functions with your own words

Hash functions are like converters, where they take something and convert it to something else. A secure converter would be almost impossible to figure out what the original thing was.

  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 to verify and write transactions on 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 means it’s resistant to having the same hash output. The better the function, the more unlikely that there will be the same output hash
2 Likes

Q1 Describe hash functions with your own words

A hash function is a special type of function that maps data of arbitrary size to an output which a fixed size. The special key take away with has function sis that they are one way, meaning that we can go from input to output but never from output to input. Unlike regular functions which are not one way. This is why hash functions bring great security because they can be used to encrypt sensitive data.

Q2 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 play a key factor in maintaining privacy and security on the blockchain. I believe that they can be used a few different ways. Firstly transactions on the blockchain are stored as hash functions. This is because when a transaction is made it can be viewed publicly on block explorers such as etherscan for example. However, transactions can hold sensitive information that the owner of the transaction might not want to be made publicily available. This is because potential bad actors could use sensitive information to take advantage with malicious intent. For example if a persons private key was not encrypted with the likes of a hash function, hackers could use this to rob or steal funds from the owner. This is why hash functions play an important role in cryptocurrencesas they help protect sensitive user information.

A second way that hash functions might be used in blockchain and crypto currencies is to do with actual mining. In bitcoin we know that in order for new bitcoin to be minted or mined, miners compete to solve complex cryptographic functions which when solved reward the miner who solved it with the privelge of verifying the latest block in the blockchain. These complex puzzles are hash function sin themselves and depending on the competition between miners can aqdjust the difficulty accordingly to ensure that on average a new block is verified once every 10 minutes or so.

These are two ways in which hash functions are used in blockchain and cryptocurrencies

Q3 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 cryptography collision resistance is a characteristic of hash functions that defines a hash function to be collision resistant if it is near impossible to find two or more inputs that hash or map to the same output. Why is this important. Well obviously its to do security. The purpose of a hash function is to always map an input to a one way value. We would never want it to be possible to have two inputs that generate the same hash. This would undermine the integrity of the security of the blockchain. For example if a certain hash function was not collision resistant hackers could utilise this to their advantage to find loopholes and compromise the secure nature of the blockchain

1 Like
  1. Hash functions take some input and return an alphanumeric string of some length back that is derived from that input. The output of the function is the input’s hash. This hash can only be produced by using that exact input and any alterations to the input, no matter how slight, will produce a different hash. To find the input from the output of a hash function is incredibly hard.

  2. Hash functions are used in the mining of blocks. Miners hash the block header (a bunch of values that contain information about the current block and the hash of the previous one) to produce the next block. But there are certain requirements that the hash must meet. The hash number must be less that a certain value. The lower the value of the hash the harder it is to find (because there are less acceptable hashes in existence).

All the info in the block header is fixed except for the nonce value. To get a new hash the miners must then change the nonce to a different number and try to hash the block header again.
Whoever discovers a correct nonce, and hence an acceptable hash, is rewarded in bitcoin for mining that block.
The nonce is a 32 integer value chosen by the miner.

One interesting effect of the previous blocks hash being a part of the block header is that altering the transactional history is far harder than subverting the blockchain itself, because that would require changing the hash function of every subsequent block since they are linked. Whereas with a Cybil attack you could only subvert the blockchain at a particular block, but after that you would essentially have a new blockchain and new blocks being produced.

  1. Collision resistance means that it is almost impossible to find two different inputs that give the same hash output.
    Think about this: SHA-256 can give a huge number of different hashes as output, 2ˆ256 actually. This is an unimaginably huge number, however, it is still a fixed limit. And since we know there are an infinite number of inputs possible so we know there has to exist some inputs that give the same output.
    This is incredibly unlikely to happen.
    No collisions have been found so far for the SHA-256 algorithm, but if one were ever found the SHA-256 would be considered obsolete.
1 Like

1. Describe hash functions with your own words
Algorithm that turns an unique input an unique output. This mechanism is one-way, means once you have the output you can’t reverse it back to the input.

2. How are hash functions used in cryptocurrencies like bitcoin?
Bitcoin transactions are taken as input and run through the hashing algorithm which gives an encrypted output. Furthermore miners need to find a certain hash in order to add a transaction to the blockchain. So hash functions are the basement of proof of work.

3. What does it mean when we say that hash functions need to be collision resistant?
Collision resistent means that 2 different inputs will never create the same hash.

1 Like
  1. Describe hash functions with your own words

It’s function that provides unique signature to the data given as input

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

In the bitcoin they are part of Hashing algorithms used to write transaction within the block through mining process.

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

It is really impossible to find 2 inputs producing same output.

1 Like
  1. Hash function generates a unique output from an input. The identical input would generate the identical unique output.
  2. The blocks contain the previous blocks hash output, hence it helps to keep the chain intact.
  3. The same output shouldn’t be the result of different inputs.
1 Like
  1. Describe hash functions with your own words
    Hash functions are functions that process data in a predetermined linear way producing an output for any 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).
    When a transaction happens data, such as the timestamp, get added to the input value. All data together is than hashed and produces a new hash. For bitcoin this data is processed until the hash starts with 18 zeros, requiring an immense amount of computational power.
  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 has function is collision resistant when it is hard to find two different inputs that produce the same hash. This presupposes that there are less input than outputs which, for bitcoin, with 1.157920892373163e77 possible has combinations is impossible.
1 Like
  1. Describe hash functions with your own words
    hash functions are unilaterally solvable algorithms which can ensure data integrity. ANY change in data will change output. This secures the block information.

  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 to securely link blocks together & prevent double spend attacks, ghost chains usurping the official chain, or falsification of data within the network.

  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 need to be collision resistant in order to maintain security of whatever information they encode. If multiple inputs give the same hash output, it may be exploited by bad actors into substituting false information of transactions on the network “double spends”.

1 Like
  1. hash functions provide a unique input and output
  2. hash functions are used as an encrypted way to calculate data on bitcoin
  3. i think that collision resistant means that these hash functions can not be altered or reversed or that there can not be a duplicate of inputs and outputs
1 Like
  1. Describe hash functions with your own words
    Each input correlates with an output that makes reverse engineering the solution almost impossible.
  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).
    Each transaction requires an input that is less than or equal to the hash attached to it, and each input results in very different outputs. Hash functions make it extremely difficult to reverse engineer a quick solution to solve 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).
    It is hard for two inputs to match to the same output.
1 Like
  1. Describe hash functions with your own words.
    Special functions whose output is extremely difficult to trace back to its output

  2. How are hash functions used in cryptocurrencies like bitcoin?
    Hash functions are used to encode transaction data such that it is encrypted and can only be decrypted through the expected receiver.

  3. 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 difficult to find two inputs that hash to the same output, i.e. two inputs a and b such that H(a) = H(b) (b).

1 Like
  1. Hash functions are functions that have an input and an output and can not be reversed. If you input a certain combination of numbers, you will always get the same result.

  2. In cryptocurrencies transactions are entered and move through the blockchain. If “x” is inputted, then “y” happens. Hash functions are used to confirm provenance.

  3. To be collision-resistant means to be resistant to duplication. Every hash function should be unique.

Not so sure about these answers. Feel free to correct.

1 Like
  1. Describe hash functions with your own words

Hash functions can transform any piece of data into an irreversible fingerprint of that specifiec data. Every unique input gives a unique output. Going from output back to input should be mathematically impossible.

  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 to link datablocks to each other using the header of a block to hash a new unique number in the following. Changing any data in any block changes all hashing output and changes the whole chain of referencing blocks, making them invalid.

  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 function that takes more inputs than it has outputs naturally has a chance that different inputs result in the same output. Colission resistant means these “colliding” inputs are hard to find (not that they don’t exist)

1 Like
  1. Hash functions are algorithms that assign to any given input a digital signature, an encrypted output. This can not be done backwards.

2)When bitcoins are mined, the transactions are added and recorded into the blockchain through hash functions.

3)Hash functions need to be collision-resistant, meaning there is little to no chance that two inputs share an output.

1 Like
  1. Hash functions basically as a digital fingerprint or a unique identifer similiar to binary code with 1’s and 0’s. With hash instead of using 1’s and 0’s it translates information into numbers and letters and depending on whether your using SHA-256 or SHA-384 the difference is dictated by how many letters are used in the function.

  2. Hash functions are used in bitcoin for instance in the transaction of dollars so when you submit at transaction to the block. You will be provided a transaction number like a receipt which is your unique identifer or fingerprint for your transaction. This helps immensly with the transparency of crypto currencies.

  3. To be collision resistant it means that you cant have 2 different inputs to 1 output

1 Like
  1. A hash function is a one way function used to keep data secure. It’s “one-way” because you can get the output if you know the input, but if all the you have is the. output you can never get the input. The reason it is so difficult to get the input from the output is because of the complexity of the hash function algorithm.
  2. Hash functions are used to chain blocks together. Each block has a hash containing all of the data from the previous block contained inside of it. This is how all of the blockchains data history is kept.
  3. There are times when you input a value into the hash function and the output may equal an output for another value. (EX. H(a)-b & H(b)=b). The term collision resistant means that the hash function is complex enough to make these repeated outputs very difficult to find. Due to the length of the hash function(SHA-256) discovering repeated outputs would be near impossible.
1 Like
    1. Each unique input will produce a unique output or digital fingerprint. This output is the hash. It is a “one way” function, always working from input to output and cannot be reversed. The hash function is a process that takes plain text data of any size and converts it into a unique ciphertext of a specific length. The first part of the hash function tells you that no 2 pieces of content will have the same hash digest or hash code and if the content changes, the hash digest changes as well.
    1. 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 (along with some additional inputs relating to the timestamp and a reference to the previous block). (https://chuta.medium.com/explaining-bitcoin-hash-functions-to-a-crypto-newbie-454b36634e0c)
      *3. If a hash function is “collision resistant” then the hash code is pretty much resistant to being broken.
      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
  1. Describe hash functions with your own words.

In a hash function, every unique input will produce the same unique output. While it can go from input to output, it cannot go from output to input.

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

Hash functions are used to identify transactions on the Bitcoin blockchain by giving each of them a unique hash. Bitcoin miners identify and solve these hash functions in order to create new blocks for the blockchain and be rewarded with Bitcoin for doing so. This process is called Proof-of-Work.

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

This means it’s important that two different inputs do not produce the same output. In the case of Bitcoin, no collision resistance means there are two inputs that produce the same output, thus leaving the system vulnerable to a hack.

1 Like