Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
  • It is a digital fingerprint to a set of unique characters
  1. How are hash functions used in cryptocurrencies like bitcoin?
  • Whenever a new block arrives, all the contents of the blocks are first hashed this means they’re uniquely identified. If the hash is lesser than the difficulty target, then it is added to the blockchain and everyone in the community acknowledges the new block.
  1. What does it mean when we say that hash functions need to be collision resistant?
  • Given two different inputs A and B where H(A) and H(B) are their respective hashes, it is infeasible for H(A) to be equal to H(B). What that means is that for the most part, each input will have its own unique hash. In short two different inputs will resist a collision by having different Hashs
2 Likes

Hash functions have features that secure for instance Bitcoin. A hash function always gives the same output when the input is unchanged. Change the input even a little and the output changes. Hash functions are irreversible. You can’t deduce the input from the output. It would take a very long time of brute-force trial and error to find the input.

Hash functions secure the network and each Bitcoin by making it infeasible to uncover private keys of Bitcoin holders. Secure Hash Algorithm-256 is used as the Proof Of Work algorithm in Bitcoin mining.

Theoretically two different inputs can result in the same output. Because of collision resistance it will take an astronomically long time to find to distinct inputs, messages, that give the same output.

1 Like
  1. It’s a one-way function input to output. When an input is given it relays an output (using a string of numbers containing 0-9 and Letters A-F) which is unique to the input and any slight change to the input alters the output.

  2. In the Bitcoin protocol, hash functions are a part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining process.

  3. Each input will have it’s own unique digest (output) meaning that no other input will be the same even with a slight change to an input, the output will be totally different . No 2 inputs will have the same output.

1 Like
  1. Hash functions are functions that take one input and generate a random output, in a manner than cannot be reverse engineered to use the output to generate the input.
  2. Hash functions are used in many layers in cryptocurrencies to compound hash data in every block that is mined. These layers include previous block hashes, timestamps, transaction roots and the hashes belonging to them, and nonce, and then the new block itself also receives a hash which will be used to connect to the next block that will be mined.
  3. Hash functions need to be collision resistant, meaning there should not be multiple inputs that can be hashed to produce the identical output to one another. Every input should have a unique output otherwise it opens doors for attack vectors.
1 Like
  1. Hash functions are bits of code utilizing numbers and letters in regards to SHA 256 that help to keep bitcoin transactions secure.

  2. Hash functions in regards to bitcoin helps to deter hackers from invading the blockchain by quickly invalidating blocks of data as soon as a hacker attacks the network.

  3. A collision would occur in hashing when multiple inputs render the same outputs, this is very unlikely to happen, however not impossible.

2 Likes
  1. Describe hash functions with your own words.

  2. It is a reconfiguration of data using the SHA-256 protocol that not only encodes the date into the binary and hex format but it also changes the output if it is cracked and anything is altered.

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

  4. A cryptographic hash function (CHF) is a mathematical algorithm that maps data of arbitrary size (often called the “message”) to a bit array of a fixed size (the “hash value”, “hash”, or “message digest”). It is a one-way function, that is, a function which is practically infeasible to invert.[1] Ideally, the only way to find a message that produces a given hash is to attempt a brute-force search of possible inputs to see if they produce a match, or use a rainbow table of matched hashes. Cryptographic hash functions are a basic tool of modern cryptography.[2] *SOURCE - https://en.wikipedia.org/wiki/Cryptographic_hash_function

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

  6. It means that they shouldn’t be able to map to the same output but it is possible so using SHA-256 guards against collisions with the same output of the hash function. Or something. :slight_smile:

1 Like

Do you know a practical example how this is used in Bitcoin? :wink:

An easier explanation would be that collision resistance means the probability of two inputs resulting in the same output. :slight_smile:

1 Like
  1. Describe hash functions with your own words
    A hash function is a function that takes a unique input of any length and generates a unique corresponding fixed-length output for that input.

  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?
    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 where a ≠ b but H(a) = H(b).

1 Like
  1. Hash function are one way functions that gives a unique output for each input given. It is one way because you cannot determine inputs from a given output.
  2. Hash functions are used in crypto by being a data integrity check system, validating transaction security, making the system trustless but dependent on proof.
  3. Collision resistant means that given any two inputs the same output is extremely unlikely and infeasible to determine.
1 Like
  1. Hash functions for each unique input produce a unique output.
    It is a one way function - you can go from input to output, but you can never go from output to input.

  2. The way hash functions are used in bitcoin is:

  • The hash of the contents of the new block is taken.
  • A nonce (random string) is appended to the hash.
  • The new string is hashed again.
  • The final hash is then compared to the difficulty level and seen whether it’s actually less than that or not.
  • If not, then the nonce is changed and the process repeats again.
  • If yes, then the block is added to the chain and the public ledger is updated and alerted of the addition.
  • The miners responsible for this are rewarded with bitcoins.
  1. Hash function being collision resistant means that given two different inputs A and B where H(A) and H(B) are their respective hashes, it is infeasible for H(A) to be equal to H(B). What that means is that for the most part, each input will have its own unique hash.
