Homework on Hash Functions - Questions

  1. A hash function gives a unique output specific to an input. They only operate in one direction, you cannot take the output and perform any operations that would reveal the input.

  2. Hash functions are used to ensure that a hacker cannot attempt to find an input value through running a string of random values through the hash in order to duplicate a specific output. Another useful feature of hash functions is ensuring the smallest change in the input produces a significant difference in the output. Pointers also add to the immutability of hash functions, they are variables that point to addresses of other variables instead of pointing to addresses of data.

  3. Collision resistance means that each input must have its own unique output, and measures need to be taken to make sure that two different inputs do not result in an identical output.

1 Like

Hi there! Maybe you meant that the hash of the block must start with a certain number of zeros. You can verify this in a block explorer!

1 Like

1.) A hash function gives a unique code to your entered data that is nearly impossible to reverse engineer.

2.) The hashes are encapsulated with the next within the block and linked in the chain to the next hash so that a new hash is generated, and all the previous hashes are attached so that if one hash is changed it will change all of the others which would then make them invalid to the nodes whose hashes would not agree.

3.) The more hashes on the block the more susceptible to the “birthday paradox” where a hash may be so close to the same that one concludes, or necessarily follows the next hash. At the halfway point of the 128bit protocol is when a collision would occur if the inscription of hash 2^128 and 2^64 collide in a chain.

  1. Hash function is one way function where each input produces one output or digital fingerprint.
  2. For bitcoin the transactions are taken as an input and run through a hashing function which gives an output of a fixed lenght.
  3. Each input is transformed to unique output and probability of two different inputs transporting to same output is impossible.
1 Like

Hash Function

  1. Hash function generates a value of fixed length from a string of text. It’s a one way function where every unique input produces a unique output.

  2. Bitcoin uses SHA-256 hashing algorithm, the transactions are the input and run through the hashing algorithm producing an output of fixed length i.e. the hash value at 256 bits in size.

  3. It should be improbable to find a pair of different inputs that will hash to the same output.

1 Like
  1. Describe hash functions with your own words
    A. Hash function are essentially a digital fingerprint, you can got from input to output, but can never go from output to 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).

Hash functions are used to encrypt data on the block-chain.

  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 resistance means that you will have extremely low probability in two things meeting, (i.e.you do not create the same private key as someone else)

1 Like
  1. Describe the hash function?
    It is very secure, extremely difficult and impossible to determine the input hash value while the input slightess change to an input will generate different hash. Each unique input gives unique output with unique digital finger print.
  2. How are hash function used in cryptocurrencies like bitcoin?
    Hash function used to write new transactions into the blockchain through the mining process.
    The transaction are taken as input and run through a hashing algorithm uses SHA 256 which gives an input of a fixed length. Instead of remembering the input data which could be huge, we just remember the hash and keep track.
  1. A hash function takes an input of any size and converts it into an output of fixed size. This is done with a mathematical algorithm. There are many algorithms that can hash an input but cryptography requires a certain number of qualities. These qualities are:
    a) Deterministic. This means the same input will always produce the same output.
    b) Speed. A hash function should be quick to produce a hash value.
    c) Pre-Image Resistant. The input should be extremely difficult, ideally impossible, to deduce from the output to prevent or dissuade brute force attack.
    d) Any change to the input should produce a significant change to the output.
    e) Collision resistant. It should be extremely unlikely, ideally impossible, to get matching outputs from different inputs.
    f) Puzzle friendly. The algorithm should allow the concatenation of hash values.

  2. The hash function in bitcoin uses the data from the previous block as the input and records the hash output in the new block. As each blocks data is dependant on the preceding block all the way back to the genesis block, it is nearly impossible to change an entry within a block without producing a disparity with the following blocks recorded hash output. This enables the network to easily detect attempts to change confirmed blocks.

  3. Collision resistance is a term used to describe the statistical probability of producing 2 outputs of the same value. The lower the probability of a “collision” of outputs the more secure the algorithm is against brute force attacks. It is speculated that in time all algorithms will be “cracked”, either by discovery of mathematical flaws in the algorithm - as was the case with SHA-1 which was hacked with just 2^51 operations despite an output of 160 bits, or by improved technology allowing brute force attack.

  1. A hash function is a function that cannot be retracted from output to input and does not return sequential outputs from sequential inputs.

  2. Hash functions are used in cryptocurrencies during mining new blocks. They cryptographically prove all transactions within the blocks.

  3. Collision resistance means one output can not be returned from two unique inputs

