Homework on Hash Functions - Questions

  1. Mathematical functions that give unique outputs from unique inputs and inputs cannot be deducted from the hash
  2. Hash functions make it extremely difficult to duplicate transactions in cryptocurrencies, therefore giving a unique fingerprint to each transaction in a trustless manner.
    3.means almost impossible to duplicate an outcome from a given input
1 Like

1- A hash function takes an arbitrary length input and outputs a fixed length value. This value acts as a unique signature or fingerprint that represents the data. Hash functions are used to verify data integrity because any change to the data will immediately change the hash output.

2- Hash functions are mainly used by miners in cryptocurrencies like bitcoin. Hash functions are used to add new blocks to the blockchain. For example, in order for a miner to add a new block to the blockchain, a miner must gather transactions from the transaction pool and package them into a ā€œcandidate blockā€ along with block header metadata that is useful to miners. Then for the candidate block to join the blockchain, the miner hashes the data in the block header and hope that the result is below a target value that is given by the bitcoin network.

3- Hash functions need to be collision-resistant means that there should be no output hash that is identical to another output hash unless the initial inputs are the same. It is not mathematically impossible, but it is extremely unlikely to occur. If H(A) = H(B), then it must be that A = B.

1 Like
  1. A function that generates a unique output from a given input, that can not be known given the output.

  2. They are used to make data contained in the blockchain tamper-proof. Given that a minor change in a block would result in a complete different hash, it is easy to check if the data of a block has been altered by checking the hash of that block. If the hash of a block equals the hash of the pointer to that block, the block has not been altered.

  3. Colision free means it is impossible to find two different inputs that produce the same output. This does not mean that collisions dont occur, but that the probability of a collision is infinitesimal.

1 Like

Hash functions are not used to derive public keys, for that the elliptic curve function is used. However the public key is hashed to get the address. :slight_smile:

2 Likes
  1. Hash functions take an input of any length and give it a value of a set length, it is impossible to revert to the original data other than brute force.

  2. Hash functions are used in cryptocurrencies like Bitcoin to allow mining to take place, transactions are confirmed by miners guessing the correct hash to seal a block and if they get it right they get rewarded in Bitcoin.

  3. Hash functions need to be collision resistant, this means they need to give a different output hash for each different input. This is not the case, however it is so astronomically rare to arrive at the same hash twice that that it is not typically a problem.

1 Like
  1. A hash function provides a unique output for any given input.

  2. Hash functions are used by bitcoin to store data securely in a linked list.

  3. Collision resistance means that different inputs should almost always result in a unique output.

1 Like
  1. A hash function will take your input and convert it to a unique string of characters. When you want to verify that the information that was hashed hasn’t been changed, you just hash the text and the compare the hash it generated to the one you want to verify.

  2. In cryptocurrencies, hashes are used for every block used in the blockchain. Every block gets a hash that includes the hash of the previous block to make sure the current and previous blocks aren’t tampered with.

  3. It means that you get the same output for different inputs entered

1 Like
  1. Hash functions are there to stop people being able to reconstruct and therefore make use of or corrupt the input data of the output hash. The hash function creates a personalised 256 bit output to any data that is fed into it, and from this output it is infeasible to reconstruct the original data and so secures all transactions/info via cryptography.
  2. Hash functions are used to protect private keys and also as a way to secure and confirm any transactions on the blockchain by supplying a unique public key that is almost impossible to accidentally or actively repeat. A hash function also solves or confirms blocks on the blockchain.
  3. To say the hash function needs to be collision resistant is to say that it should not be possible or at least the chance should be so remote as to be infeasible that a hash out put could be repeated. as this would then allow such things as multiple people access to the same private wallets.
1 Like
  1. Hash Functions - generate a unique 64 character string representation from any input as an output.

  2. Bitcoin uses Hash functions to generate a unique string of numbers that can be used to represent and track transactions in the bitcoin blockchain.

  3. Collision resistant - prevents the creation of identical hashes for different inputs.

1 Like
  1. Hash functions are one-way conversions of data comprised of input and output with a unique identity.
  2. Hash functions are used to write new transactions into the blockchain through the mining process. This process is crucial to the ā€˜proof of work’ algorithm that gives value in mining Bitcoin. It also becomes the unique identity of each transaction on the blockchain.
  3. Collision resistance is when more than one input provides different hashes to the same output. This is computationally infeasible but, it is not impossible. When a hash has only one output the validity of the transaction can then be confirmed. Being collision-resistant proves the hash is authentic.
