Homework on Hash Functions - Questions

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words.
  • There is no way to reverse a hash function. One can create a output from an input for wouldn’t be able to reverse engineer his way from the output to the input. In other words, if one wants to find the input to an output, he has to guess (brute-force) his way to the answer. With SHA-256 it would literally take forever.
  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).

Hashing is used:

  • to find (mine) new blocks
  • to make merkle trees so a block has a tx root
  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).
  • This means that hash functions may never have two inputs that hash the same output. It is very important that each hash is unique!

1.hash function has two characterestics unique input produce unique output and one way function only.
2.bitcoin transaction are hashed using SHA-256 and new block to be added and all are hashed together.
3. no two different input give the same output

  1. Describe hash functions with your own words? Hash function is a one way function in which each input creates an output or digital fingerprint

  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 in Bitcoin to hash the transaction data, by creating public and private keys and addresses.

  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). Collision resistant means it will be difficult for two inputs to get the same output.

  1. A hash function such as SHA-256 converts a string of text (input data) of any length to a 256 bit hash. No matter what the input is, the output hash will always be 256 bits and is unique to every input. it serves as the digital fingerprint of the input.

  2. Hash functions in Bitcoin are used to write new transactions into the blockchain through the mining process. The input data for the function consists of not-yet confirmed transactions and additional inputs relating to timestamp and reference of previous block. Mining is then the process of trying to solve the hash of the block by combining the input data described above with an arbitrary piece of input data (called a nonce) and running it through the SHA-256 algorithm until the resulting hash starts with a certain amount of zeroes in accordance with the difficulty target. This requires a large amount of computation and is in accordance with the proof of work protocol which states that it must be difficult to solve a block. If the hash is in accordance with the difficulty target, the miners who were responsible for solving the equation are rewarded with bitcoin. The miners are essentially responsible for locking in all the new transactions into the block which can then be added to the blockchain.

  3. Collision resistance is an important property of cryptographic hash functions which refers to the quality of being very difficult to find two inputs which produce the same output hash.

  1. Hash function converts the data in a long new number
  2. All the data in a block goes through a hash function and so it makes a final hash. This hash is then included in the next block, so they are chained together.
  3. It means that two different inputs should not have the same output in a hash function.
  1. Describe hash functions with your own words
    A hash function takes an input string of any length and preforms a math computation resulting in an output of fixed length. The input only data results in an output of a unique address that will always go to that output but can never go back to the input.
  2. How are hash functions used in cryptocurrencies like bitcoin?
    Bitcoin uses the SHA256 hashing algorithm which utilizes proof of work combined with SHA-256 to obtain mathematical traceability and unbreakability. Through the use of bitcoin miners (nodes) hashes are generated in various steps of the Merkal Tree. Hash transactions reach approval by way of proof-of-work that miners complete for compensation.
  3. What does it mean when we say that hash functions need to be collision resistant?
    A hash function H is collision resistant if it is hard to find a pair of m1 and
    m2 with H(m1) = H(m2). This means that in order to keep hash secure there can be no brut force formula that will be able to hack a hash. It would be too hard to reverse engineer a hash for the sake of figuring out how to go from output to input and see input data.
  1. HAsh functions are basically programs that, when applied to an input of data (which can be words/phrases/ or digits) generate a unique output that acts as a fingerprint that represents the data input. HAsh’s are unique to an input and can only be duplicated by that exact input

  2. Perhaps the input is the incoming transaction which is then verified and encrypted with it’s digital fingerprint (hash) that represents all of the data specific to the transaction including origin/ amount/ time pathway

  3. Collision resistant means that you cannot generate two outputs that are the same from two different inputs

  1. Hash functions are essentially encrypting processes which take inputs and generate unique outputs. A hash function is different than a standard mathematical function in that it should be impossible to trace an input based on an output.

  2. Hash functions are central in how new transactions are added to the bitcoin blockchain. I really don’t understand mining quite yet…but essentially the inputs represent the transactions as well as information from previous blocks and the output is what must be solved by miners as part of proof of work.

  3. Given the massive number of possible outputs in a has function like SHA-256, it is extremely unlikely that the hashes of two random inputs will match. Were this not the case the mining process would be problematic.

  1. Describe hash functions with your own words-
    Hash functions are one way functions that give a unique ID/fingerprint from any given 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 used in cryptocurrencies are essentially transaction data that is encrypted so only the next recipient knows its secure. The hash is developed based on the information on the block header

  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 is statistically infeasable and/or nearly impossibly to find two inputs that hash to create the same output. The rare occurrence of this happening would be called a collision; some hash functions were thought to have once been collision resistant however they ended up being broken easier than they thought hence using the term ‘resistant’ instead of ‘proof’

