Homework on Hash Functions - Questions

Homework on Hash Functions - Questions, July 17th 2020

  1. Describe hash functions with your own words.
    A hash function is when input of strings of any length is process through
    a computational method, to produce a fixed length output of characters.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    Hash functions is used in crypto currencies as a means of security to protect
    the transaction on the public ledger.

  3. What does it mean when we say that hash functions need to be collision resistant?
    A hash function is collision resistant when two inputs result to two different outputs. When two inputs hash the same output results, it’s not collision resistant.

-Hector A. Martinez

1 Like

Homework on Hash Functions - Questions

1. Describe hash functions with your own words
it converts an input of any lengh (which can be letters, numbers, text) into a unique output of fixed length (hash), which is kind of a unique digital fingerprint.
2. How are hash functions used in cryptocurrencies like bitcoin?
it converts transactions/payments (input) into unique outputs (hash functions) which are always of the same lengh and which are then added to a new block
https://youtu.be/lik9aaFIsl4 (= great video which visualizes the merkle tree nicely)
3. What does it mean when we say that hash functions need to be collision resistant?
a collision resistant has functions means that now 2 different inputs can lead to the same hash (output) - if that would be the case there would be a double spending in BTC. You and i could claim to have that 1 BTC (input) which is recorded with the same output (hash)

1 Like
  1. Describe hash functions with your own words.

Hash Functions are oneway functions which transform input to unique key/fingerprint/code/output.

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

Hash functions are used to secure each block, and the system. They prevent you from ā€œdouble spendingā€ and that the blocks don’t goes of in different chains, if they do, the new chain becomes something else.
Right or wrong?

  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)

If it is not collision resistant, you can use other methods of trying to break the system than ā€œbrute-forceā€, it is typically considered a flaw in the hash function.
ā€œCollision resistance is a property of cryptographic hash functions: a hash function H 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), and a ≠ b. Every hash function with more inputs than outputs will necessarily have collisionsā€

1 Like

The only one way function to code information which has it’s individual fingerprint.

It uses hash functions for creating block signatures, verifying transactions, creating new adresses, keys etc.

It should be impossible to recive the same output from two different input.

1 Like

Its a way to link the blocks together. Where would they go? :stuck_out_tongue:

1 Like

Public keys are derived using a different function. But the addresses are hashed from the public key :slight_smile:

1 Like
  1. Hash functions are one-way functions, which means that each input gives a unique output and it is almost impossible to determine the input based on the output.
  2. Cryptocurrencies like bitcoin use hash functions to encrypt data due to their cryptographic characteristics. In Bitcoin, hash function SHA-256 converts the variable input into a hash output of a fixed 256-bits length.
  3. It means that in hash functions, no output hash should have two identical data inputs. Even though it is not completely impossible, the probability is really low (in high min-entropy). Some hash functions have been proven not collision resistant, such as MD5, or others.
1 Like
  1. A hash function is generating an output with a fixed-length from any input, using a mathematical function.
  2. The info in the blocks are hashed and the hash is used to link the blocks together. So the hash of the previous block is inside the current block. So if you want to change some info in a certain block, you must recalculate all hashed of all previous blocks too
    3.Collision resistant means that for the most part each input will have its own unique hash
1 Like

Forks?
Or am I way off :sweat_smile:?

1.Hash functions are mathematical equations where you add an input and get a unique digital fingerprint. You can go from input to output but, for now ,nobody has found a way to go from output back to input.it is practically impossible to do so.
2.In bitcoin , hash functions are part of the hashing algorithm which is used to write new transactions into the blockchain trough the mining process.
3.Collision resistance means that two different inputs cannot have the same hash, or output.

1 Like
  1. A hash function is a function that converts data of any size into a fixed size value. It is a one-way function, it can only convert data into a fixed size string but that same string not back into the original data.

  2. The data inside each block on the network is turned into hashes. These hashes are then hashed together to created a so called Merkle tree. This is done to make it easier to find a particular transaction. :woozy_face:
    Each block also has a hashpointer that contains the address and data of the previous block

  3. It means that hashes will never have fun at the carnival in the bumper cars. Each unique input into a hashing function will never produce the same hash as output.

1 Like
  1. Hash functions are where inputs produce and output and it is one way…your cannot solve the output to know what the input had been…
  2. Has functions are used in BTC in order to confirm transactions and guarantee that no double spend occurs…
  3. Cannot find a hash function with more inputs than outputs…
