Homework on Hash Functions - Questions

  1. A hash function is a special type of function that gives the input a unique output, almost like a fingerprint. A one way function meaning the it can only go from “input -> output” and not “output -> input”.

  2. In cryptocurrencies like bitcoin, transactions are entered as an input into the hashing algorithm SHA-256 which then gives an output of fixed length.

  3. Hash functions need to be collision resistant, meaning the inputs that hash out to the same output are hard to find.

1 Like
  1. Hash functions are taking an input in any length to give a fix length of an output, and it’s infeasible.
  2. Hash functions in bitcoin are keeping bitcoin secure the blocked that it is impossible to copy and change. The hash is running by miners in order to confirm transaction validity and add new block to the chain.
  3. Collision resistant is high unlikely that two different inputs generate the same output, but mathematically speaking it can.
1 Like

It is an option, but sharing private keys is not a good option :slight_smile:

1 Like
  1. inputting information and getting an output that is encrypted
  2. hashes are re-hashed to a new hash. miners attempt to solve the equation and get rewarded in new coins if they solve the ‘puzzle.’
  3. Low probability so that hash results do not get duplicated
1 Like
  1. Describe hash functions with your own words
    Hashes fx basicly turn primary input given into an output through mathematics logic application (algorythm)
  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).
    The specific hash used in bitcoin is SHA256. Hash functions works like this: a private key is generated in a random way with a fix length and a fix format. Once given private key a public key is also created and mathematically related on it
  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 resistance is a property of cryptographic hash functions:
    a hash function 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).
    Every hash function with more inputs than outputs will necessarily have collisions.
    Consider a hash function such as SHA-256 that produces 256 bits of output from an arbitrarily large input.
1 Like
  1. Hash functions are equations that use an input to create a specific output, and when an input is entered, the function creates an output in the form of a hash, which is also defined with a nonce, which is a concatenation with the hash function, which together display the output as a long string of bits.
  2. Cryptocurrencies today use the hash function called SHA-256 which allows cryptocurrency exchanges to create a secure financial environment where every transaction (input) can be tracked by its output. Hash functions will continue to be used for cryptocurrencies to create a more secure environment for Bitcoin and the entire decentralized financial structure that is growing by the day.
    3.Stronger hash functions like SHA-256 are collision resistant because it is far less likely for multiple inputs to have the same output. Hash functions must be collision resistance, otherwise blocks in the blockchain would be less likely to become permanent; and since there is a finite amount of hashes that are possible to be mined, cryptocurrencies cannot be mined too fast, because this would cause an environment where collision would be more likely to occur.
1 Like

Hash functions are not used to derive public key from the private key, For that the elliptic curve is used :slight_smile: There is another use case. Can you figure it out? :wink:

1 Like
  1. Hash function is a mathematical process. They take input data of any size, performs some operation and give output data. They are one way functions with input that produce unique output. Each output is like digital fingerprint and it can not be reversed or deducted ever without changing the bit code.
  2. In Bitcoin protocol the Hash functions are part of algorithm which is used to transact data to blockchain through mining.
  3. Collision resistance does not means that there are no collision but that they are hard to find. No hash function is collision free, but it usually takes so long to find a collision. Hash function is collision resistant if it is hard to find two inputs that hash to the same output.
1 Like
  1. With hash function you can convert any input data to a “hashed” (cryptographically secured) output data in a way that is almost impossible (infeasible) to recover from output. The hash function is using complex math to perform this task.

  2. In bitcoin all the transaction data in the blocks are stored in hashed form. Also, for collecting block reward (i.e. bitcoins) the miners competing to solve the cryptographic puzzle with tyring different nonces (arbitrary string) with hashed block data. The nonce is concatenated to the hashed block data and after another hashing, if it is resolving the cryptographic puzzle, then the actual miner receives the block reward.

  3. Collision resistant means if I hash A input and B input, it is not likely that A output and B output is equal, unless if A input = B input. A collision can be found only with brute-force computing (meaning that after performing 2^128 computes, then there is around 50% chance to have a collision between two outputs).

1 Like

I didn’t have private key creation in mind. I was thinking of signing transactions. How are transactions signed using the private key?

  1. Hash functions are functions that take an input value of any size and generate a random, unique output value of consistent size. Ideally, you cannot feasibly take an hash function output and determine its input.
  2. Cryptocurrencies like bitcoin use hash functions to codify transactions into a hashes of consistent size. The consistency of size allows for some predictability regarding the amount of processing power it would take to generate the hash. Mining is the process of generating these hashes.
    The hash of each block is stored in the header of the next block in the chain. This is how bitcoin uses the hash function to make the blockchain immutable.
  3. Collision resistant means that it is infeasible for 2 given inputs to have the same output. There will always be a small chance that a collision will occur, but the practical goal is for the likelihood of this occurrence to be so small that it is negligible.
