Homework on Hash Functions - Questions

  • Describe hash functions with your own words
    A hash function takes a set of input data and creates an output of fixed bit length which corresponds uniquely to the input data.

  • 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 crunch a few sets of data (including some randomization) to create the next block in line. (an oversimplification)

  • 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 occurs when two different sets of data create the same hash. To realize this event one would have to make an infeasible number of attempts.

1.-
Those are functions with special properties which make it of use on cryptography.
They are useful on that field since they are deterministic(same input - same output).
The output can not be used to find the input (not in practical manners).
They can resume a huge amount of data into a very specific length interpretation which is called hash.

2.-
Blockchains are build for blocks that are integrated by certain specific data. In case of bitcoin, it can be the transactions over a certain period of time plus the hash of the previous block. Those involved in the mining of a cryptocurrency will spent work to find a hash (hence using hash functions) that need to have specific characteristics; start with certain amount of zeroes for example.

3.-
collision resistant mean that it should be hard to find two or more different inputs to a hash function that can result in the same output.

  1. Hash functions are a way to encode data using various algorithms.
  2. They are used by miners to try and guess the answer to a mathematical problem.
  3. Collision resistant is the level of difficulty in achieving the same result.
  1. It’s creating an output that’s unique and fixed length code from an input, this output can not be translated into the input.

  2. It creates hash outputs from non-confirmed transactions by mining

  3. That every input will have an unique output (for the most part)

  1. Is a mathematical function that generates a value or values from an initial string input. The output of the function is of a fixed length. Hashing is extremely useful in securing messages meant for a single individual by generating the hash of the information to transmit.
  2. This is because hashing is used repeatedly in the bitcoin process
    a) Transaction are hashed in the process of condensing groups on information to be added to Blocks in the blockchain via the Merkel Tree process
    b) The hash of a previous block and its address combined is included in the Header of subsequent block in the blockchain. (ie. the Hash Pointer)
    c) A hash of the combination of the root of the Merkel Tree and the Hash Pointer of the previous bock is generated
  3. Collision Resistant : This means that their is a need to ensure that the generation of the same output of a Hash based on different input must be extremely unlikely.
  1. Hash functions create a unique but different looking output for every unique input. Like a code that represents that input. That output (or code) of a hash function in not reversible (crack-able) to find out the original input (if not known).

  2. Hash function is used to encrypt a transactions. Then all individual transactions (along with the pointers and timestamp) need to be verified by miners who try solve (work out the original input) and the first to do so, gets to write those transactions into the newest block of the chain and get rewarded with some bitcoin.

  3. Collision resistant means that 2 different inputs should NOT create the identical output.

  1. Describe hash functions with your own words.
    Hash functions are one-way functions which gives each unique input a unique output.
  2. How are hash functions used in cryptocurrencies like bitcoin?
    In bitcoin, hash functions are used to cryptographically secure transaction data. The unique input is encrypted with a hash function to generate a fixed length unique output.
  3. 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. A hash function is the fixed output result of a variable string of inputted text.
  2. Cryptographic hash functions in Bitcoin currently use only SHA-256 (as far as I know). Where the output will be a fixed 256-bit string of text (specifically beginning with a specific amount of zeros).
  3. Collision resistance basically means that input (A) and input (B) will most likely never both result in the same output ( C ). Most likely input (A) and Input (B) will have their own unique outputs.
  1. To create and output that cant be used to figure out the input.

  2. Forcing miners to complete algorithms in turn for a coin.

  3. They need to be so that its difficult to find 2 inputs that will hash to the same output.

1- Hash Function is a one way function that will give you an unique output for each unique input

2- Bitcoin uses SHA-256 for hashing algorithms and it is used in mining blocks where miners use extensive computational power to verify new transactions in order to add a block to the blockchain

