Homework on Hash Functions - Questions

1. Describe hash functions with your own words

A hash function is a one-time output that cannot be traced, compared to a function. It is a one-way function.

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 function are used in transactions and mining of Bitcoin. In order to mine bitcoins, computers need to solve complex arithmetic problem.

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’s vital that two different inputs don’t have the same hash output; this is imperative to digital safety. While mathematically this is possible, it’s best if the odds are astronomically long for two different inputs to end up with the same output. In the event two distinct inputs have the same output, it’s referred to as a cryptographic hash collision, making it imperative for a hash to have a strong collision resistance. Otherwise, the algorithm will be vulnerable to collision attacks, which threatens security. Collision resistance is born of two other forms of resistance”
https://bitcoinexchangeguide.com/bitcoin-hash-functions/

1 Like
  1. A hash function is like a digital fingerprint for a data object. Essentially you put a string on any length in and get a fixed length output. The output for a given string should always be the same (using the same hashing function).
  2. The inputs in to the bitcoin hash function are the most recent none confirmed transactions. The hash is run on this by miners who try to calculate the hash to add the new block to the chain.
  3. Collision resistant means it is statistically unlike to generate the same hash for a different input.
2 Likes

Unique inputs are converted to unique outputs using numbers and letters.

Hash functions are commonly used to store passwords, but at the same time, they play a leading role in how cryptocurrencies like Bitcoin can operate.

Collision resistance is a property of cryptographic hash function. A hash function is collision resistant if it is hard to find 2 inputs that hash to the same output.

1 Like
  1. Describe hash functions with your own words
    an x + ? format enables an out put with which the input is difficult to trace

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

Because it is hard to reverse engineer the output back into the original input and hash function used. This prevent double spending. It also helps to secure the blockchain from changes. It also helps with giving rewards to miners like tokens and transaction fees.

  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 would be difficult to find another input for the hash which results in the same output.
1 Like
  • Describe hash functions with your own words
    A hash function is an algorithm that takes any input and converts it into a new output which in crypto/blockchain is used to create the digital fingerprint that represents a transaction on the network.

  • 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).
    When a transaction occurs an a cryptocurrency network such as bitcoin, the initial data is inputed as a transaction attempt or request, it goes through this hash function which miners execute and when they reach consensus on the output, this is considered a completed transaction.

  • 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 resistant is the quality a hash function has of being extremely unlikely that two different inputs will produce the same output once ran through the hash function.

1 Like
  1. Hash Functions are unique inputs that compute unique outputs which are digital fingerprints.

  2. Bitcoin miners work to solve increasingly difficult mathematical equations adding new blocks to the blockchain in exchange for newly created Bitcoin.

  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; that is, two inputs a and b such that H ( a ) = H ( b ).

1 Like
  1. Hash Functions are algorithms that convert any text or media into a fixed length string of characters.

  2. Hash Functions are used in cryptocurrencies like Bitcoin to hide a persons private key during a transaction.

  3. Collision Resistant in reference to Hash Functions means that no two inputs should equal the same output when ran through the Hash Function. It is impossible to make a Hashing Algorithm that is completely collision resistant, however, the odds of this happening are almost impossible due to the large amount of possible outputs.

1 Like
  1. A hash function is the mathematical process of converting or translating input of any length and character type and producing the cryptographic fixed length result of a Bitcoin hash algorithm. Each hash is unique to the input. This cannot be changed and cannot be reversed from Hash back to original input.
  2. Hash functions in Bitcoin are part of the mining of new blocks and new bitcoin. By having to produce the correct hash result miners have to use recent inputs to get the correct result and be verified by everyone on the blockchain. This forces consensus and allows the process to continue.
  3. For the hash functions to be collision resistant it means that 2 different inputs should not easily produce the exact same hash. It can happen but should be very rare.
1 Like

The merkle tree is just a tree of hashes and only contains txids (which are transaction hashes). The tx data is stored in the block data and the header contains the merkle root of these tx hashes that is later used in the block hashing process.

