Homework on Hash Functions - Questions

  1. A hash function is an encryption function that takes any inputs, that can be of different length, and create a unique output of a specific length.

  2. Mining

  3. Collision resistant means that 2 different inputs of a hash function cannot resulting in the same output.

1 Like

Hash functions are a set of instructions that for any given input there is an unique output, and that the it is not possible to go from output back to input.

Hash functions are used in bitcoin to provide proof of work for a specific transaction.

A collision means different inputs can have identical outputs, Collision resistant refers to the probability of a collision occurring being low.

1 Like
  1. A hash function is a function that transforms an input into a random output of fixed length. If the hash function is secure, it is infeasible to find the input from the output.
  2. In the case of BTC, hash functions are part of a problem to solve in order to find the next block in the chain. If all impending transactiosn can be translated into a hash beginning with a certain number of 0’s, the miner solved the hash and finds the next block. The first transaction of the next block awards bitcoins to the miner as a reward.
  3. Collision resistant means preventing two different inputs from having the same output.
1 Like

thanks for the reply, i will look into it again .

I watched a video mentioning that hashes start with 111000.

  1. A hash function is a formula which can be applied to a set of data of any size which will return a unique string of data of a prescribed size which represents the original data. These strings or ‘hashes’ are unique to the data which was used to create them.

  2. Transaction information can be hashed into blocks to form the blockchain for a cryptocurrency.

  3. A collision is when two different inputs would result in the same hash. A hash function which is very unlikely to ever generate the same hash from two different inputs is said to be hash resistant.

1 Like
  • Describe hash functions with your own words
    It’s a one way function where unique input gives unique output without an ability to deduce the input by looking at the output.

  • How are hash functions used in cryptocurrencies like bitcoin?
    My guess: Specific input of transaction + timestamp and user are combined to create unique fingerprint to verify the origination amount (whether is exists) and record what transpired and use that output to verify no changes to the original transaction

  • What does it mean when we say that hash functions need to be collision resistant?
    You can’t have different outputs for the same input and only one, the first result is accepted

1 Like
  1. Describe hash functions with your own words
    Hash functions are deterministic one way functions. You will always get the same result for the same input. However, given an output value it will not be possible to work out the 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 protect data. Hash values are stored. Hashing transaction data makes sure that data cannot be manipulated. If data gets changed, the stored hash wouldn’t match - these hashes are stored and used in various parts of the chain. Hashing is also used as part of the mining process based on the used hash function being puzzle friendly.

  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 refers to the hash function minimising the chance of two different inputs resulting in the same output.

1 Like
  1. Hash Functions are One-Way functions (You can go from Input to Output but not vice versa). Any given Input, if hashed, gets a unique Output.

  2. All blocks on the Blockchain in Btc are identified by a hash. All blocks contain the hash of the previous Block.

  3. That two different Inputs don’t (or practically dont) create the same output.

1 Like
  1. A hash function is a way of converting a specific string of information into another string of letters and numbers. The output given is always connected to that exact string of information. But if you change anything in the string of information, the output hash will be totally different.

  2. Hash functions in cryptocurrencies are used to verify that each block is unchanged and non-manipulated. If any information in the blockchain is changed, the whole chain will also be changed. This is a great way of verifying and validating the transactions in cryptocurrencies.

  3. Collision proof is when you cant find any input that gives the same output.

1 Like
  1. Hash functions takes an input of any size and outputs fixed size hashed number based on algorithm used. Is only one way: input -> output.
  2. Hash functions in for example in Bitcoin are part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining. This takes a lot of work.
  3. Collision resistance is a property of cryptographic hash functions. Hash function is collision resistant if it is hard to find two inputs that hash to the same output.
1 Like

Being a BC novice, I would greatly appreciate constructive criticism of my first two answers.

  1. Hash functions are a math computation wherein one way input (specific info) is inserted into the problem and a unique output answer is given. So I could copy and paste Moby Dick into the “Hash Functions online” (Shown in video class) using any one of the hash functions, preferably sha256 and I would get the specific alphanumeric string that equates to the Novel Moby Dick. So I suppose if someone wanted that version of Moby Dick, I could send them the string and they could put it in sha256 hash function and convert it into its readable form?Smart contract? Is that going in reverse?

  2. Hash function is the computer/Network constantly checking the input of the last blocks in the chain using sha256 or another form of hash function, constantly making sure that the block being mined gives the proper answer output and if so, is then added to the chain.? So what is the nonce? Does the network ad it? what or who puts it into the mix?

  3. Collision resistant means that it is highly unlikely that two different inputs will give you the same output string.