1 Like

#1 hash function is as if it where a network of mycelium, start to end groth having unique input characteristics resulting in unique outputs aka mushrooms of universal design

#2 hash functions used in cryptocurrencies like bitcoin, here are just few use cases

essential to blockchain management in cryptocurrency

integrity checks , authentication

#3 collision resistant possibility of two different inputs to a hash function resulting in the same output !

Not sure :sweat_smile: Maybe if there would be a change in consensus for changing the hash function which would result in a hardfork. Other than that hashes don’t really determine where blocks go :stuck_out_tongue:

2 Likes

Very good! :smiley: saying that its a method to chain blocks would be good enough at this point of the course :stuck_out_tongue:

1 Like

Digital signatures in fact use a different function called elliptic curve :slight_smile:

This is not what collision resistance means in terms of hashes. It is the possibility of two different inputs to a hash function resulting in the same output :slight_smile:

2 Likes
  1. Hash function takes a particular input - a message of arbitrary length - and applies a mathematical transformation to form a single output of a fixed length (256 bits in case of Bitcoin). It is a one-way function as you can go from a unique input to a unique output but it is virtually impossible to reverse the process.

  2. In Bitcoin the hash function is used in mining process where it is used to maintain the ledger in a decentralised way. Mining involves the use of computers to run hashing algorithms to process the most recent block, with the information needed in mining found in the block’s header. The cryptocurrency network sets a target value for this hash – the target hash - and miners try to determine what this value is by testing out all possible values. The block header contains the block version number, a timestamp, the hash used in the previous block, the hash of the Merkle Root, the nonce and the target hash. The block is generated by taking the hash of the block contents, adding a random string of numbers (the nonce), and hashing the block again. If the hash meets the requirement of the target, then the block is added to the blockchain. Cycling through solutions in order to guess the nonce is referred to as proof of work. The miner who is able to find the value is awarded the block and paid in cryptocurrency. This mining process of creating a new block occurs on average every 10 mins and this process of mining new bitcoins is really a byproduct of the transaction verification process.

  3. Cryptographic hash functions are collision-resistant one-way functions. One-way functions do not allow to go back to the original message from a given hash value. They are a one-way street. Also it is very unlikely to find two different messages with the same hash, a so-called ā€˜collision’. Theoretically, though, there are collisions as hash functions map an infinite space to a finite space. However, those collisions are extremely hard to find. ā€˜Collision resistance’ refers to this probability. The Bitcoin hash function SHA256, creates a space of 2²⁵⁶ hash values making a collision extremely unlikely. This mining mechanism is fundamentally based on the collision-free and one-way nature of the cryptographic hash function.

1 Like
  1. Hash functions in my own words would be described as a Mathematical equation which serves as the DNA assigned to an output from which input information was originated. the final result of the Hash function, is a Unique ā€œfingerprintā€ assigned to the Input to encode it. In my own words.

  2. Hash functions are used in Cryptocurrencies like Bitcoin to, in the most basic of definitions, is to secure peer to peer transactions by using a digital signature. the digital algorithm used for Bitcoin is SHA-256.

  3. what it means to say Hash functions need to be collision resistant, is… to reduce the possibility of an adversary breaking or attacking, manipulating, duplicating, counterfeiting the underlying asset. again in my own words.

1 Like
  1. Describe hash functions with your own words
    The hash function in the caws of Bitcoin, uses SHA256 to produce alpha numeric 64 bit unique hash (unique fingerprint), that’s directly associated with 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).
    Bitcoin uses SHA256. They are also further hashed in a Merkle tree.

  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).
    When we say the hash is collision resistance, it does not imply that it is not collision resistant; Only that it is hard to find.

1 Like
  1. Hash functions take data input and produce a unique output in the form of a number (sometimes letters are visible in the output, as they represent digits in a higher base.
  2. The ledger is created by hashing blocks of information, and then using that hash to reference the next block, which contains the next set of transactions.
  3. Collisions happen when key values intersect, so to speak, and that key value is then used to reference whatever information that key is a reference to. If ledgers weren’t collision resistant, the ledger would be compromised because you could have more than one hash referencing the same block. The effect of that would allow someone to modify past blocks and transaction history, which would probably be the death of that cryptocurrency.
1 Like