Homework on Hash Functions - Questions

Not true, public keys are derived using the elliptic curve :slight_smile: there is another reason why we use hash functions. Can you figure out why? :wink:

1 Like

Its true that we hash the transactions, but there is another more important use for hash functions. Do you know which one?

1 Like

what is this other important use? :slight_smile:

1.A one way function, where by each unique input produces a unique output.

  1. It provide an additional layer of security by making hashes functions tamper resistent. The tiniest input mismatch would lead to a major output mismatch. There would be no consensus and the hash output would be rejected.

  2. For the most part each unique input will have a unique output, and it is infeasable for example, for hash ‘A’ to equal hash ‘B’.

1 Like

Hash functions link the blocks together in a chain, thus the name :wink:

2 Likes

1 Hash functions remind me of Chaos Theory, in that a tiny change results in totally different outcome.
Basically its a way of turning any length of (usually string) input into a 256 character ‘hash’, which looks like a random collection of characters. Any small change in the input results in a totally different hash output, but importantly the same input always results in the same output. The hash algorithm is immutable, so only operates in one direction, making the hash a secure process. One use case is if you are downloading a file, the sender can provide the hash value of the file, which you can compare with the file you have downloaded to check the data has not been corrupted, either by the transfer or by a 3rd party.

2 In cryptocurrencies such as Bitcoin hash functions are designed to fit the specific needs of each currency.
There are 3 main properties of the Bitcoin hash function which makes it appropriate for the task.
1 It always create a unique hash value
2 It has a high hashing speed, meaning the computation for each input does not take too long
3 It is secure. The function works one way only and is computationally infeasible to reverse.

3 Collision resistance. A hash function H is said to be collision resistant if it is infeasible to find two values, x and y, such that x ≠ y, yet H(x) = H(y).

1 Like
  1. A hash function is a oneway function where each input produces an output or digital fingerprint.
  2. Hash functions are used in cryptocurrencies like btc because it records all previous data while the hash of the last block is used to create a new block where new transactions are stored.
  3. Collision resistant means that it is highly unlikely to get the same output from two different inputs.
2 Likes
  1. Hash function is applying a digital signature in hexadecimal for the text or data it represents.
  2. Hash function is used in processing a transaction through mining, it’s also used in signing a transaction into the block chain.
  3. Collision resistant in hashing functions is to do with reducing the number of inputs that will produce the same output, therefore two private keys having the same public address.
1 Like
  1. A hash function is a way to take an input of text of any length and create a unique digital footprint of constant and consistent length.
    The function must be deterministic, pre-image resistant, changing the input by one digit must change the output drastically, collision resistant and puzzle friendly H(k|x)=y.
  2. To my current understanding. Hash function SHA-256 takes the input data of the many transactions on Bitcoin and hashes them to create a 256 bit signature which is then turned into a 64 character fingerprint.
    Which is our private for the transaction thus verifying our transaction is valid and that it indeed belongs to us.
  3. Lets say you have 2 inputs A and B. If you have hash function H(A) and H(B) the outputs will be different due to the fact the input hashes are different and unique.
1 Like
  1. Hash functions simply put are functions that take an input of any length and provide an output of an specific lenght according to the hash function used. One way of looking at it, is that it created a way to identify a given input within a given network.

  2. Hashfunctions are key in a blockchain as they take any amount of information and convert it into a hash that can then be stored in the blockchain allowing for more information to be stored with a minimal amount of bits.

  3. collision resistant means that its very difficult or near impossible for a hash function to provide the same output for 2 different inputs.

1 Like

1)hash functions are functions that take an input of any length and convert it into a hash number of a fixed length in such way that is almost impossible to determine what the input was by having only the output , in hash functions the same input will have always have the same output so the only way to crack thi kind of functions is bruteforce .
2)there is a hash in the genesis block and all blocks after that are cointained from hashed transactions concatinated with nonces , every block also has a hash of the previous block , so by changing a single character in the previous block will create a whole new chain of blocks
3)there are no hash functions that are collision free , all of them have collisions , the difference is that in the sha256 fof example collisions don’t happen too often ,
collision is when a hash of a value for example “A” equals to a hash of other value for example “B”

1 Like

Hash function makes it almost impossible to replicate input data from output data. Hence the saying hash function is a one-way process.

Hash function have many uses in cryptocurrencies: They ensure security, privacy, immutability, transparency, efficiency, improved traceability and reduction of costs. They are also used in mining of cryptocurrency in proof of work because of their unique properties such as deterministic - where the same input always gives the same output, Pre-image resistance - where it is almost impossible to determine input from output by use of brute force, Quick computation - ensuring efficiency, Small change in the input changes the output -ensuring immutability, Collision resistance - making it almost impossible for two inputs to give the equal output, Puzzle friendly - where it is infeasible to string together two random values to give a known output.

Hash function need to be collision resistant means no two inputs should produce the same output. That is hash functions ensures that each input produces a unique output. For example inputs A and B cannot both produce output Y. In other word, collision resistant should not be breakable.

1 Like

Describe hash functions with your own words
With hash functions each unique input will produce a unique output made up of a sequence/combination of letters and numbers.

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 case of bitcoin there are a few applications of using hash functions. These vary from preventing new bitcoin from being printed/minted or copy pasted by anyone at any time, encrypting data and not allowing any block in the chain to be altered in any way once it has been created and added to the blockchain after it has been verified. They also work to link each previous block in the blockchain to the next block. They also act as a digital fingerprint, verifying the integrity of messages and files and password verification.

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

In terms of bitcoin and its SHA 256 algorithm the aim is to ensure the probability to be able to string together any and each individual hash sequence made using a hash function has a high min-entropy. Which means it has a negligible probability of colliding (being the same) with any other output which in turn is a result of its own unique input. We are resisting the probability of collision with every output based on the stringing together of various values in a unique way determined by each unique input.

1 Like
  1. Hash function is a function that only works one way. Digital data can be turned into a hash using a hash function.
  2. Hash function is used in bitcoin by hashing the data of the blocks and and is then used to verify authenticity of the previous blocks.
    3.Collision resistant means that its very hard to find inputs that equal to the same output
1 Like

Transaction signatures work a bit differently, but they are hashed so you get a transaction id :slight_smile: Hashes are also used to link the blocks in a chain :slight_smile:

1 Like

But transfered values still must be stored somewhere? :thinking: Though merkle roots are used to make mining a bit easier, there is a more important role of hash functions in bitcoin and that is linking hashes in a chain :slight_smile:

2 Likes

Hash functions are not used to derive public keys, we use the elliptic curve for that. But the address is a hash of the public key :slight_smile:

2 Likes

thanks i have deleted that now.

1.Hash functions take an input code creates an output that cannot be reversed configured as binary then providing a stand alone digital fingerprint hex of a fixed length
2. Cryptographic hash functions are mathematical operations run on digital data. In Bitcoin, all the operations SHA256
3. nobody should be able to find two different input values that result in the same hash output. In other words, for any different input, there will be different outputs always. This allows to use this function to check data integrity, not being modified or tampered

1 Like
  1. Hash function is a one way function. Each unique input will produce a unique output or finger print.

  2. The hash functions are part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining process. For bitcoin, if we cahnge a small part of the input, it will result in a completely different output. Miners try to get hash results to start with 18 zeros. It is a large amount of computation and solving a block could take about 10 minutes so alot of effort is involved.

  3. Collision Resistant is a term of cryptographic hash function. A hash function H is a collision resistant if it is hard to find two inputs that has the same output. Collision resistance means that collision exists but they are hard to find.

1 Like