Homework on Hash Functions - Questions

  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

  1. Describe hash functions with your own words

Hash functions are one way functions that produce a digital fingerprint (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).

Hash functions in cryptocurrencies are used to both verify and store the transactions on a particular project’s blockchain. As the inputs are extremely hard to be found by the outputs, it is a perfect function to use in a decentralized and trustless manner.

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

If a hash function is collision resistant, it means that 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 take input and turn it into an output. The hash output turns it into a unique digital fingerprint that will almost always be the same.
  2. How are hash functions used in cryptocurrencies like bitcoin?
    Transactions are the input that gets hashed and turned into deterministic output that will always be the same output as long as no changes have been made to the data. This has function cannot be reverse engineered-it is a one way function so you cannot take the output to figure out the input. Bitcoin uses the SHA-256 hash function which takes the transaction of any length and turns it into a fixed length. The hash of the previous block is contained in a new block.
  3. What does it mean when we say that hash functions need to be collision resistant?
    Collision resistance means that it is very unlikely, but not impossible, to get two different hash outputs given the same input. This is good because the same data in a transaction will most of the time have the same output.
1 Like

1 - hash functions is the encryption/change of any input characters to an output that will produce a set of characters that can’t be understood by anyone or reverted back to the input state.

2 - data is written using hash functions in each blocks within the blockchain to ensure encryption and validity.

3 - hashing output should always be unique for every input, it should never repeat itself with a different input. Every input should generate different output

1 Like
  1. Hash functions are inputs with an output. Once you put an input, the hash will give the input a digital finger print represented by a long random number. That random number is the output. The goal is to make sure that the information stream is one way so that the hash only goes from input to output and never from output to input.

  2. " In simple terms, hashing means taking an input string of any length and giving out an output of a fixed length. In the context of cryptocurrencies like bitcoin , the transactions are taken as input and run through a hashing algorithm ( bitcoin uses SHA-256) which gives an output of a fixed length."

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 such that H(a) = H(b), and a ≠ b. Every hash function with more inputs than outputs will necessarily have collisions ."

1 Like
  • Hash functions are one-way functions which convert each unique data input into a unique data output.

  • Hash functions in bitcoin use the hashing algorithm SHA-256 to convert individual transactions into unique data ouputs. The uniqueness of the data outputs is similar to that of individual fingerprints.

  • Hash functions need to be collision resistant so that no two data inputs map to the same unique data ouput.

1 Like
  1. A hash functions takes an input and gives you a unique fingerprint of the output.

  2. Hash functions in bitcoun are used to scramble transaction data.

  3. It means that it shouldn’t be possible to figure out which input hash functions created the output hash function.

1 Like
  1. A hash function is the one way algo that connects to an array or hash value.
  2. hash functions cryptos to be more secure.
  3. collision resistance makes it difficult to find the same output value of any to imput values.
1 Like

[quote=“ivan, post:1, topic:8430”]

  • Describe hash functions with your own words
    Hash functions only work one way, where an input produces an output(a digital fingerprint) using SHA-256

  • How are hash functions used in cryptocurrencies like bitcoin?
    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).
    By changing a small part of the input for a hash function results in a completely different output. This property is crucial to the ‘proof of work’ algorithm involved in mining: to successfully ‘solve’ a block, miners try to combine all of the inputs with their own [arbitrary piece of input data] in such a way that the resulting hash starts with a certain number of zeroes.

  • What does it mean when we say that hash functions need to be collision resistant?
    A hash function 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 are one way functions that convert an input into a unique, Fixed 256 bit 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).- hash functions are used by miners to secure 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 it’s highly unlikely to be able to find an input to match the output of a hash function. It is still possible though
1 Like

Every hash function has collisions since the number of inputs (basically infinite) will always be larger than the number of outputs (about 2^256 in SHA256). :slight_smile:

1 Like

This is not how we define a collision. A collision occurs when two inputs result in the same output :slight_smile:

1 Like

1- Hash function is a footprint of an input to a fixed numerical output that is not reversible.
2 - First a new block hash is taken, then a random string is appended to the hash, then a new string is hashed again, finally this hash is compared to difficulty level, if not Random string is changed and process is repeated. If yes the block is added to the chain and public ledger is updated and alerted of the addition.
3 - It is really highly unlikely to find 2 inputs that hash to the same output.

1 Like
  1. Describe what a function does in your own words
    In a function you put two sets in a relation.A function has a name, e.g.“f”, an input, (x), and the output, which depends on the input.
  2. Calculate the output of the following function
    f(x) =
    a) 2 is even 2x2=4
    b) 7 is odd 7 +10=17
    c) 0

Write the definition of a function f that takes an input x, divides it by four and then outputs that result subtracted by 5.
f(x)=x/4-5

  1. In Hash Functions, when you input a unique variable you will get a unique output variable. One thing to note is you can not reverse Bitcoin Sha 256 Hash Functions, meaning it has high immutability. Sha256 is invulnerable in comparison to other Hash functions such as MD5; Ethereum uses Keccak256, which is another example of a Hash function used in Cryptocurrency. An example of a Hash function within Sha256 would be, if you imputed text such as “Hello Everyone my name is Kmack” you would receive the unique hash output of (88cc9530005b2d60ac5dd0712a90201ee35cb6c3d12bc1e81944822cd5f5b456).
  2. Bitcoin uses the security & immutability of the Sha256 hashing algorithm to create a perfect environment for the application of digital money. When someone makes an input into the Bitcoin network, no one can do anything to change or reverse that thanks to the complexity and scale of variables within the Sha256 algorithm.
  3. Hash functions need to be collision resistant because you want each input to have its own unique hash output, it does not mean that 2 different variable inputs can’t equal the same hash output, but it does mean that it is nearly impossible for that to happen. Sha 256 isn’t collision free. But it nearly is…. It’s a 1 in a ridiculous number chance. This is good enough for Bitcoin.
1 Like
  1. I really like the term digital fingerprint. A algorithm that allows for someone to easily create a digital fingerprint but not reverse engineering it because of the brute force (energy) it would take to do so.

  2. They are used to create a unique id that is referenced from block to block.

  3. They hash should be distinctly different each time one character is changed before going through the algorithm and the risk of there being duplicate must be very very low.

1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words

A line of code that represents encrypted data that cant be undone.

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

To encrypt financial transations

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

Like there is no way to start working out at pattern that you can work backwards

1 Like

1. A hash function takes an input of any length and creates an output of fixed length. It can go from input to output, but can’t go from output to input, adding on to the last block in the blockchain, creating a verifiable security system.
2. Hash functions are used in crypto currencies by inputting the value into a hash algorithm, and creating a unique, traceable signature for the transaction.
3. The hash function needs to be collision resistant, so that the chance of a newly created being abandoned or orphaned doesn’t occur. This happens when two entities come up with the same hash function during mining. Maybe it happens at other times, under other circumstances?

1 Like
  1. It is a function where the input will be converted to a fixed length of output in alphanumeric format (0-9; A - F) after it is been hash using SHA256 technique. The output is not able to be reversed to find the input, thus it is a one-way hash function.

  2. hash functions are used in bitcoin mining as a proof of work process to achieve output that fits the criteria.

  3. hash functions need to be collision-resistant means there is only 1 unique input that can produce the output. If there can be more than 2 input to produce the same output, it is considered to be not secured

1 Like

You are correct, but you answered in the wrong thread :stuck_out_tongue:

1 Like