1 Like
  1. Hash functions are functions that accept a unique input in order to compute a unique output. However, hashing makes it infeasible to find out what unique input was used to produce the unique output and hence, a unique output can usually not be used to find a unique input.

  2. Hash functions are used to store data on the blockchain cryptographically. They use pointers and linked lists to do this. Each block created is pointed by the block created before it through a hash function to represent the previous node or block in the blockchain. Additionally, each block has a list of transaction data i.e. payments in the block that are linked through hash functions local to the block. In the block, data is divided into parent and child nodes to organize block specific data. In general, hash functions are used in cryptocurrencies like bitcoin to address data cryptographically and provide security and data organization for the blockchain.

  3. Hash functions need to be collision resistant meaning, there cannot be 2 hash outputs that are the same based on 2 different inputs. This is due to the fact that if there are 2 hash outputs that are the same based on 2 different inputs, the data is misinterpreted and collides with each other when accessed at the same time.

2 Likes
  1. A hash function is the process of taking an input and converting that into unique fixed length output, Bitcoin uses Sha256

  2. They are used as unique Hex indexes of transactions preformed.

  3. Collision resistance means not being likely to produce a Hash which not unique resulting a ā€œcollisionā€

2 Likes
  1. Hash functions is a algorithm that will take your input and will deliver a string of text as your output. Which will act as digital fingerprint for said transaction.

  2. One way is that it checks to ensure transactions, public keys, signatures, etc are valid.

  3. That no two inputs can have the same output hash.

2 Likes
  1. A hash function is a unidirectional mathematical function which converts an input of any length to produce an output of a fixed length. The output is a unique digital fingerprint of the input yet it is infeasible for the input to be inferred from the output (assuming a high min-entropy distribution for possible inputs (viz. dice rolling low min-entropy vs. 54 character base58 private key)). The hash function achieves this by converting the input into binary format, subjecting that to several binary (hashing) operations and then producing an output of a fixed length in a certain binary-to-text encoding,
  2. Hash functions are used in cryptocurrencies in more way than one. Hashes are used to represent the current state of the blockchain to ensure its immutability. Transaction IDs are formed by taking transactional info (amount, addresses, timestamp etc.) as inputs to provide hashes (hash function outputs) that can be used to identify and confirm that a transaction has happened. The multiple transactions in a block are hashed to produce a hash for that block. The hash of the combined transaction hashes in the next block is combined with the hash of the previous block to provide the hash of the new block and so on and so on. Hash functions are also used for wallets partaking in transactions as the public keys are the output of a hash function on the private key. In summary, hash functions are used for wallets, transaction ids, and blocks.
  3. The need for hash functions to be collision resistant refers to the need for them to avoid having a scenario where two different inputs result in the same hash/output. In other words the hash of X should not feasibly have the same result as the hash of Y unless X=Y.
1 Like

Hash functions are not used to derive public keys. For that the elliptic curve function is used. :slight_smile:

1 Like

Cool, thanks for the info! I had simply assumed that it was a hash function.

  1. Hash functions are designed to take some input and then process it via an algorithm so that a specific output is created. This same output will always result when the specific input is provided. However, it is infeasible to deduce an input from the output created by a hash function.

  2. Hash functions are used in order to secure a blockchain. A hash function can be used to ensure that subsequent blocks are maintaining data integrity from previous blocks in the blockchain.

  3. A hash function needs to be collision resistant. This means that if we put in a particular input, it should not result in the same output as some other input. In other words, two differing inputs should not result in the same output after being hashed in the same way.

1 Like
  1. Describe hash functions with your own words
    input -> output
    output -\ 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 creating blocks that can follow previous blocks and create a blockchain. also in digital signatures

  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).
    the output (hash) has to be unique for each unique input(data). input -> output, output -\ input. it also cannot have the possibility to come to input from the output. some hash function as MD5 are not used anymore because they are vulnerable and not secured enough because people figured out how to come to input from the output. this is why in bitcoin is used one of the most collision resistant hash functions SHA256

1 Like
  1. Hash functions will always be a one way function, with hash functions you will have a unique input and in turn you will receive a unique output.
  2. hash functions in cryptocurrencies are used to write new transactions into the blockchain through a process called mining.
  3. The hash functions with more inputs than outputs will necessarily have collisions, the harder they are to find, the more cryptographically secure the hash function is. Therefore cryptographic hash functions are usually designed to be collision resistant.
1 Like
  1. A hash function is a function that takes an input and returns a unique fingerprint for this input. Each unique input has its own unique output. While it is trivial to go find the hash of an input, it is almost impossible to go from a unique hash to find its original input.
  2. Hash functions are used in the principle of a linkedlist where the hash function calculates the address of the next block each time. By changing the hash in the last block, it will change the hash in the previous block, which again triggers a change in that of the previous block, leading to a cascade of changes in the previous blocks, thus making the blockchain practically immutable.
  3. Each input will have it own unique hash. It is very hard to find two inputs that hash to the same output.
1 Like