3- Collision resistant means that it is ā€œalmost mathematically imposibleā€ to have an input that hash the same output. It is so improbable that it is negligible.

  1. A hash function turns an input in a unique output. However, it is not possible to turn the output of a hashfunction into the input.

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

  3. Means that there are no two imput variables generating the same output from a hash function

  1. A unique input to hash functions produces a unique output string.

  2. Hash functions are used to protect the security of transmissions against tampering.Also control
    hashing difficulty.

3.Given two different inputs A and B where H(A) and H(B) are their respective hashes, it is infeasible
for H(A) to be equal to H(B).

  1. Describe hash functions with your own words
    Hashing is converting a string of data into a unique output, digital fingerprint, for that specific input. That means that if the input is changed a little the entire output changes.

  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 created when transactions with bitcoin are made. Those hash functions are then stored into a block until the block is full.

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

Every input should have one output and collision means that two different inputs have the same output. It’s astronomically unfeasible for this to happen but not impossible.

  1. A hash function converts a input to a unique output which is irreversible.

  2. The hash functions (SHA256 and RIPEMD160) add two extra layers of cryptography to the Elliptic Curve Multiplication (sedp256k1) for a total of three layers of cryptography.

  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. Functions that transform an input into an output so that you can’t tell what the input was just by looking at the output.
  2. They are used to transform transaction data into a hash, which is then concatenated with a series of nonces through mining to find that one nonce so that the hash of the concatenation is equal to the difficulty target. This is done through brute force.
  3. So that the hash of two different inputs doesn’t end up giving the same output. Collision resistance seems to ensure blockchain data integrity.
  1. Hash Functions are where a unique input of any quantity of bits produces a unique output of a fixed quantity of bits including numbers and letters depending on the base quantity.
  2. Hash functions are used in cryptocurrencies like bitcoin for security, transparency and to avoid collision in transactions.
  3. When we say that hash functions need to be collision resistant it means that like likeliness that two different inputs creating the same output are not impossible but that it is not feasible; meaning it is such a small occurrence, and to even try to make it happen would be wildly out of reach and laborious to make happen. Therefore, the nature of this phenomena makes it resistant to such a collision of two inputs creating the same output.

Phew! These answers are getting more challenging already!

1 Like

1.A hashing function is simply a mathematical function that can take any form of data or any size and produce a fixed length output for that particular input.
2.hash functions produces a unique output (or hash)and it is a one-way function. Using this, Bitcoin miners solve computationally difficult math problems to add blocks into the blockchain.
3. This means that it must be extremely unlikely, in other words, practically impossible to find two different inputs that produce the same output

[1] A hash function is a mathematical function that works one way. i.e There should be no equation that can determine the input from the output.

[2] Hash functions in bitcoin are basically used as fixed length digital signatures. Each block has a hash; each pointer that points to another block has the hash of the previous block associated with it; each transaction that’s in a block has a hash value; Each hash value of subsequent blocks incorporate the hash value of the prior block.

[3] To be collision resistant means that the probability of two different inputs giving the same hash output should be almost 0. The longer the bit length of the hash, the lesser the chance for a collision. With SHA-256 and a billion different inputs, there is a probability of about 4.3*10-60 chance for a collision (https://stackoverflow.com/questions/4014090/is-it-safe-to-ignore-the-possibility-of-sha-collisions-in-practice).

  1. Hashing is a math function to generate a fixed length of output based on any string of input.
  2. SHA256 hashing is used in Bitcoin. UTXOs+signatures+output is used to produce hash.
  3. It means no two inputs shall generate same output after Hash. This helps in integrity of the data and to verify that no one has modified the previous Tx.
  1. hash functions are close to one-one that are only practically computable in one direction–in this sense MD5 is no longer a hash function
  2. The sha256 hash function is used in crypto so we can verify transactions without being able (practically) to reverse the computation to get someone’s private key-
  3. there has to a be a low probability that different inputs give the same output, which is called a ā€˜collision’–this is what it means to say the function is close to one-one–collisions are rare an din a one-one funciton they are non-existant