Homework on Hash Functions - Questions

  1. Hash functions are one way functions where each input produces an output or digital fingerprint.

  2. In Bitcoin the Hash function is used to hash transaction data. Also mining and finding a nonce requires finding a number that generates a specified hash in combination with data unique to that block.

  3. Collision resistant in this instance means that it is highly unlikely (but not mathematically impossible) to get the same output from a hash function.

1 Like
  1. Describe hash functions with your own words
    Hash functions take any input to produce a unique fingerprinted output that is stored indefinitely on the network.

  2. How are hash functions used in cryptocurrencies like bitcoin?

Hash functions for bitcoin are the building blocks of the network, each transaction creates a new immutable receipt which then is collectively stored in a block. The new blocks keep a traceable record of each block stored within a new hash output. Hash outputs are used in bitcoins network for efficiency. Rather than storing every transaction ever created in every block ever produced, we use a hash function to store the string of data. If we didn’t use hashes, the block sizes for the transaction ledger would soon increase to a point that no data storage ever created would be able to hold a single block.

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

In SHA 256, each hash function produces a fingerprint which would take 2^256 attempts to recreate. A collision only occurs when there are more inputs available than outputs. In SHA 256 the possibility is infeasible to happen as there are too many possible outcomes. This wasn’t the case with MD-5 and SHA1 which operated on a 128-bit system.

1 Like

A block contains a minimum of 12.5btc. If you would mine an empty block. (The miner reward)
In a block are also lots of transactions :wink:

You’re describing Brute forcing a hash by guessing the input. A collision means that 2 different inputs can produce the same output, wich would be a disaster.

1- Hash functions are functions that generate an output of a defined length given an input, they need to have certain characteristics to be considered as such type of functions, two of them are:

  • being deterministic, one input correspond to one output only, constituting a biunivocal relationship
  • fast executed, the algorithm should give an output really quick to be efficient.

2- In bitcoin they are used to define the cryptographic puzzle that miners need to solve in order to generate a new block.

3- It means that given two different inputs they cannot give the same output, in that case the output would not link unequivocally to the input.

1 Like
  1. A hash function is a mathematical function that converts input data of any size to an output value of fixed size. The output has always the same size regardless of the lenght of the input.

  2. In the context of cryptocurrencies like Bitcoin, the transactions are taken as input and run through a cryptographic hashing algorithm which gives an output of a fixed length. Cryptographic hash functions have certain properties that enable finality and protect the security of the network against tampering.

  3. Being collision resistant means that it is infeasible to find two different inputs of the same length that result in the same hash. It is infeasible but not impossible though. Being infeasible simply means that, for the most part, each input will have its own hash and it must be very hard to find different inputs with the same hash.

1 Like

noted the misunderstaning!

1 Like
  1. Describe hash functions with your own words
    A unique alpha numberic string that is a unique fingerprint for cryptography. It is used by miners to find a block. It also uses binary and hex to make the signature more complex and difficult to hack.

  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).
    BTC uses SHA 256 to encode its unique signature. The are used to find a block using a special computer that cycles numbers until the unique alpha numeric Block is found.

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

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

1 Like
  1. Describe hash functions with your own words
    A hash function is a function that results in a cryptographic digital result that changes completely whenever the slightest change is made to the original input.

  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).
    Hash functions are used throughout cryptocurrencies, as it is key in linking the different blocks in the blockchain. It serves as the glue to the previous block and that block to its previous block. Additionally, the path forward to the following block is also hashed, and the data within the block. Hash functions are critical in cryptocurrencies.

  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).
    When we say that a hash function needs to be ‘collision resistant’, it means that the difficulty in the hashing algorithm needs to be very complex that the same hash is avoided when multiple computers are trying to hash data at the same time. Basically, that the output hash does not represent more than one input. Although it does not happen regularly, no hash function is collision free.

2 Likes
  1. Hash functions are a way to compute a dataset to a unique fingerprint.
  2. The hash function in bitcoin are used to create blocks on the chain (network)
  3. It is almost impossible to hash the same fingerprint from two different data sets.
1 Like

You have a text and you hash it with SHA 256, the result of that text is a 64 hexadecimal number. If you change a little piece of information in that text and you hash it again the result is a total other outcome.
It is a one way function, with the result of the hash you cannot find the piece of text again.
So with the input you get an output, but with the output you almost never will get the input

