Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    it is process of converting the input data to string of fixed numbers base on the type of hashing you are using such as SHA-256 and its impossible to reverse.

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

from my simple understanding now it is way used to hash transaction data so transactions are taken as input and run through a hashing algorithm ( uses SHA-256) which gives an output of a fixed length.

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

H is collision resistant if it is hard to find two inputs that hash to the same output.

1 Like

Thank you for the clarification.:+1:

1 Like

Awesome explanation my friend. I do appreciate the clarification. I will revisit the subject matter for a better understanding. Your insight is welcomed anytime, please keep up the good work.

1 Like

It is a Function that allows you to converting plain input text to encrypted hash value using the cryptographic algorithm.

Hashes are used to represent the current state of the blockchain and it ensures blockchain immutability. Every transaction contains some information like sender address, receiver address, amount timestamp and so on; this information combines and goes to the hash function, which generates a unique hash value called transaction hash or transaction ID. This hash is used to verify and can be confirmed that a particular transaction has happened on a blockchain or not. Different blockchain uses different hash functions, bitcoin blockchain, for example, uses SHA-256 hash function to secure the data.

Collision resistance is trivially satisfied by random oracles and in common practice,
to achieve it, we heuristically rely on unstructured hash functions like SHA.

However, when considering theoretical constructions with formal reductions, collision resistance is only known based on problems with some algebraic structure, like Factoring, Discrete Log, and different short vector and bounded distance decoding problems in lattices or in binary codes.

1 Like

1: Describe hash functions with your own words
Hash functions are a way of encrypting data.
An input is taken, a calculation is performed on it which produces a unique output.
Changing a single bit in the input results in an entirely new output.
There is no way to reverse-engineer the output to find the input, but the output may be used to verify the integrity of the input.

2: How are hash functions used in cryptocurrencies like bitcoin?
Transaction data is hashed with Pointers, Timestamps and a nonce.
Verifying hashes proves legitimacy of data.
Blocks are mined by solving hashed blocks.
Hashing is also used in key creation

3: What does it mean when we say that hash functions need to be collision resistant?
For any two given inputs, (A + B), it is infeasable that the hash results of those inputs match

1 Like
  1. Hash functions provide a unique output for a given unique input
  2. Hash functions are used to secure transmission
1 Like

Hashes are used in transactions to get transaction ids. But more importantly, they are used to cryptographically link blocks in a chain :wink:

1 Like

You forgot to answer the last question about collision resistance :wink:

1 Like

will be at the beginning of stating a transaction creating the hash function

[quDescribe hash functions with your own wordsote=“ivan, post:1, topic:8430”]

1 Describe hash functions with your own words
HASH function is a mathematical based function. It takes in data of arbitrary length and gives output (digest) of fixed length.

2 How are hash functions used in cryptocurrencies like bitcoin?
HASH functions are used in mining to write new transactions into the blockchain

3 What does it mean when we say that hash functions need to be collision resistant?
To input should “never” (infeasible) render the same output

1 Like

Even though you took this portion of the course last september I read a lot of responses to questions.
I like your answers, they are easily understood and to the point. I am a newbie to this field and enjoy
clear answers. Thks.

1 Like
  1. Hash functions are like a tool used to create a password on super steroids.

  2. Hash functions are used to encrypt smart contracts. Smart contracts make up the block chain. Hash functions run an algorithm on this information that will go in the blockchain in order to create a unique code.

If we need to make something collision resistant then we need to make it difficult to get the same hash value twice.

A hash function is a mathematical function that converts a numerical input value into another compressed numerical value. The input to the hash function is of arbitrary length but output is always of fixed length.

Bitcoin’s cryptographic hash function take a sequence of letters & numbers of any length as input (called a string) and returns a sequence of letters of a fixed length (output). Whether the input string is a single letter, a word, a sentence, or an entire novel, the output (called the digest) will always be the same length.

Collision resistance is the property of a hash function that it is computationally infeasible to find two colliding inputs.

1 Like

Its great to see you learning from our community members. We appreciate it. :smiley:

2 Likes
  1. That is one weird example for sure. :joy: It’s important to note that the hash functions take any input and produce a unique fixed output. It’s a one-way function, which means we can’t go from the output back to the input.

  2. In bitcoin, hash functions are used to secure transactions in a block. Hash functions hash, they can’t encrypt. You will learn more about smart contracts in the Ethereum 101 course. Smart contracts are not encrypted, they are publicly visible and written in the solidity programming language.

  3. Yes, we need to make sure that it’s hard for 2 different inputs to produce the same output. However, the same input will always produce the same output.

1 Like

What is the name of the process that uses hash functions in bitcoin?

… that will produce the same output. (adding to your sentence)

1 Like
  1. Describe hash functions with your own words
    Given any size input string,
    a “practically unique” fixed length string (hash) is produced.

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

To calculate the hash of each transaction, all the way up to the Merkle root.
The hash value chains the blocks together, giving rise to the immutability feature, of the blockchain.

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

Two inputs will very seldomly give the same output, for a given hashfunction.
The hashfunction produces output that is “practically unique”, i.e. the probablity of a collision is so small that it can be ignored.

1 Like
  1. A hash function takes a unique input and generates a unique output. With a true hash function you go from input to an output, you should not be able to take an output and end the input.

  2. With cryptocurrencies hash functions are extremely useful because the same sequence cannot be reproduced with different set as the input. Trying to reverse the hash sequence in order to find the input is impossible because hash functions are collision resistant.

3.Collision resistant is a property of hash functions that make it infeasible to find two colliding inputs.

1 Like
  1. Hash Functions is a one way special function,
    each unique input gives a unique output. It is one way in the sense that it needs first the input before it will give the output, it is not the other way around, but yes it is possible to turn things around, but it will only means that the hash function is already broken, it means that someone already figure out how to crack from output to input.

  2. It is used as part of its block hashing algorithm which is used to write new transactions into the blockchain through mining process. Another use case is that it also creates addresses like public key and private key.

  3. It means that it is a necessity that hash functions should have no chance to find two different inputs that will generate the same output, because if the contrary will happen it means that a certain hash function is not anymore resistant to a collision.

1 Like
  1. Describe hash functions with your own words
    R: Using a mathematical function creates a fixed output from an input of any size and can be used as a digital fingerprint.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    R: Hashing in bitcoin is used to the dependencies between blocks in the blockchain. All the blocks are hashed including the hash from the previous block.

  3. What does it mean when we say that hash functions need to be collision resistant?
    R: This means that two different inputs of the function must have different inputs. If they have the same output that is a collision.

1 Like