Homework on Hash Functions - Questions

A hash function is basically a universal translator. You can put in any file - e.g. numbers, words, pictures - even complete novels and you will always get an output with a fixed

length (e.g. 64 digits when using SHA-256). In case you just change one letter or number it will spit out a completely different output. On top it has a one-way mechanism - meaning you cannot start with the output and then try to figure out what the input has been.

These hash functions are the building blocks in the block-chain and is used for security purposes and the actual backbone of the crypto security.

Collision resistant hash means itā€˜s hard to find two inputs that hash the same output.

1 Like
  1. it creates a digital fingerprint of a certain input, without being able to reverse the fingerprint to the original input.

What happened with the rest of your homework? :stuck_out_tongue:

  1. Hash functions act as a unique identifier for processed data without containing the original data in itself. Data inputted is converted into binary and then rendered into an encrypted alphanumeric sequence that acts as a digital fingerprint.
  2. Within the bitcoin eco system, the hash function becomes part of the data contained in the block header which is within itself an amalgamation of data relevant to the block. The hash creates a unilateral flow of data that prevents retracing and thus removes the possibility of corruption. Its function within the block header makes mining possible by vastly reducing the data required to discover the root of the hash key.
  3. Collision resistance refers to the extremely low possibility of more than one value creating the same solution once hashed. This would create problems in the blockchain as it could create orphan blocks, or in the event of two solutions being found simultaneously, a stale block.
1 Like

Orphan blocks don’t occur on hash collisions, a collision could potentially brake the security of the blockchain altogether. Stale blocks occur when two miners find a block at the same time that both have a hash that is below a target but are not the same hashes. :slight_smile:

1 Like
  1. A hash function takes a unique input which can be any type of data of any length and provides a unique fixed digit output known as a hash. This is a one way mechanism, meaning that the input can not be derived from the output thus making it extremely secure and almost impossible to hack.

  2. Hash functions are used as part of the Block Hashing Algorithm that is used to record new transactions to the blockchain by miners. The inputs for the function are all of the most recent, not yet confirmed transactions as well as some timestamp inputs and information regarding the previous block.

  3. It means that no two input hashes should give the same output hash. This makes it computationally infeasible, however they can not be collision ā€œfreeā€ as they have a fixed output.

1 Like
  1. A hash function is a mathematical process that takes input data of any size, performs an operation on it, and returns output data of a fixed size.
  2. Block hashing algorithm is used to write new transactions into the blockchain through the mining process and hash functions are part of the block hashing algorithm.
  3. Collision resistance is the property of a hash function. Collision resistant hash means its hard to find two inputs that hash the same output
1 Like
  1. A Hash function such as SHA256, that is typically used in Bitcoin, is a string of data that is converted to an alphanumeric digital fingerprint that is irreversible.

2). In Crypto, such as Bitcoin, hash functions are part of the block hashing algorithm which is used to write new transactions into the Blockchain through the mining process.

  1. Collision resistance means that it is unlikely but not impossible to have 2 different inputs hash to produce the same output. This is unlikely with SHA256 but has happened with MD5 and SHA-1. Having 2 inputs produce the same result would create serious complications in the blockchain.
1 Like
  1. A hash function is a function that when given a unique input, it returns the corresponding unique output (the hash representation of the input).

  2. Hash functions are how cryptocurrencies secure their blockchains and prevent people from tampering with their history of transactions. When a new block is added to the blockchain, a new hash is created. The input for this new hash is comprised of the data of the block, a nonce, and the previous block’s hash. Because of this, if someone tried to change a block in a ledger, they would have to alter every hash in the blockchain. It would eb impossible to get every machine in the network to validate this basically brand new blockchain.

  3. A hash function is collision resistant if it is very difficult to find to inputs that hash to the same output. If the outputs of a hash function are not unique, then the blockchain becomes ambiguous.

1 Like
  1. Hash functions are computational functions that produce a unique finger print for each unique input.

  2. For miners to be compensated for successfully mining a block, their mining software needs to hash the blocks header. The mining software uses hashing functions to attempt an output of a certain value (equal to or less than its ā€˜target’).

  3. Collision resistant is ensuring that 2 different inputs cannot produce the same output

1 Like

