Homework on Hash Functions - Questions

  1. Hash Function is a function that has a unique input that gives a unique output. It can’t be the other way around.

  2. It is used to write new transactions into the blockchain through mining process.

  3. Since a hash function should be resulting in a unique output, it should be collision-free. A hash function is collision-resistant if it is hard to find two inputs that hash to the same output. It is needed to prevent a function to break and become unsecure.

1 Like
  1. A hash function takes a string of arbitrary length and returns a string of a fixed length.

  2. Hash functions in bitcoin use cryptographically secure algorithms. Each block on the blockchain contains a hash generated by a SHA-256 algorithm, which always yields a hash 256 bits in length. Cryptographic hash functions are considered secure when their input values determine a unique output, compute quickly and efficiently, are pre-image resistant, sensitive to input change, collision resistant, and puzzle friendly.

  3. When speaking of collision resistance, it is best understood that no hash function is completely collision free. This means that all hash functions have the property that it is possible for different input values to yield the same hash output. For a function to be considered collision resistant, an attacker should only have a 50% chance at finding matching values after 2^(n/2) attempts to compute a target hash, where n is the bit length of the hash returned by the algorithm. In the case of SHA-256, this would be 2^(256/2) = 2^128 tries.

1 Like

1:hash functions allow you to input a piece of data then basically give it its on fingerprint so that you know if somebody hash changed anything as its fingerprint would have changed

2: each transaction for bitcoin is run through SHA-256 to give each transactions its own fingerprint so that so none of the transactions can be tampered with and changed

3:collision resistances is is when two pieces of information are put through a hash function then given the same output which is very unlikely

1 Like
  1. Encrypts the input into an output which is unique to the input.
  2. Used for securing the data in the blockchain.
  3. So that two outputs with different dont inputs match.
1 Like
  1. An input–one way input. Not reversible. A digital fingerprint.
  2. They are used to encrypt, store, secure data and transactions.
  3. Infeasible for 2 different inputs to generate the same output hash.
1 Like

1.) Hash functions are a unique fingerprints of information that can not be deciphered by looking at the hash bits without having the input to start with.

2.) Hash functions are used in Crypto are used to take a input string of any length and giving out an output of a fixed length which keeps BTC & other Crypto’s decentralized, and therefore, secure.

3.) In computer science, a “collision” or clash is a situation that occurs when two distinct pieces of data have the same “hash” value, checksum, fingerprint, or cryptographic digest.
Basically if you found two sources of info that created the same hash bits, this would be considered a collision.

1 Like
  1. An hash function is a mathematic function that basically generate a value from a string of text. It’s a one way function you can go from imput to output but you can’t viceversa.

2.In crypto we use cryptographic hash function a special class of hash function with certain properties that makes them ideal for cryptography.

  1. Talking about probability it might happen that two outputs are identical. When we talk about “collision resistance” we mean that in a 256 bits string the possibilities of a collision is infinitesimal.
1 Like
  1. Every input produces a unique output / unique fingerprint.
  2. Hashs are sent to mempools / nodes where they are mined, once confirmed the broadcast is sent out to the blockchain for consensus. The hash becomes another link in the chain as a valid block requires the previous hash to be valid.
  3. Two inputs not equalling identical outputs.
1 Like
  1. A hash function is like a function (computation), but with two distinct characteristics:

    • each unique input will produce a unique output (like a digital fingerprint)
    • unlike a normal function, you cannot deduce the input by looking at the output.
  2. In cryptocurrencies, specifically bitcoin, hash functions are used to hash transaction data, they are used to link one block of data to the previous block (hence the chain in blockchain), they are used in mining and many other uses.

  3. A collision is when two different sets of data end up with the same hash, so a collision resistant hash function (like SHA 256) is one whose hash output possibilities are so large that it would be infeasible for two different sets of data to produce the same hash output.

1 Like
  1. A hash function converts an input into a fixed number of bits, calculated by a complex algorithm. It is always one way function.

  2. In Bitcoin , every transaction is recorded in a digital ledger or blockchain. Whenever a new transaction is made it is converted to a 256 bits by using SHA-256 hash function and added as a new record.

  3. It means output of two different input should not be same. each input should have unique output.

1 Like

->

-> Hash function in this context, is to cryptographically generate a unique output with a unique input, through a mathematical algorithm to specific function parameters which is extremely difficult to regenerate in the inverted form.

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

-> Hashing is used exclusively in everything in the Bitcoin blockchain. Every data in the blockchain is hashed forming a Merkle Tree. The Merkle Root eventually together with nonce, timestamp, previous block hash which forms the Block Header will be hashed again to be input into the next block in the chain.

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