Brute forcing a hash function should theoretically take thousands of years. But as soon as a hash function can be brute forced in a reasonable amount of time its considered not secure anymore. :slight_smile:

2 Likes

So the time it takes to create a block has nothing to do with it? How will quantum computers change this?

No. Quantum computers today are mostly specialized for a specific use case and afaik its not for hash functions. When a computer will be able to break the hash function the network will need to hard fork to remain secure.

3 Likes
  1. A hash function is an irreversible mathematical process that takes unique input data of any size, performs an operation on it, and returns unique output data of a fixed size comparable to a fingerprint.

  2. Hash functions are part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining process.

  3. If an hash function is not collision-resistant (there is no thing as collision free because output has a fixed length) then an adversary can break the funtion easily.
    The chance of 2 different inputs giving the same output mst be very, very unlikely.

1 Like
  1. Hash function is a simple function, which gives unique output with every input. And it can’t be reversed in any given order’s.

  2. In Bitcoin there is an hash function called SHA256. And to put in simple words you require hash to make 1 whole bitcoin.( It’s like hash you get in Amsterdam smoke shop, you can’t trace it back)

  3. It means that if the hash function is collision resistant, no one can copy your bitcoin.

1 Like
  1. it’s a function to convert data to a unique code. This is a one way street. From the data you put in, you’ll get an output ( hash ). It almost impossible to retrieve the original impute data using the hash.

  2. The input data is being converted to a form of code using the SHA-256 hash algorithm. Every block that is being mined has his own hash and the hash of the previous block. All the nodes also have a copy of the blockchain. In this way you can alway check and verify if a new transaction is valid or not.

  3. This means that it is hard to find 2 inputs that have the exactly the same hash output.

2 Likes

Your reply helps me see things better. Thanks Alko89

Just to clarify, do you mean two different private keys creating and signing and sending a 1BTC transaction and resulting in the same hash output ?

Or can it actually be two different private keys creating and signing and sending two different value of BTC transactions and resulting in the same hash output ?

1 Like
  1. Describe hash functions with your own words
    A hash function is a function which gives a unique output with every input. You can’t find out what the input of the output is.
  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 a part of the block hashing algorithm which i sused to write new transactions into the blockchain through the mining process.
  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 resistant means that the chances of two different inputs creating two identical outputs are very low/unlikely.
2 Likes

each unique input = unique output

hash functions are used to write new transactions into the blockchain

a hash function is collision resistent if it is hard to find 2 different inputs that hash to the same output
‘a’ does not = ‘b’, but H(a)=H(b)

1 Like
  1. Describe hash functions with your own words

Hash functions take a unique input and give it a unique output. It is a one way conversion of data from the input to the unique output/digital fingerprint.

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

In Bitcoin the hash function is used in many instances;

  • To create addresses, private and public keys.
  • Hashing keeps bitcoin secure by encrypting transaction data through SHA-256
  • by the miners to hash the block header in order to make it equal to or less than the target hash, for only then can they add their mined block to the blockchain.
  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).

Hash functions need to be collision resistant to ensure that 2 different inputs cannot result in the same output. If this were to happen it would render the hash function insecure.

2 Likes
  1. Hash Functions are a mathematical way of reorganizing data that is unilateral; meaning a specific input will always generate a specific output but an output cannot be used to find an input.
  2. Hash Functions are used in cryptocurrencies to generate public and private keys for wallet addresses that are used to send and receive crypto.
  3. No two outputs can be identical for any distinct inputs for hash functions. If an output, or hash, is the same for two different inputs than a collision has occurred. If the SHA-256 algorithm were found to not be collision resistant, Bitcoin’s blockchain security would be compromised.
1 Like

Hash functions are used as data fingerprint not exactly the same as PK cryptography but a collision can occur in both.
In any case a collision occurs when two different input parameters result in the same fingerprint or signature.

1 Like