Homework on Hash Functions

Describe hash functions with your own words
Hash functions are one way functions which means that it shouldn’t be possible for one to recognize the input from the output.

How are hash functions used in cryptocurrencies like bitcoin?
The hash function used in bitcoin is SHA-256. This function creates random hexadecimal numbers that can be verified in a way that requires a predictable amount of CPU power. Generating an SHA-256 hash with a value less than the current target solves a block and rewards the node with some bitcoin.

What does it mean when we say that has functions need to be collision-resistant?
Collision resistance means that the output for every unique entry into the hash functions needs to have a unique output.
Let hash function be,
h(x)
If, h(a) = h (b) then a = b
If a not equal to b then there is collision.

1 Like

Describe hash functions with your own words
A hash function is a mathematical fucntion that takes an input an produces a unique output that cannot be reversed.

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 cryptographically link each block on the blockchain. Because there is a unique output for each input, and the current block is used in combination with the information in the transaction to generate the next block’s hash number, if someone wanted to alter the transaction history in the database they would havce to change all the previous hashes.

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 that is is improbable for two different inputs to the hash function to generate the same output.

1 Like

1 Like
  1. Hash Functions are a mathematical equation that takes any string of data and converts it to a 256bit code.

  2. Hash functions are used to trace data as well as encrypt data between permissioned parties.

  3. Collision resistent means to prevent 2 inputs resulting in the same output.

1 Like

hello,
1) A hash function is taking a unique input and getting a unique output, identifying the input. A digital fingerprint so to speak. Another key characteristic of a hash function is that it is considered a one-way function. which means that you can only go from input to output and never from output to input.
2) Cryptographic hash functions are used in cryptocurrencies like bitcoin and are critical building blocks of a lot of cryptocurrencies, providing information security as a whole by taking advantage of the “one-way function” of such protocols like SHA-256 or in the past MD5. these algorithms take a set of inputs and give it a unique digital fingerprint that makes it virtually impossible to go from output to input.
3) Another key component of a hash function is that they need to be “collision-resistant”. This means that it is hard to find two inputs that have corresponding hashes or identical digest. while it’s mathematically impossible to guarantee, the amount of time it would take for this to happen. Make it virtually impossible.

1 Like
  1. We give input and with hash, we get a unique fingerprint of that input.
  2. There are certain properties that a cryptographic hash function needs to have in order to be considered secure. Deterministic, Quick Computation, Pre-Image Resistance, Small Changes In The Input Changes the Hash, Collision Resistant, Puzzle Friendly.
  3. No two inputs should have the same hash output.
1 Like
  1. Describe hash functions with your own words
    Using software such as SHA256 a data input such as a word or sentence will produce a list of code or a ‘hash’ output.

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 is used in Bitcoin to protect the block chain by each hash pointer containing the hash data from the previous block this makes each block immutable. Data changed in one block would result in data/hash being changed in all other blocks.

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 hash function with more inputs than outputs will necessarily have collisions.[1]:136 Consider a hash function such as SHA-256 that produces 256 bits of output from a large input (≤ 264-1 bits). Since it must generate one of 2256 outputs for each member of a much larger set of inputs, the pigeonhole principle guarantees that some inputs will hash to the same output. Collision resistance does not mean that no collisions exist; simply that they are hard to find.

1 Like
  1. Hash functions take a stream of characters of any length and convert them to an output of fixed size.
  2. Hash functions are used to store encrypted information of fixed length into the blockchain
  3. Hash functions like sha256 are “deterministic”. The output for a given input will “always” be the same.
  1. Hash functions basically lock information and if anything gets changed it has to produce a new hash so you can tell it was altered.

  2. The transaction data gets hashed and then cant be changed stopping double spending of bitcoin

  3. Since there are so many different hash numbers the likelihood of 2 having the same hash (collision) is next to nothing

1 Like