Homework on Hash Functions - Questions

1.Describe hash functions with your own words

  • in a simple words a hash function takes any given size of input data then perform a mathematical based operation on it and provides a same size output.

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

  • in bitcoin hash function is used to generate new blocks in mining , the miner has to use hash function to creat a new block and to get incentives with bitcoin.

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

  • hash functions provide unique output of any unique input now if hash function are not collision resistant it would provide the given input from any given output which could fail proof of work mechanism , so in order fot bitcoin or any proof of work consensus to perform the hash function which is used needs to be collision resistant.
1 Like
  1. Hashfunctions are special functions used in cryptography. They deliver a unique string of letters and numbers as output for a unique input. They are pre-image-resistant, meaning that it’s practically impossible to determine the input only with the output hashnumber. Even the slightest change in the input variable or data delivers a completely different output hash, allowing to easily spot wether something got changed in stored data on a blockchain for example.

  2. Hashfunctions are used to write new transactions into blockchains, in case of bitcoin through the miningprocess. The input in those cases are all the most recent, not yet confirmed transactions, together with some additional inputs relating to timestamps and references to the previous block. To be added to the blockchain this data has to be combined with some arbitrary data in such a way, that the resulting hash starts with a certain amount of zeros.

  3. Collision resistance means that if we have 2 hashes with 2 different inputs H(A) & H(B), it has to practically be impossible for the two hash numbers to be the same

1 Like
  1. A hash function is a one way digital representation of an input or group of inputs. This representation
    is
    unique to the input and the hash will never be the same as another hash with a different input.

2.Hash functions are used in the case of Bitcoin (not exclusively for this reason) are used to consolidate
information. You can take a large amount of data and hash that data into a 32 byte string of
alphanumeric line no matter how large the data. This is extremely useful for a global cryptocurrency.

  1. What this means is that, it is extremely hard to come up with the same hash in the same block. The
    probabilities of this happening are astronomical because one small tweak on the input changes the
    hash. This is not impossible, but highly improbable.
1 Like

Thanks for the clarification. So. To different input such as A1 and A2 would not have the same digest of X1

  1. Hash functions are functions that take in data and transform that data into a hash and output that data. The thing that separates hash functions from normal functions is that you can go from input -> output but not from output -> to input. This is not impossible but infeasible as the only solution to do that is brute force. But with a SHA-256 hash function this will take an atronomically amount of time. So not impossible but highly infeasible.

  2. Hash functions are used in multiple stages on the bitcoin blockchain for example, each transaction is hashed using the hash function. Then it gets put into a merkle tree (first it was a leaf). The merkle tree has a top hash (tx_root) containing the upper 2 hashes. Those upper 2 hashes also contain hashes from the hashes above them, and so on until you get to the leaf again. Then the hash of the block gets taken and concatinated with a random string (nonce), then it gets hashed again using hash functions and broadcasted onto the network for miners.

  3. This means that each input has its own unique hash (for the most part :slight_smile:)

1 Like

1.) Hashing is a system where in each unique input entered will produce a unique output. Sort of like a “digital fingerprint”. This is only a one way process meaning it can only go from input to output never in reverse.

2.) Hashing functions are useful in several ways within the crypto currency ecosystem. In Bitcoin, transactions are taken as input then run through SHA - 256 a secure hashing algorithm. This gives it an output of a fixed 256 bits. This helps protect transmissions from tampering. Also algorithms such as this are deterministic, efficient, and pre image resistant which helps protect against attack strategies like the brute force method. In addition to all the attributed listed above one of the main advantages is collision resistance.

3.) Collision resistance means that it is very difficult or almost impossible to find two inputs that hash to the same output. This makes the transmission very secure.

1 Like

Not any given output, but some might and since there is infinite possible inputs (anything can be an input) and a finite number of hashes (2^256) a hash function will have collisions. It is just the probability of finding two inputs that would result in the same output is extremely low in SHA256. :slight_smile:

3 Likes
  1. Describe hash functions with your own words
    -The hash provides a digital print to any kind of data, doesn’t matter how small or big it is.
    -You can go from input to output but never the opposite way.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    They are used for the mining process where the new blocks are hashed and concatenated with the nonce (random value that helps keep the block safe and untrackable) and it’s hashed one more time. This new hash is compared to the difficulty level where if it’s lowest than the difficulty level, the block is added to the chain.

  3. What does it mean when we say that hash functions need to be collision resistant?
    Means that each input will have it’s own unique output.

1 Like

Hash functions are unique (finger print like) codes that take an input string of any length and give it an output, of fixed length. Hash functions cannot go from output to input.

In the context of cryptocurrencies ike bitcoin , the transactions are taken as input and run through a hashing algorithm ( bitcoin uses SHA-256) which gives an output of a fixed length.

