Homework on Hash Functions - Questions

Thanks for the clarification!

1 Like
  1. A hash function means taking an input string of any length and giving out an output of a fixed length. Each input will produce a unique output. The input will always produce the same output hash like a fingerprint and is infeasible to reverse.

  2. Hash functions are used to mine blocks and verify transactions because prior hash is in the present block and changes the previous block if altered.

  3. Collision resistant means its very unlikely that two different inputs will result in the same output hash.

1 Like

Changing a block will invalidate all other blocks that come after it. This is why hashing is important. It helps us achieve security. :slight_smile:

2 Likes

1 Hash function is a way to encrypt the data in de ledger
2 They are used to uniquely sign the block of transactions and are based on the previous block and the current block
3That you can not have two different inputs with the same output

1 Like

Thanks but I know things will get much more difficult as I progress through the courses.

Get a sport.
www.nowimps.com

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

A hash function is a one way function, unlike functions in algebra. Each unique input will produce a unique output and it can’t be reversed. Also by changing the input only slightly, f.e. changing one lower case letter to upper case, will change the output completly. The other property of a hash funtion is that no matter how long the input is, the output will always be the fixed length.

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

In bitcoin hash functions are used for mining. Through block hashing algorithm new transactions are recorded into the blockchain.

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

It’s one of the needed properties in cryptographic hashing and if a hash function is not collision-resistant, then it’s easier for a bad actor to break the function.

1 Like

Hash functions can’t encrypt data. The hash it
Hashing is one way function, while encryption is two way function. :smiley:

2 Likes
  1. The hash function will take any string (converted to bits) and turn it into an almost unique hex number that is highly sensible to changes in the input. The function is deterministic and impossible to reverse (as far as we know).

  2. Hash functions are used in cryptocurrencies to sign transactions for posting to the public ledger. We can generate a public key by hashing a secret private key. The public key serves as a bank account for cryptocurrencies while the secret private key serves as our signature to approve transfers out of our account. Hashing functions are also used generating blocks in the blockchain.

  3. This means that the hash function should provide unique output for each unique input. If two different inputs generate the same output (a collision) then that creates a problem because either of the two inputs become a valid “owner” of the signature output. This would mean I could change the blockchain data between the two colliding inputs and no one would be able to tell the difference.

1 Like

No. In order to get a public key from a private key you need to generate it using the elliptic curve digital signature algorithm. Here is a great read:

If you want to go in more details, “Matering Bitcoin” is a great book. :slight_smile:

4 Likes

Thank you….of course one way!! Encryption two ways.

Thanks for your help
:grinning::+1:

1 Like
  1. Describe hash functions with your own words

    • It is a function that takes a input and converts it to a complex output by some algorithm,
      which in part makes it very difficult to identify the input by way reverse engineering.
  2. How are hash functions used in cryptocurrencies like bitcoin?

    • It is the means to encrypt the information in a transaction that promotes anonymity.
  3. What does it mean when we say that hash functions need to be collision resistant?

    • Think for instance of hash collision where an attack is made on a hash function to determine if it has an input pair that has the exact same output hash. For instance a hash function is collision resistant if it makes it hard for hash collision attack to find these pairs of inputs.
1 Like
  1. Hash functions are how data or anything else you send is encrypted in a type of key word that cannot be corrupted and sent lightning fast safely and accurately to another party with trusted verification along the way that can be traced back to source if needed but cant be altered once sent.

  2. Hash functions have helped bitcoin and other cryptocurrencies by giving them a name that they can be found by in cyberspace so who where when and why is happening in whatever transaction is happening. This how nothing can be changed once the name is given to that data if the data changes so does the name of the data so it always remains unique on its journey.

  3. Hash functions need to be collision resistant so that transactions and data cant be duplicated or altered and the speed of the network will make it where things get verified so fast a duplicate cant sneak in

1 Like

1.Hash Function= its a function when any INPUT of data is transformed into OUTPUT of fixed length.
2. In BITCOIN Hash Function WRITE new TRANSACTION into the BLOCKCHAIN through the MINING process.
3. Hash Function need to be COLLISION RESISTANT= Means that different INPUTS should not equal the same HASH OUTPUT. When it is happens it is called COLLISION.

1 Like

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

1 Like

Describe hash functions with your own words They are one-way conversions of input to output 2. Hash functions are used in Bitcoin as a digital fingerprint. The chain cannot continue until each transaction is verified and authenticated . The feasibility of counterfieting or perpetrating some kind of fraud is astronomical. 3. Collision resistence ensures that two different inputs will never generate the same output.

1 Like
  1. A hash function is a process where you convert an input of any length and get an output of a fixed sized string of data called hash value. The hash value can’t be reversed and each output are unique as long as the input is different, but if the input is exactly the same so is the output.

  2. Hash functions takes the data from a previous block and creates a hash value, this hash value goes in to the next block and if something is changed in the data the network will notice it.

  3. Collision resistant means that each input needs to have it’s own unique hash (output), if you have two different inputs that generate the same hash it’s called a collision.

2 Likes
  1. A hash function works in a way that you can have an input which will give an output that is always the same if the input is the same. The input can vary in size, but the output size is the same. A slight differ in the input will give a different output. The point with a hash function in blockchain is to convert an input to an output. Once we know how to convert the output to the input, the point of the hash function will be broken.

  2. Bitcoin needs to choose a miner to create the next block with transactions. What the miners do is to try to find the hash function of every validly signed transaction that they see in the transparent peer2peer network (or bitcoin network) for the last 10 minutes. Plus they are hashing the reference to the hash of the previous block in the blockchain and a random number (luck aspect). These three factors are used to try to find a winning miner that gets rewarded with a block reward. Currently 6,25 BTC after the halvening this year. This takes huge amounts of computing power. In the early years people could mine bitcoin with their laptop, now you need dedicated mining rigs.

  3. A collision occurs when two different inputs results in the same output. SHA-256 is very collision resistant. It is about probibility. The output in SHA-256 are 64 numbers or letters from 0-9 and a-f. So there are 15 “numbers” that can be in any order. It is possible that a collision occurs, but it is very unlikely. It is interesting that the entire wikipedia will result in one hash of 64 numbers and a single letter will also have a hash of 64 numbers.

1 Like
  1. A hash function is a mathematical process (fucntion) that gives a unique outuput for each input it receives.
    2 . In BTC, we have ledger of hash functions that utilizes proof of work combined with SHA-256 to obtain a unique mathematical traceability and unbreakability.
  2. It is impossible to find to inputs with the same output
1 Like
  1. Describe hash functions with your own words
  • Hash functions produce different output for different input values.
  • Hash function inputs cannot be deduced from hash function output values.
  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).
  • Each Bitcoin block contains a hash of the previous block except for the genesis block.
  • New transactions are hashed until a new block is solved. The new block is then added to 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).

Any two values input into the hash function should mostly produce different outputs.

1 Like
  1. Input that is encrypted into a unique “fingerprint”, that can not be traced back to the original input variable.

  2. They are used in cryptocurrency to force active participation in the blockchain system in exchange for a reward after the problem is brute-forced open.

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

1 Like