1 Like
  1. A function that has a unique input and unique output that you can only go from input to output, never output to input.
  2. When you transfer/ or buy crypto currency you are given a code or hash function at the point of transaction.
  3. It would be very hard( not impossible) to find two inputs that hash the same output is collision resistant.
1 Like
  1. Hash Functions is the conversion of a string of data of any size, this is one directional. Each unique input will give a unique Output.

  2. Hash Functions are used in Cryptocurrencies like BTC for the purpose of linking the blocks of data together. The hash of the previous block is included in the current block, linking all historical blocks and their transactions together.

  3. Collision Resistant Hash is extremely unlikely for the hash result to be the same for two different inputs.

1 Like
  1. Describe hash functions with your own words
    It is a function to create a uniques digits so that you can verify that it has not been changed.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    It is used to connect each blocks by having the hash of previous block as a part of input.

  3. What does it mean when we say that hash functions need to be collision resistant?
    Collision resistance is the property of a hash function that it is computationally infeasible to find two colliding inputs.

1 Like
  1. Describe hash functions with your own words

A hash function is an output of a function, in which data is entered, read as binary & applied to an algorithmic code. This results in an encrypted data 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).

A purpose of a hash function is to take an input and apply layers of complexity upon the input data such that the output looks like a random or meaningless string of data. This is called encrypting and used to secure the data against being cracked or illicitly altered.

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

Collision resistant means that no two inputs on the same function will yield the same output.

1 Like
  • hash functions are a mathematical way to write an input and see a cryptographical result. you can’t know what was the input starting from the output

  • are used to have a cryptographical fingerprint of a recovery phrase

  • it means that the hash function won’t be able to have the same output from 2 different input

1 Like
  1. a hash function is a cryptographic function that receives an input and produces a unique output. Something like DNA that uniquely identifies the input.

  2. A single block will hash many different values. The top most has is created from a block header that contains:

  • Version: The block version number.
  • Time: the current timestamp.
  • The current difficulty target. (More on this later).
  • Hash of the previous block.
  • Nonce (more on this later).
  • Hash of the Merkle Root.

The Merkle Root Hash is comprised of a binary tree of hashes built from all of the transactions in the block. A block can contain thousands of transactions. Thus a single block would contains thousands of hashes.

  1. A collision is when two different inputs produce the same output from a particular hash function. The SHA-256 outputs a 256 bit output and will rarely (OK very close to never but not quite never) output the same hash for two different inputs.
1 Like
  • Describe hash functions with your own words
    Hash function is a fingerprint of a dataset.
  • 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 fingerprint a block, if the hash output of a block meets a certain criteria it can be added to the chain.
  • 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 a hash function returns the same result for more than one dataset, that is a collision. If there are too many collisions, the hash function is less useful because the possibility of tampering with data increases.
1 Like
  • Describe hash functions with your own words
    Hash function is a a one way function that when it receives an input it will return an output. But when given an output it is unfeasible to get the input.

  • 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 a blockchain, chain of blocks, each block consists of:

  1. Header
  2. Hash of Previous Header
  3. Markle Root (here the data is organized in a tree, where data is hashed and the results are hashed again, following branches)
    It has a hash pointer to te previous block and a hash of the data of previous block.
  • 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 occasionally it is possible to obtain 2 hash numbers that are the same, when using SHA-256 since the probability of this occurring is very low it is safe to asume F(A)=F(B), A=B
1 Like
  1. Describe hash functions with your own words
  • Hash functions can create a unique string of data (input) and transform it (encrypt) into a unique string of alphanumeric values as your Output. Since you can only go from input to output and never output to input it makes this hash function impossible to hack.
  1. How are hash functions used in cryptocurrencies like bitcoin?
  • Hashing keeps Bitcoin secure by using SHA-256 which makes it impossible to hack after 10 confirmed blocks.
  1. What does it mean when we say that hash functions need to be collision resistant?
  • It means that the input and output can never be the same. Each input and output is unique to its own.
1 Like
  1. Describe hash functions with your own words.
    A: Hash functions seek to create security and functionality of data and data transmission by creating a unique fingerprint (output), for every specific input. If one changes any little bit of the input, the output changes as well to form and new, unique output for that new input. This is how you can ensure data integrity.

  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).
    A: Bitcoin is a ledger of hashes that uses proof of work (PoW) through mining, combined with the SHA-256 hash algorithm to create traceability and security for its transactions over its blockchain. Mining are required to solve a problem with a known, partial input that comes from the latest/most recent state of the blockchain to create a hash target. The miners must try to guess the digital input that can create the hash target, thus solving the 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).
    A: This is the concept that is in favor of the difficulty in finding two inputs that hash to the same output.

1 Like