Describe hash functions with your own words

  • Hash function digests an input bit string and outputs a fixed length bit string. SHA-256, for example, will accept any text input and calculates a 256 byte (256 x 8 bits) string.

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

  • Since hash function result is very sensitive to even minor changes in the input, it is a very string proof of originality (the verified input is as it claims it is, not tampered with. Using hash of previous block in the chain as one of the inputs in the current block to produce a hash guarantees that no one can tamper with the block as the chain will suddenly cannot be verified when the input changed just a bit, the hash will vary significantly.

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

  • For any finite space (regardless of how large the space is), two inputs may produce the same hash. However, due to large possibility space, the chance of getting any two inputs with same hash together is very miniscule.
  1. Hash Functions are functions which are one way functions. There is no way to back. Every input has a unique hash function and even a slight change in the input changes hash function completely.

  2. When a transaction is made then the input transaction is converted to a hash via hash function.Miners try to solve the mathematical problem developed with concatenation of Nonce with the input hash. Thus, as soon as the problem is solved, the block is added to blockchain.

  3. Collision Resistant refers that no two same hashes are developed. Thus, to avoid the collision there is a block time of approximately 10 minutes which exists between the blocks.

  1. They allow us to change an input into a an output with a fixed length. This process only works one way, thus encrypting the input.
  2. In bitcoin hash functions are used in the blockchain. Transactions get hashed into blocks and build on top of each other (or in a chain). This way it’s impossible to hack the blockchain.
  3. That means that different inputs should never result in a same hash. This is possible, though very unlikely.
  1. Describe hash functions with your own words?
    A one way function whereby each unique input gives a unique output ie. a digital fingerprint.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    Hash functions are used in Bitcoin 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?
    Two different inputs should not produce the same hash output.

  1. hash functions do not allow us to figure out the input based on the output. They are in that sense one directional functions since they encrypt the initial set of instructions, data or values in a way that going back to the input is nearly impossible.
  2. Hash functions make the bitcoin blockchain much more secure than other functions.
    3.The collision resistant means that even when outputs for different inputs turn out to be the same (this can happen vary seldom) it makes it nearly impossible to find out the original input value.
  1. Describe hash functions with your own words
    Hash functions takes an input and generates unique hexadecimal output which is infeasible to break depending on hashing algorithm.

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

  • Hash functions in bitcoin are used to write new transactions into the blockchain through the mining process. The inputs for the function are all of the most recent, not-yet-confirmed transactions.
  • Through proof of work to successfully solve a block, miners try to combine all of the inputs with their own arbitrary piece of input data (Nonce/ random strings) in such a way that the resulting hash starts with a certain number of zeroes.
  1. What does it mean when we say that hash functions need to be collision resistant?
    It means that two different input values should never result in the same hash output. This property is important in order to ensure data integrity.
  1. Describe hash functions with your own words

Hash Functions are these amazing functions that are basically a one way street for data. Every input has a one of a kind unique output. The slightest change in any input results in a completely different output. Most importantly, if you have the output, there is no way to know what the input was. VERY IMPORTANT.

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

With Bitcoin and SHA 256, a transaction is accepted and is then hashed to consolidate and secure information on the blockchain.

  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 resistance is a very important key to the whole equation. For instance you probably already know someone with the same name or birthday as you. This is great for having fun and celebrating but it is horrible for decentralized platforms and transaction identity. Collision resistance refers to having something more like a fingerprint that sets a hash apart from every other single hash in the entire network.

  1. Hashing functions are when you input numbers/data into the sha-256 algorithm and it outputs a unique fingerprint.

  2. Hashing in bitcoin is used to cryptographically secure transactions and to build blocks.

  3. Collision resistance is one of many properties that are needed in cryptographic hash functions. It means that each input shall have it’s own unique hash.The sha-256 algorithm, used in bitcoin, and is widely used throughout the digital asset space because it is collision-resistant which means the probability of having 2 inputs having the same hash is extremely remote.

  1. a hash function transforms a given data into a hash, hence a chain of characters and numbers. The output hash changes a lot also if you only slightly change the input data.

  2. hash functions (Bitcoin uses the sha-256 hashing algorithm for creating its hashes) are used in different ways in bitcoin:

  • every block contains (next to other informations) the hash of the former block
  • the single hashes of the transactions are being transformed in a single hash: the merkle root hash that will be written in the block these transactions belong to.
  • mining/consensus creation: miners concatenate the hash of the transactions to confirm to random strings (=nonce). This combination results in a hash that, depending on the currently required difficulty, has to begin with a certain numer of “0”. Miners continui trying out random nonces until the moment when the first miner finally finds a final hash beginning with the required amount of zeros.
  • surely there are others
  1. hash functions need to be collision resistant in order to guarantee the reliability of a blockchain. If it would be possible to obtain the same output (=hash) with different input, our hashing function would become useless (at least for important use cases such as bitcoin that NEED to be reliable), as formerly happened to other hashing algorithms sha 1 or md 5.

Answer 1:
A hash function produces a hash which is a unique fingerprint of the given input.

Answer 2:
Each block contain a hash of the previous block, consequently it is linked to the previous block and form a chain that is immutable. To add a block to the chain miners concatenate the hash of a new block with an incrementing nonce in a hash function until a result below the target is reached to get the block accepted by the network.

Answer 3:
Collision resistant hash function, means it is unlikely for 2 different input’s to produce the same output.

1.) A hash function is a function that produces a hash for a given set of data. The hash is essentially a code, or a fingerprint that is unique to the set of data. If any part of the data is changed even slightly, then the resulting hash (fingerprint) is completely different.

2.) In bitcoin, hash functions are used to protect the integrity of the data on each block. Since nothing can be changed without creating a completely different hash, it is easy to verify that the data has not been compromised.

3.) Collision resistant means that it is not likely that there is more than one input that will yield the same output.