When we say a hash function needs to be collision resistant we mean it is hard to find two inputs that hash to the same output.

1 Like

Thanks a lot for your help! Cheers from Mexico!

1 Like
  1. Hash Functions are one way functions which transform input text to unique output.
  2. A Bitcoin Hash functions is used to securely encrypt the transaction information. This creates an immutable and unique transaction state between the sender and receiver.
  3. This is a property of cryptographic and in the end there is a very low probability that of 2 inputs generating the same output hash.
1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    A hash is a function that changes an input variable of data into an alpha numeric hash code compatible with the algorithm used (eg Bitcoin SHA-256). The hash code is unique to the input and the input cannot be changed in anyway without generating a different hash code. Due to this, the whole blockchain hash would change from that point, as each child would change the hash of itself and its parent, making manipulation easy to identify and computation quick to perform.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    Unique hash codes - Generated from the input, which are the same for the same input but different for different inputs and cannot be broken by calculating the input from the output hash code.

High hashing speed - Quick computation of the hash

Secure hash function - It is infeasible that the computation could be achieved to reverse a hash code back to the original input.

  1. What does it mean when we say that hash functions need to be collision resistant?
    They need to be able to be resistant to the statistical probability of the input being correct for the hash, as with the Birthday paradox, the point at when the likely hood of getting the correct input, causing a collision increases to 50% (calculated by square root of total number of possibilities)
1 Like
  1. A hash function is a complex mathematical function that produces and output given any size of input that will always be the same (for the given input). It can be quickly calculated and acts as a quick way creating a fingerprint for the input data such that any tampering with the input data would fail to product the same output.

  2. Hash functions are used in bitcoin to efficiently allow the history of all transactions to be interconnected and verified in a way that ensures that no data has been changed.

  3. Collision resistant means that the likelihood of two given inputs to a hash function giving the same output is extremely low. Without this the assumption that given H(A) = H(B) then A=B would be a less same assumption.

2 Likes

Hash functions are like producing an exact snapshot of the input with a unique, virtually unhackable output.

Hash functions are used in cryptocurrencies like bitcoin by producing a highly secure system and enables transactions to be added to the blockchain. Public and private keys are the results of hashing transaction data.

Collision resistance means that inputs A and B will result in their own unique hashes and that it is infeasible for those to inputs to result in the same output such that H(A) = H(B).

  1. A hash function is a one way conversion of a string of data (of any size) to a fixed length output.
  2. no time at 1.30 am!
  3. Collision resistant in this instence means that it is highly unlikely (but not mathematically imposible) to get the same output from a hash function.
  1. One way, each unique input gives a unique output.

  2. It is part of the block hashing algorithm which is used for writing new transactions in the mining process.

  3. It is a property of cryptographic hash functions, and it makes it hard to find two inputs that hash the same output

1 Like
  1. Hash function enables security of a message transmition to a prticular recipient.

  2. Hush functions in bitcoin: are part of the block hashing algorithm, which is used to write new transactions into the blockacin through the mining process.

  3. Collition resistance means if it is hard to find two inputs that hash to the same output.

1 Like
  1. Hash functions are one way input-output functions. A function is given, and values are generated using a string of text resulting from that mathematical function/condition. This text gives each value of the function its own unique fingerprint.
  2. Bitcoin uses the hashing algorithm SHA-256, it is a 256-bit hashing function which takes the transactions of bitcoin as input in said algorithm and produces an output of a fixed length. No matter how large the length of the input, the output will always be the same length.
  3. Collision resistant is the idea that every input as its own unique fingerprint, so no input gets misrepresented as an incorrect output.
1 Like

Answers:
1. A hash function is a code using mathematical basis which takes an input through and returns an output which is drastically different than input.

2. bitcoin (blockchain) is an array of link-lists (Blocks) which each block contains a hashed data of prv block’s data, hashed address of its parent and its child blocks, arranged in a way that if any block gets hacked, the prv block’s data won’t match anymore. Eg: if supposedly block no. 6 is hacked (which is infeasible) then hash-pointer of block 5 won’t match and can’t point to block 6 anymore, so block 5 also needs to be hacked and changed and so on, which is not possible.

3.
a collision resistant hash function means for any given input there is one and only one unique output. more or less like fingerprint. So H(x) is infeasible to = H(y)

1 Like
  1. Hash functions provide a digital fingerprint for data, making it easy to verify authenticity of the data. Since the function is only able to be read/calculation in one direction, from input to output, it makes it impossible to tamper with digital data without it dramatically changing the output.
  2. Hashing can be used to verify transactional data.
  3. Collision resistant means that it is very difficult to have two different inputs turn into the same output.
1 Like