1 Like
  1. Hash Functions, like mathematical functions, take an input and produce an output. With hash functions its unfeasible to use the output to produce the input, unlike normal mathematical functions.

  2. Hash functions in cryptocurrencies are used to take transactions as inputs, and produce a hashed output based on a specific hashing algorithm. This is important to keep bitcoins secure on the network. As long as the output cant be used to produce the input, attackers cant steal bitcoins. Miners exist due to this hashing process. Miners produce hashes, as a result secure the network, and receive rewards for doing so.

  3. Its important for 2 unique pieces of information to not produce the same output hash. In hashing, the same piece of information will always produce the same hash, so it if 2 different pieces of information produce the same hash, it would mean their inputs were the same. This is a “Collision” and it would render the hashing algorithm useless in terms of security.

1 Like
  • A hash function is a type of function that gives an unique output specific to any given input. All the possible outputs have a fixed length and in principle it is impossible to deduce the input from a given output.
  • The hash function is used to encrypt the data of the transactions in every block and to link the consecutive blocks in the chain.
    *The property of collision resistant implies that is really hard to find to different inputs that produce the same output. Since the number of inputs is grater that the number of outputs there will necessary be collisions but in a collision resistant function, the collisions are hard to find.
1 Like

1)A hash function is like a fingerprint. No one in the world will have the same fingerprint as you. It has a unique input and it will provide a unique output.
2)Hasing is used in the mining process.
3)It is infeasible for 2 different hashes to have the same hash value.

1 Like
  1. Hash functions are where you have an input which generates an output which is unique only to that specific input and you cannot figure out what the input is from the output.

  2. Hash functions in Bitcoin are used where the input are all the new unconfirmed transactions which need to be confirmed by the network. The miners try to combine all of these inputs in order to get an output which is less than the current difficulty level (i.e correct number of 0s), and when successful this block which contains all the new transactions is added to the chain and the miners are rewarded for solving the puzzle and getting the correct output needed.

  3. Collision resistant means that it should be almost impossible for 2 different inputs to give the same output in the hash function.

1 Like

1 Describe hash functions with your own words
a hash function is essentially a formula which takes an input and generates a unique output

2 How are hash functions used in cryptocurrencies like bitcoin?
hash functions are used to give each transaction a unique reference and then in turn to give each block a unique reference (header). The header of each block is a function of the block content and the header of the previous block so attempting to change the content of any block would result in a different header to the original version of the block; this inconsistency would be flagged by the rest of the network and so protects against tampering

3 What does it mean when we say that hash functions need to be collision resistant?
collision resistance essentially means that 2 different inputs cannot generate the same output

1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
  • Hash Functions creates data integrerity by giving a unique input a unique output that can’t be reversed.
  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).
  • Hash Functions securely encrypt data input to an output with a fixed length allowing large amounts of data to be stored in a small size.
  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).
  • It should take an extremely long time for two sets of inputs to result in the same hash output. It isn’t impossible, but vastly improbable.
1 Like

There is some math involved, but I’ll try to explain. You can get more detailed explanation about this in the Privacy course in the academy.

So the elliptic curve is a curve on a Cartesian coordinate system. It looks like this:

You pick a starting point and a point H on the curve, you draw a line between these two points and the third point that intercepts the curve you draw a perpendicular line to x axis and find a new point on the curve where the line intercepts the curve, this will be one transformation (k = 1) this can be expressed with a formula (k + j)H = kH + jH where kH is the public key, k is the private key and j is the so called “shared secret”.
Therefore when both parties know the shared secret (j) and the public key (kH), you can prove that you know the value of k by providing the solution to k + j.

1 Like
  1. A one way function that gives a unique output for every new input.

  2. Bitcoin uses SHA256.
    Every 10 minutes transaction are put into a new block -> A hash of the transactions is taken -> A random strong is appended to the hash -> The new string is hashed -> The hash is compared to the difficulty level -> it must be less for the block to be added to the chain and ledger updated -> The miners that are rewarded for Bitcoin that participated in the new block

  3. Each input must have its own hash. If anything changes then the hash must also change.

1 Like
  1. Hash functions are mathematical equation that results in providing a unique outcome of fixed length from input information of any length. The outcome information will not provide the meaning of the input information resulting in higher security.

  2. Hash functions are used in cryptocurrencies like bitcoin with cryptographic hash functions. These functions have unique properties of being deterministic, providing quick computation, preimage resistance, immutability, collision resistance, and puzzle friendly.

  3. Collision resistant is that two separate inputs will not have the same outputs. It is infeasible for H(a) = H(b).

1 Like