-> Collision resistant Hash can be described in other words such as where the probability of a hash function outputting the same hash for two different inputs is extremely unlikely.

1 Like

Mempool holds transactions, not hashed (though the txid is a hash of a tx). But miners use hashes to cryptographically link blocks in a chain :slight_smile:

1 Like
  1. Describe hash functions with your own words

A Hash function generates a unique fixed output even if you perform any small change, if any character on the input has been changed then the fixed output will change.

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

These functions are used by Bitcoin network to generate the public keys, private keys and addresses. Also, they are used in the mining verification 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).

This term is used to represent the fact that Bitcoin network ensures there is always just one and only input that can generate the output.

1 Like
1. Describe hash functions with your own words.

Hash functions are one-way functions that is a special function that inputs, which is gives you a unique fingerprint. As soon the input is changed, it will give you a different fingerprint. Once the fingerprint is obtained, there is no way that anybody will be able figure out the input based on the 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).

Bitcoin uses SHA256, which is a hash function. Blockchain is are blocks that contain sequences of data. Hash point is a point that points to its previous block, which hence the chain in blockchain. A hash pointer contains all the has of all the data inside the previous block this small tweak is what makes block chains so revolutionary. Makes it hard for hackers to hack because any changes on a blockchain, means a the data changes immediately. This how blockchain obtains immutability because any changes in the blockchain are noticed and nullified by each preceding 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 is a property of cryptographic. This when it is hard to find two inputs have the same output.

1 Like
  1. Hash function is the result of a unique output given by unique input in a specific function.

  2. Hash function are use in cryptocurrency because the transaction are taken as input and run through a hashing algorithm (Bitcoin use Hash-256)

  3. Given two different input A and B were H(A) and H(B) are their respective hashes, meaning it is no easily possible H(A) to be equal to H(B). Why no easily possible? Because it is no impossible but hard to obtain. In this case it is hard for the hashes to collide in the chain.

1 Like
  1. Hash functions is hashing an input to an output data of fixed size that gives you a unique “signature” You can only go from an input to an output and not the other way round.

  2. In Bitcoin, the hash that is used is the sha 256 algorithm. You use this in creating addresses and public keys

  3. Collision resistant because you will never get the same result/signature using 2 different inputs. And you can not reverse it. However a small change you do, will completely change the result/signature

1 Like
  1. Describe hash functions with your own words
    Hash functions use math to make a string of text values to make a secure message for digital transmission on the blockchain.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    A hash is created from the input string to produce an output of a specific immutable message. Bitcoin uses SHA-256 to create a 64-bit length conversion. The input information is assembled by a computer software algorithm. It makes the output from a series of digits 0-9 and letters a-f. The result resembles a message similar to the following: 769165b84ce2le6f… to a 64-bit specific message that can be confirmed by all involved in the transaction. The output message cannot be reversed or altered. Any attempt to infarct the message is rejected by all parties involved. The message is invalidated and not added to the blockchain. Miners have the ability to openly check and find errors. I believe this is what is described as proof of work used by Bitcoin.

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

Each input has a unique hash. Two inputs with the same hash will result in a collision. Hash function H is less likely to result in a collision if it is harder for two inputs to produce the same output.
I found this explanation online. It is relevant to the previous lectures. It encouraged me to study the formula further and go over the lecture several times. This reference helped me better understand why hash functions need to be collision resistant. It also helps better understand how the formula is applicable.

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. … ) hash operations on random input is likely to find two matching outputs.

(Collision resistance – Wikipedia)

1 Like
  1. A hash function provides a unique 256 bit output for an input. It is impossible to figure out the input based on the output, however the input provides the same output everytime acting as a digital fingerprint.

  2. Hash functions are used many ways in blockchain. They are used to create wallet addresses, public and private keys. They are also used by miners to create new blocks. Miners guess the nonce based on inputs including transactions on the new block and hash information from the previous block. The hash function output changes if any inputs change. The nonce is the key for miners to guess in order to solve the hash function.

  3. A hash function needs to be collision resistant so it is infeasible for 2 or more inputs resulting in the same output.

1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    Hash functions take input and produce an output or 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).
    Hash functions in bitcoin is SHA256 and it requires computation power to produce ongoing transactions with encryption.
  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 is to prevent any easy ways or high probability to find two inputs that produce the same private key. Collision resistance is key component for security of Bitcoin to avoid double spending.
1 Like

Why would collision resistance help prevent sharing the private key? :thinking:

1 Like