Homework on Hash Functions - Questions

  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
  1. Cryptographic functions that generate a unique, complex output with the same length as others, that doesnā€™t give opportunity to find out the input.
  2. Writing down transactions and allows them to be unique and unrepeatable. Also miners solve these hashing problems to complete the block with the unique transactions that were made.
  3. Resistant to the possibility to have two inputs for the same hash output.
1 Like
  1. A hash function is any function that can be sued to map data of any size into fixed size values. in the case of Bitcoins Hash function (SHA-256) the output is a 16 digit output.

  2. Hash functions are used to write new transactions onto the bitcoin blockchain.

  3. Collision Resistant means that it is hard ti find two inputs to the same output.

1 Like
  1. Describe hash functions with your own words

A)

Hash function basically takes a input and generates a unique digital output , like a unique fingerprint for the input. If the data is changed by the slightest this will generate a different hash compared to the first hash you generated, it is entirely unique.

Its completely one way, input to output

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

A)

In bitcoin hash functions are part of the blockchain algorithm , in mining it is used to write each transaction.

Each block hash the hash of the previous block, this is used in a mathematical way in produce the new hash for its current block, and this process continues on each block

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

A) Difficult to find two inputs that hash to the same output

1 Like

1. Describe hash functions with your own words
Hash function is a math function that takes an input string of any length and generates fixed length output. In the case of the bitcoin produces an fixed output length of 256-bits.

2. How are hash functions used in cryptocurrencies like bitcoin?
Overall hash function is used to check the integrity of the blockchain data (immutability)
It is also used for other purposes, such as reducing the size of data on the blockchain and in the mining process to.

3. What does it mean when we say that hash functions need to be collision resistant?
Collision resistant means that it is very safe that 2 different inputs will give 2 different outputs, in other words, 2 different inputs do not collide on the same output.
although it is not impossible, the probability of this happening with the SHA 256 hash algorithm is very very very small.

SHA256: 0752df4e0ce46b77fad1022120c392f0b80a419f8dc0bec3104f160a75f20898
(hash of this message)

1 Like

Hash functions are functions which will take input from a text ( or binary etc) string of any length and return an output, or ā€œhashā€ consisting of a fixed length string of bits. Because there are only a limited number of fixed length hashes and an infinite number of inputs ( strings of any length), it is very difficult to determine the original input string from the hash, and hash functions therefore play a significant role in cryptography.

A financial transaction is linked to all previous transactions by adding to it the hash of the previous transaction . In fact this is done to a number of transactions all at once ( a ā€œblockā€) and the linking of the blocks by adding hashes creates a chain (the so-called ā€œblockchainā€). Doing this makes it impossible to change a single transaction in the chain without that change affecting the entire chain of transactions after that, and this hashing process therefore helps create the quality of immutability that blockchain-based cryptocurrencies have. Calculating hashes and adding conditions to the result (eg adding bits to the input string to find hashes of a certain form through guesswork) also provides a useful way of forcing ā€œworkā€ to be done to add a transaction block to the chain. This ā€œworkā€ is rewarded in cryptocurrency and therefore provides the incentive for people to record transactions onto the blockchain accurately. The .use of hash functions is a core part of how many blockchains work.

I mentioned above that a typical hash function can take any length of input and return a fixed length output. The number of possible input strings clearly always exceeds the number of possible hash outputs in these cases and correspondingly, each hash output can be the result of the function applied to an infinite number of possible inputs ( though a subset of all inputs) . Collision resistance is a property of a hash function which indicates the probability of finding two or more input strings that result in the same hash from that function. The lower the probability, the more collision resistant the hash function is.

2 Likes
  1. Hash functions are functions where it is infeasible to go from output to input.
  2. Hash functions are used in cryptocurrencies like bitcoin to create pointers and linked lists.
    3.Collision resistant means it is unlikely that the same input will be chosen, meaning the list of possible inputs is high min-entropy.
1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words - hash functions is an encrypted way of generating a unique id to be used for a block.

  2. How are hash functions used in cryptocurrencies like bitcoin? hash functions are used in cryptocurrencies by using the SHA-256 crytographic algorithm which is a secured way to generate a hash since, you could only trace from input to output, but not the other way around.

  3. What does it mean when we say that hash functions need to be collision resistant? it means that for 2 different inputs, generating 2 same hash at the same time is infeasible.

1 Like

1. Describe hash functions with your own words
you put data into a hashing function and receive a unique 256 bit number out of the equation.

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).
In the mining process a exercise is given to all the miners which in turn use the hashing algo together with a nonce in order to solve the question and get the mining reward.

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).
It means that every input hasto have a unique output. No two different inputs can create the same output.

1 Like

Hi, Michael.

What a wonderful homework! Keep up the great work! :heart:

Hash functions donā€™t encrypt data, they hash data. Encryption is a two-way function; what is encrypted can be decrypted with the proper key. Hashing, however, is a one-way function that scrambles plain text to produce a unique fingerprint of the data.

2 Likes
  1. conersion of a string of data to an output of 256bits

  2. to make transations

  3. 2 different things not getting the same result

1 Like