1 Like
  1. A hash function is a very complex function that makes the output (from an input) unrecognizable. Ideally, you should not be able to find the input from the output. The output is then described using a unique 16-bit number (in the case of SHA-256).

  2. In bitcoin, hash functions are used to create a unique number that identifies a block. This block is linked to the last block to ensure that no altering occurs. Hash functions are also used in mining with the Nonce string (still a bit fuzzy on this).

  3. Collision resistant means getting the same output from different inputs is highly improbable.

  1. Describe hash functions with your own words?
    Hash functions take any input string of data and provide an irreversible 256 bit out put that acts as a unique 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).
    Many things from deriving public keys to block signatures, verifying if an unspent transaction can be spent by a specific key and a lot more…

  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 in this instance means that it is highly unlikely (but not mathematically impossible) to get the same output from a hash function.

  1. Hash functions is an input of any length, that will give you an output of a fixed length.
  2. Hash functions are used in cryptocurrencies like bitcoin to keep it decentralized and secure.
  3. Collision resistant means that is infeasible that 2 different inputs will give the same output.
1 Like
  1. Describe hash functions with your own words.
    Hash Functions are a string of data input that creates a specific one way output that is the exact digital representation of that input although the input is un-traceable through the output. yikes lol

  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 part of bitcoins hashing algorithm used for each new transaction in bitcoins blockchain during the mining process and so that each transaction remains anonymous.

  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 resistance in the hash function process refers to the incredible difficult of two inputs hashing the same output signature.

1 Like
  1. Hash Functions are functions where you can only go from input to output.
    And the output will be very different with the smallest change in the input.

  2. With the hash functions algorithm which is used to mine blocks.

  3. It means that the hash functions algorithm needs to be in way that there will not be 2 the same hashes at the same time

1 Like

A Hash is when a variety of inputs of various sizes or lengths are run through Sha256 for example, to generate a 256 character unique “fingerprint” output or a shorter alpha numeric output that is not able to be reverse hashed in order to discover what the various inputs were.

Each block is mined with a resulting Hash output that is then carried forward to the next block as the first input into the block, along with the rest of that blocks variables, which verifies the authenticity og the previous block, as well as the output from hashing the new block. This new Hash output is then carried forward in the same repetitive process, authenticating the accuracy of the blockchain, and ensuring that no fraudulent attempts to change the block chain data has occurred. If it did occur from a rogue player attempting to defraud the chain, it would be easily and quickly detectable within 1 to several blocks going forward.

A collision is when two block outputs generate an identical hash output. Although the odds of this are insanely remote, it is mathematically possible.

1 Like

Hash Functions

  1. Describe hash functions in your own words
    Hash functions is when you give an input and receive an output. The input can be anything and when the output is created, a unique hash is created from the input. In SHA-256, the output will be a 64 bit character length, that will have a unique fingerprint. If someone were to prove they own a certain unique fingerprint, they would input the data that they originally put in the first time and if the hash matches, they validated their unique fingerprint.
  2. How are hash functions used in cryptocurrencies like Bitcoin?
    Hash functions play an important role in cryptocurrencies. In Bitcoin for example, hash functions are part of the mining process which takes multiple inputs and then produces a fixed length output. The data that does in an an input are transactions assembled together that the miner chose are valid. Each time the same data is inputted, the same hash in produced through the output. In the blockchain mining process, the output of one block becomes the input of the next block. The miners are hashing the previous block data, helping the next block connect to the previous block, forming a connection in the blockchain. With the hash function in SHA-256, it is not easily possible to guess what an input is, starting from the output. The chances of this happening are slim and do not even matter. This feature in the hash function is one reason Bitcoin is secure. Other reasons are; the speed in which the hash functions produce data, the immutability of the data, which can prevent the data from being changed resulting in changes to the hashes, and also being collision resistant.
  3. What does it mean when we say that hash functions need to be collision resistant?
    A hash function needs to not have two inputs, which result in the same hash. This is called a collision. With SHA-256, the time for a collision to occur is so long down the road, it does not matter. Having more inputs than outputs could eventually lead to a collision. The odds of it happening are not common to find.
2 Likes

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    A Hash function is a specific formula that takes the input data and performs the computations specified in that formula to generate a unique resulting number called a hash. Only data that are exactly the same will generate the same hash.
  2. How are hash functions used in cryptocurrencies like bitcoin?
    Hash functions are used in the verification of the integrity of the data in a blockchain, to achieve consensus, and is vital in maintaining the data on the blockchain. It is also important in the Bitcoin mining process. It is the means by which miners can participate in the acquisition of Bitcoins.
  3. What does it mean when we say that hash functions need to be collision resistant? Collision resistance is the unlikelihood that a random chosen value when put through the computation dictated by a particular hash function will produce a hash value that exactly matches the hash value generated by different input value processed through the same hash function. This is what gives us the confidence that the data on the blockchain is accurate across the nodes.
1 Like

We say that hash functions need to be collision resistant because the hash of two different inputs should never be the same. Imagine having two private keys controlling the same account!!

1 Like

Perfect!! How about the 3rd question about collisions?

1 Like

Hi there!! It’s better to say that two different inputs should not produce the same output!