Homework on Hash Functions
1- Hash function, where you feed the function with input and get a unique output any small change in the input you will get a new output.
2- Is used to create the BTC address and for proof-of-work(mining)
3- Having two messages with the same HASH value is almost impossible.

1 Like

1.Describe hash functions with your own words
Hash functions are always a one way function. Each function generates an unique output
You can go from INPUT to OUTPUT but never vice verca.

2.How are hash functions used in cryptocurrencies like bitcoin?
Hash functions are needed to do the POW (prove of work) because they generate a statement which makes sure that a transaction is valid.
And as mentioned before you do know the INPUT and you can calculate the Output.

3.What does it mean when we say that hash functions need to be collision resistant?
In simple word it means that it is nearly impossible to find two inputs which are producing the same outputs.To prove transactions on the Blockchain you need this collision resistant ā€œfeatureā€

1 Like

1.) Hash Functions are special functions that go only 1 way.
You can not get from Output --> Input.
Each Input creates a unique Output. (Fingerprint)

2.) It is used for encryption = as a security measure. During the mining process.

3.) 2 Different messages can not have the same Hash (Output)

1 Like

1.Each unique input produces an unique output plus it’s a one way mechanism, meaning you can go from input to output but not reverse.
2.The transactions are taken as input and run through a hashing algorithm. Bitcoin uses SHA-256 which gives an output of a fixed length.
3. A 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
    Hash functions produce an encrypted output based on the hash algorithm and 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).
    Hash functions are used to encrypt all transaction data making it more secure.

  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 means that no two inputs can hash to the same output.  Every input must produce a unique output.
1 Like
  1. Describe hash functions with your own words.
    A one way (irreversible) function where each unique input will create a unique digital fingerprint as an output

  2. How are hash functions used in cryptocurrencies like bitcoin?
    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. What does it mean when we say that hash functions need to be collision resistant?
    It should be hard to find two inputs that hash to the same output, because the harder they are to find, the more cryptographically secure the hash function is

1 Like

1.Hash functions are one-way functions. Users can’t reverse the function from output to input . Also unique inputs generate unique outputs.
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.Hash functions need to be collision resistant for security reasons. If collisions are easy to find an attacker can swap the real ones with fake ones , but keep the same signature value.

1 Like

1. Describe hash functions with your own words

Hash functions are a type of function which you introduce an input and it will result in an output. The important characteristics is that each unique input will produce a unique output, and it is (for the time being) impossible to reverse the function and get the information of the input with the output. Hash functions are versatile because any type of input such as text, digits and other media types can be hashed which will produce an output number represented by digit and letters, like hexadecimal type, and if something as a tiny bit of information is changed from the original input the resulting output will be totally different. This helps to check data integrity, if one single bit of information is changed from the original input then, the resulting output will be totally different.

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 cryptocurrencies are used to secure the blockchains. They are used to encrypt the transactions and make sure there are no double spendings or false transactions to any account. Hashing the information on each block and linking it with the next hash function makes impossible to alter any data. This makes the cryptocurrencies safe.

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 means that it has to be ā€˜impossible’ to go from the output to the input. If a hash function can get the same output from to different inputs it means that the function and its algorithm is not safe.

1 Like
  1. Hash Function is a function that take unique inputs and give a unique output. It works by taking any form of input value into a compressed numeric value of fixed size. Changing a small part of the input would result in a completely different output from the original.
  2. In BTC the hash functions are, though the mining process, part of the block hash algorithm, used to write new transactions in the blockchain. To successfully ā€˜solve’ a block, miners try to combine all of the inputs with their own arbitrary piece of input data in such a way that the resulting hash starts with a certain number of zeroes.
  3. Collision resistance is the property of a hash function that it is computationally infeasible to find two colliding inputs. Every hash function with more inputs than outputs will necessarily have collisions. Collision resistance doesn’t mean that no collisions exist; simply that they are hard to find.
1 Like
  1. Describe hash functions with your own words
    Hash function is a function that encodes any piece of information into a unique code that is not traceable to the original information

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

with the need for every transaction to be hashed to write new transactions and with the hash needing a lot of processing power to do it.

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

colision resistant means that it is extremely difficult to hash two different inputs into the same output

1 Like