Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    A hash function is a mini computer program, which will take in any length data string, then using SHA 256 (which Bitcoin uses), will output a unique digital fingerprint piece of data being 256 bits in length using hexadecimal 16 digits. This is designed as so an Input will create a 266 bit output string, however you can never go from an output back to an 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).
    In short, the mining process, uses processing power to preform hash calculations as fast as it can. This is so it can be the first computer on the network to get the block hash below the target. If your successful, then the computer/server can add the block of transaction to the blockchain and share it with the nodes on the network.

  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).
    If Hash 1 and Hash 2 both produce the same output 256 output result, then this would break the Hash function properties.
    Hash Function Properties:

  1. You cannot work out the original data from the result.
  2. The same data always returns the same result.
  3. Different data produces different results.
    by definition of these hash properties, if Hash 1 and Hash 2 produced the same output result, then this would break the blockchain resulting in a ā€œcollision".
1 Like
  1. Hash functions create a unique output (with a fixed length) when you are giving them an input with a variable length. Every small change results in a completely different output. Hash functions are not 100 % secure, but to brute-force them is very time consuming, because there are ā€œnearly infiniteā€ possibilities. The chance to guess correctly is infinitesimal
  2. Bitcoin transactions are stored as a linked list (contains data and hash pointer from previous blocks). In Bitcoin: the content of the new block is hashed, a random string is appended and hashed again, the resulting hash is compared to the difficulty level.
  3. When you have two different inputs and hash them, then it is highly unlikely for the hashed output that the hashed output from A is the same as the hashed output from B. But you have to know that a hash function is not free of collisions, but it take a very long time to find a collision (that means the same hashing output…)
1 Like

1- Hash functions are one way functions to generate digital fingerprints.

2 - Hash functions are used in Bitcoin to quickly verify that all information in a block is legit and hasn’t been tempered.

3 - Collision resistant means that the likelihood of generating the same output with different input is very remote, nearly impossible.

1 Like

Hash functions provide a (most likely) unique identifier that represents another series of digital information. The complexity of the hash makes it ā€œimpossibleā€ to acquire the digital information that was input into the function. I see it as if it were a diode; current flows only in one direction.

  1. Hash functions are functions that take in an input and send out an output. They allow hashes to be tied to specific inputs. A hash function assigns specific ā€œhashā€ fingerprint to a specific hash function input.

  2. The hash function for cryptocurrencies is used to track transactions.

  3. Collision resistance in the hash function is when you have more than 1 input for the same output. Every time there are more inputs for the same output, you will have collisions.

1 Like
  1. Hash functions are meant to allow you to input a string and get an output string but you cannot get the original input without already knowing it and hashing it again to match the hashes(Outputs)

  2. I believe hash functions are used in cryptocurrencies because it allows us to verify tranactions without knowing the exact transaction by comparing the hash through the consensus. if the hash is changed at all we know it was changed.

  3. This means that 2 hash function should not be possible for 2 hashs to have the same output with different data.

1 Like
  1. Hash functions take a unique input an create an almost unbreakable output that is unique to the input And a fixed length.

  2. Hashing functions are used in I Bitcoin transactions that are added to the blockchain .

  3. Collision resistant means that two different inputs will not produce the same output .

1 Like
  1. Hash functions are one-way functions that produce an output or digital fingerprint for a given input.

  2. Hash functions are utilized by Bitcoin to verify and track transactions.

  3. Hash functions need to be collision resistant, that is to say that two inputs should not produce the same output.

1 Like
  1. Describe hash functions with your own words
    Hash functions provide a digital fingerprint for input data. Each digital fingerprint is unique and is a fixed size. Once the unique output has been created, you cannot use it to discover what the input data is.
  2. How are hash functions used in cryptocurrencies like bitcoin?
    Hash functions are used to write new transactions into the blockchain through mining.
  3. What does it mean when we say that hash functions need to be collision resistant?
    Collision resistance means that it is hard to find two inputs that hash to the same output
1 Like

1 a cryptografic function that takes any output and creates a unique string of numbers as a output
2 it is used to provide secutity in bitcoin as it prevents you from tampering with any data as its more like 1 way street and once something (transaction) goes through theres no going back
3 collision resistant means 2 different things will never have a matching hash

1 Like
  1. Hash functions are unique digital fingerprints we obtain when we create an output based on the input.
  2. Hash functions are used in cryptocurrencies like bitcoin in form of algorithms, SHA-256 for bitcoin. From the single nodes that in the Merkle tree are represented as leaves we climb with hashing through Merkle branches to reach a Merkle root. We use hash functions to confirm transactions through mining and create addresses.
  3. When we say that hash functions need to be collision resistant, it does mean that when we have two different inputs it is most likely that we will have two different outputs, two different hashes. We say it is infeasible for both hashes to be the same, but we have to take into account also what we call ā€˜The Birthday paradox’.
