Homework on Hash Functions - Questions

hash functions math process that takes a unique input of any size that gives a unique output of a fixed size.

hash functions are used in bitcoin to help it remain decentralized then making it secure.

hash functions need to be collision resistance because the algorithm will be vulnerable to collision attacks which will threaten the overall security of the blockchain.

1 Like

1- The output is the unique result of whatever input one types on any type of keyboard.

2- Once a person types any letter or number in a hash function an encrypted result will be generated. These result is what keeps bitcoin alive.

3- Although I am a firm believer that there is nothing impossible, nothing, at these time it seems not feasible for an entity to not only encrypt the hash but intentionally change the result. So, the results now are collision resistant.

Collision resistance means the probability of two inputs resulting in the same output :slight_smile:

2 Likes
  1. Describe hash functions with your own words
    Hash functions take any text or numeric input (actually anything represented in bits) and output a distinct hexadecimal value. Any input only has one output. It should be impossible to determine the input from the output.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    Hash functions are used in the process of adding new transactions onto a blockchain. Specifically, in the ā€œproof of workā€ way of mining, miners must combine the input data on a block with an arbitrary additional input of their own, in order to produce a hash starting with a specific number of zeroes and thus ā€œsolveā€ the block and add it to the blockchain.

  3. What does it mean when we say that hash functions need to be collision resistant?
    Being collision resistant means that it should not be possible for two different inputs to have the same hash value. This is important for blockchain because it means you can always verify that an entry (transaction, etc.) has not been modified in any way by checking that the hash has not changed.

1 Like

1.hash function takes any string of data converts the input and gives a digital thumb print

  1. Used through hashing algo which is used to write new transcations into the blockchain through the mining process

  2. Mean two different things not getting the same hash

1 Like
  1. Hash functions are functions that are each have an unique output and input and the functionā€™s
    input can not be found if you have the output

2 they take any length of string and turns it into a fixed length

  1. It means that it needs to be hard to find two different inputs and have the same output
1 Like

got itā€¦ thanks @Mauro

Thanks Mauro, I appreciate your reviewing it.

<body
  1. Describe hash functions with your own words - a hash function consist of an input that gives a fixed deterministic output. A small change of the input will drastically change the output. This makes it so reliable since you will know for sure if the input is correct.

  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 way I understand it is that there are 6 properties that are important to a hash function in Bitcoin particularly:

  1. Deterministic - when you do an input, you should always without any exception get the same output every time.
  2. quick computation - You want the calculation of the hash function to be fast. Or else the system won't be efficient which is important for a global financial ledger.
  3. pre-image resistant - It should be infeasible to guess the input by guessing the output. In Bitcoin hashing you can't see the input, but you can see the output.
  4. Small changes input changes the output - even If you change a letter from small letter to capital letter, the output changes dramatically in the block output. This makes it hard to hack the blocks. And the output is from there based on the hash functions of the whole series of blocks all the way back to the genesis block. And when it's super difficult and time consuming to guess just one input and you have 10 min to guess it, it makes a blockchain in my mind reliable in the case of immutability and finality.
  5. collision resistant - this means that its infeasible that two inputs give the same output
  6. Puzzle friendly - The possibility of inputs is high-min entropy. That means that there are gazillions of alternatives for you to guess and it takes a long time to produce the output you are looking for. In guessing bitcoin blocks you need to concatinate nonce with the hash of the block which in my personal impression makes it possible for everyone who can read block explorer to verify that the difficulty target can be tied to the relevant 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). - it should be at least infeasible to find two different inputs that produces the same output.

Question/reflection:
If the blocktime in minutes and seconds were lengthened, it would give the miners more time to brute force. And that would make it easier to double spend?

1 Like
  1. Hash functions are one-way functions which transform input data of any length to unique output data of a specified length.
  2. Hash functions are used to encrypt the transaction data and public and private keys so they are secure/encrypted and only the intended recipient can unencrypt them.
  3. Each input is transformed to unique output and the probability of two different inputs transforming to the same output is infeasible/extremely unlikely, if not impossible.
1 Like
  1. A hash function takes in an input and returns a hash of a fixed length that represents the input but is cryptographically translated. A hash function can only output a result, and never the other way around.
  2. Hash functions are used in cryptocurrencies and bitcoin to ensure data integrity and immutability. Each block will contain a pointer to its previous block which contains the hash of the data. Therefore all blocks are interlinked together by the hash of each previous block. If one hash is ever tampered with, all the blocks become invalid.
  3. Collision resistant for hash functions means that there will not be any duplicate hash outputs for a single input.
1 Like

1.A hash function is a function which takes an input and produces an output of fixed length.
2.The hash functions in bitcoin encrypt the transaction data using SHA-256 algorithm, it canā€™t be reversed.
3.It is infeasible to get the same output from hash functions

1 Like

Hash functions are unique digital imprints that are produced from input to output.

Hash functions are used to calculate public addressed from private keys and seed phrases,
to find nonces and to calculate unique idā€™s for each block.

There must be no two different inputs that give the same output.

1 Like
  • Describe hash functions with your own words.

A method of encryption to secure data. BTC uses SHA256 for encryption. Currently the only way to crack this security is by brute force which is infeasible due to the amount of time it would take to guess the hash.

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

By using the still secure SHA256 which is a one way encryption method it provides security to all blockchain data. Any change to the input will drastically change the hash.

  • 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 order to have a collision resistant environment it means no two hashes can be identical. If so then there is a collision. Every unique data will create a unique hash.

1 Like
  1. Hash functions are taking any input and issuing in turn a consistent output set of numbers and letters that are always the same total quantity. It is the equivalent of a digital finger print. They differ only when a different set is inputed that produces a different output set.

  2. For Bitcoin specifically they use the Hash set called secure hashing algorithm 256 which means the unique combination of numbers and letters for each input will equal 256 total digits of numbers and letters uniquely issued for that particular input set. A digital figure print.

3). Collision would refer to the output hash of one input being in some scenario the same as the output has of another input. Being collusion resistant refers to the unlikeliness off that scenario taking place because of the difficulty of replicating a random process that includes the random output of 256 digits into a unique number that in some way can be exactly the same as another of a different input. The possibilities of that happening are 1 in billions of tries and thats a far probability.

1 Like
  1. A hash function is a generated output of a string of information that can not be tracked back - meaning you will never find out what the input was

  2. In the bitcoin protocol, hash functions are part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining process.

  3. Collision resistand means 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), and a ā‰  b. Every hash function with more inputs than outputs will necessarily have collisions .

1 Like

Iā€™m not sure exactly what you mean. Even if the block time would be 20 minutes it would just mean the difficulty would be higher. This would also influence the malicious miner, meaning he to would have to do double the work to mine a block.

2 Likes

1)Hash function is a mathematical relation wich allows get an unique output from an unique input. In blockchain it Works like a finger print wich allow verify original data and it has just one direction.

  1. Hash function in cryptocurrency mining: Blockchains, in which miners operate, store the information in Hash.

Transaction security: Each difficulty is encrypted through the Hash

Generation of public and private keys for cryptocurrency wallets

  1. A hash function must be collision resistant. The same Hash will always be the result of the same data (deterministic functions), but modifying the information, even if it is a single bit, will result in a completely different hash. Is almost mathematical impossible to get the same output of 2 differents inputs
1 Like

A hash canā€™t store or encrypt data. It only provides us with a digital fingerprint.

2 Likes

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    Is one way function that converts strings of data.
  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).
    They work as integrity test to verify the data has not been changed
  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).
    Is a property of cryptographic hash functions and means that two different inputs wonĀ“t hash the same output.
1 Like