1 Like
  1. All data (transactions etc.) in the block are hashed. Furthermore is the previous blockhash included in the current block, so alterations in the previous blocks cannot be done while the hash would be different so not accepted

  2. two different inputs give the same hash output.

1 Like
  1. Describe hash functions with your own words
    Hash Functions take a unique input and produce a unique hash output based on that input. It’s like a fingerprint and is a way of verification of data of files as even the slightest change in the input will produce a completely different hash.

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

Hash functions in crypto are used to write new transactions on the blockchain as part of the block hashing algorithm. This is part of the mining process. The inputs for the function are all of the most recent but yet confirmed transactions.

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

With two different inputs its infeasible for them to share the same hash. Infeasible meaning not totally impossible but so improbable its negligible and doesnt matter

1 Like

1/ Describe hash functions in your own words.

An hash function, is a function that converts a bunch of letters & numbers, into an encrypted output
( of a fixed length ). An hash is created by using an algorithm, & it is first application in Blockchain management of Bitcoin & crypto-currencies.

2/ How are hash functions used in crypto-currencies like bitcoin. ?

By adding some more or less, random data, to the data, so it becomes cryptographic…

3/ What does it mean when we say hash functions need to be collision resistant. ?

No hash function is collision free, but it usually takes too long to find a collision, ( through random guesses ) so if your using SHA256 it is safe to assume that H ( A ) = H ( B ) then A=B.

1 Like
  1. Describe hash functions with your own words
    It is a unique one-way function that’s like a fingerprint … Every unique input produces it own unique output but none the reverse with the SHA-256…(opposite of the MD5 where it is possible to trace the output to the input

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

Mining process will use hash functions to verify (solve equations) BTC transactions and add them to blocks. In every new block, there will be the previous last hash which forms a link ( a chain) between them and makes it very difficult to crack . The hash function should be quick for a high value.

  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 means that 2 different input can’t have same HASH output. It could happen that collision does exist but they are hard to find in the blocks

1 Like
  1. Describe hash functions with your own words
    A hashing function is simply a mathematical function that can take any form of data or any size & produce a fixed length output for that particular input.
  2. How are hash functions used in cryptocurrencies like bitcoin? Hash functions are used to encrypt wallets, transactions between wallets, verifying and validating the account balances of wallets; and Mining.
  3. What does it mean when we say that hash functions need to be collision resistant? Meaning that the probability of two different inputs equaling the same hash output has to be highly resistant.
1 Like

Hash functions are when a unique input will produce a unique output.

Hash functions are used in cryptocurrencies likes Bitcoin to hash the transaction data before being encrypted and added to the blockchain.

The hash functions need to function in a way that two inputs will not hash to the same output.

1 Like

A:

  1. For each unique input you get a unique output.

  2. In Bitcoin the hash function is used to hash transaction data (providing encryption), addresses, private and public keys.

  3. Collision resistant means that it should be infeasable that two inputs hash into the same output.

1 Like
  1. a hash function is a computation that takes an input and calculates a unique output. Some hash functions are more secure than others. For example if the hash function SHA-256 is used it is infeasible to figure out what the input was if you just know the output. This is what makes it so secure.

  2. Hash functions are used in bitcoin to secure the data on the network. this is done by requiring the miners to figure out a nonce that when concatenated and hashed with the hash of the block yields a number that is less than the number specified by the mining difficulty. In order to obtain this number many, many millions of hash results are calculated by computers to establish a result that is less than the difficulty requirement . The one that discovers the nonce is rewarded with Bitcoin. This hash function is integral to this process and is what allows the proof-of-work concensus algorithm to be successful.

  3. Each hash input will have a unique output, nearly all the time. There is a remote possiblilty that 2 different hash inputs could have the same output and thus result in a “collision.” This is considered “infeasible” in the bitcoin protocol due to mining difficulty and the amount of mining time that would be required to find a collision within a block. This is what makes bitcoin collision resistant. Collision resistance is necessary to provide a high degree of confidence that the blockchain is robust.

1 Like
  1. Describe hash functions with your own words
  • Hash functions are functions that convert an input into a unique identifying output. Each unique input has a unique output. These functions are only one way.
  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).
  • New transactions in a block as well as a timestamp and some info about the previous block are hashed (cryptographically fusing the blocks).
  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 needs to be hard to find two inputs that hash to the same output.
1 Like