1 Like
  1. Hash functions are a one-way conversion of input data to output data.
  2. Hash functions are part of the mining in the blockchain technology. They write new transactions into the blockchain through the mining process.
  3. Collision resistance is a part of hash functions and it is mean that is very hard to find two inputs data that have the same output in their hash function.
1 Like

1
Hash functions give, as a result, a unique output (numbers and/or letters) for any input. For example, it was useful back in the days when the Napster peer to peer network indexed the mp3 files with a MD5 hash function so it was easy to find many copies of the file stored in the p2p net, by only searching the hash.
A hash function produces strings encoded in a way that it’s not possible to reconstruct the input sequence of characters from neither huge db or movies, neither 1 digit).

2
The hash function SHA256 is used in the Bitcoin bc in every block: On multiple points of the block genesis the 256 characters are added in keypoints in order to validate the chain. For example in the header of every block the hash of the previous block is inserted.

3
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.
Cryptographic hash functions are usually designed to be collision resistant. But many hash functions that were once thought to be collision resistant were later broken. MD5 and SHA-1 in particular both have published techniques more efficient than brute force for finding collisions. However, some hash functions have a proof that finding collisions is at least very difficult: They must be ā€œprovably secureā€.

1 Like
  1. Hash functions are one-way functions so when you put a unique input in you get a unique output.

  2. They are used to write new transactions into the blockchain.

  3. They need to be collision resistant because there should never be duplicate outputs.

1 Like
  1. A hash function takes an input and provides a digital finger print output. It is a one way function i.e. you can go from input to output, but not output to input.

  2. In Bitcoin, hashing is used in block creation and mining. In block creation, transactions in a block are hashed in the form of merkle tree which results in a single hash (merkle root) representing all transactions in a block. In mining, miners use a nonce (arbitrary string) which is concatenated with the hash of the block and hashed again, if the result is less than the difficulty target, the block as added to the chain and the miner is rewarded.

  3. As the idea of hash functions is to be deterministic, i.e. provide a unique output for a particular input, collision resistant means that two different inputs won’t result in the same output.

1 Like
  1. Hash functions are special functions that produce one unique output (like a ā€˜finger print’) for each input used.
  2. hashes are used all over in crypto, in mining blocks, in transaction processing, in key and address calculations, in messages signatures, in multi-key-wallet processing, in password protections schemes, and so on and so on…
  3. it means that it should be hard to find 2 different values A and B so that H(A) = H(B). The need to be ā€œcollision resistantā€ does not mean ā€œcollision freeā€ only that it needs to be ā€œhard to findā€ (it happen before in bitcoin coinbase transaction hash block numbers 91842 has a duplicate/same coinbase tx hash of block 91812) but I guess this is not a case of a collision, but just a ā€˜fait diver’ I ear about (in this case the same miner-address found two blocks with same amount of bitcoin, so same coinbase-transaction-data so H(coinbase-tx-A)=H(coinbase-tx-B) => coinbase-tx-A=coinbase-tx-B (deterministic property) when tx hash scripting was not preventing unique hash generation that later on was introduced in motivation no.2 of bip34.
1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    A hash function is a mathematical functions that takes an input and produces an output of fixed length, and in such a way that the process cannot be reversed.

  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).
    One way it is used is for assuring integrity of data, another way is to calculate tha hash of a block based on previous block data and the data for this block.

  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 means that two different inputs does not produce the same output. They would ā€œcollideā€.

1 Like
  1. Hash functions are functions that for each unique input, there will be a unique output.

  2. Hash functions are used in bitcoin in the process of miners mining bitcoin in ā€˜proof of work’. In order to earn bitcoins through mining, it requires a huge amount of work and processing power. If the hash functions did not give a unique output for every input, this could cause a disruption in the integrity of the mining process and degrade the whole reason why bitcoin is the success that it is.

3.In Hash functions such as SHA 256, there may be instances where there will be multiple inputs for the same output. Collision resistance is not that these multiple inputs will not exist, but that it will just be so hard to find them with all the probabilities that are generated.

1 Like

1 Hash functions are used in cryptography to produce an output from an input. The output results in a string data which is associated to a specific input.

2 In cryptocurrencies, hash functions are used to record data of transactions using the same mechanism of input-output values (also called the block hashing algorithm);

3 Collision Resistant in Hash Functions means that is hard to find two inputs that hash to the same output.

1 Like

1- hashing are one way functions where each input produces an output or digital fingerprint, every small alteration in the input will result in a different output.

2- hash functions are used in BTC to mine new transactions on to the blockchain. They are also used to encrypt data, improving security.

3- they are collision resistant because every small alteration on the imput will give a different output, meaning to different inputs will never get the same hash.

2 Likes