Homework on Hash Functions - Questions

  1. Secure way to transmit a message or data to an output with a unique fingerprint
  2. Each block contains data and its unique fingerprint and via pointers and links of the previous block.
  3. That each input is supposed to have it’s own unique hash and it’s statistically highly improbable that two inputs will generate the same hash.
1 Like

1 Describe hash functions with your own words

Hash function is your digital footprint, which uses mathematical formulas to create an identity for the products or services you’re trying to build

2 How are hash functions used in cryptocurrencies like bitcoin?

By inserting letters and numbers it creates a unique output that encrypts the currency or product or services that your creating which is very very valuable especially when your building currency/products/services or anything of value.

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

Means that it’s very difficult to find a colliding pair of outputs from the hash function, but it is possible for the collision but it should take an astronomical time before it happens

1 Like

Hash functions create unique, “digital fingerprint” outputs.

Using hash functions protects Bitcoin from attempted alteration of transactions on the blockchain.

Collision resistance is implemented by only allowing one hash function per every 10 minutes.

You can make as many hashes in a time period as you want. In fact if you check the current hash rate of Bitcoin, atm 141 EH/s (exa hashes per second) it means the network calculates about 140 * 10^18 hashes per second!
Collision resistance merely means the probability of two inputs resulting in the same hashed output. :slight_smile:

1 Like
  1. Work as a unique digital fingerprints of an input value.

  2. The hash of a previous block in a sequence is a tamper-proof sequence because as a function of the design, a hash is very sensitive. To change any variable of any one of the hashes in a given block would cause a domino effect, subsequently altering all of the previous transactions in the block.

  3. Basically, that two distinct pieces of data shouldn’t collide by having the same hash value and thereby compromise security in the case of cryptocurrencies.

1 Like

Hashing is generating a value from a string of text using a mathematical function.
In Bitcoin is called SHA-256 and it converts text of any length into a fixed-size string of 256 bits (32 bytes)

Originally published in 2001, SHA-256 was developed by the US Government’s National Security Agency (NSA).It is commonly used in SSL certificates for websites and in the DKIM message signing standard for email clients.

Cyptophracically speaking a hash function is considered secure if meets some properties
deterministic (input will always be the same),
one way function (no way to reverse it) quick and easy to produce (any ordinary computer can do it) collision resistant (different outputs)
puzzle friendly

SHA-256 hashing algorithm is an integral part of the Bitcoin protocol.
It has seen implementation in varying facets of the technology such as:
bitcoin mining, merkle trees and the creation of Bitcoin addresses.

“SHA-256 is very strong. It’s not like the incremental step from MD5 to SHA1.
It can last several decades unless there’s some massive breakthrough attack.
If SHA-256 became completely broken, I think we could come to some agreement about what the honest block chain was before the trouble started, lock that in and continue from there with a new hash function.” (Satoshi)

1 Like

What is the collision resistance property of hash functions?

1 Like
  1. A hash function is a function that, given an imput, gives as output a unique 256bit exadecimal string. The same imput will give the exact same output, but a slight, insignificant modification in input(such as tha case of a letter = a/A or a space or a comma) will give a complete different output. For the moment there is no way to find input starting from output

2.Hash function are used to concatenate blocks and to store data inside the blocks. Every transaction it is hashed and stored in the block. Then all data in the block are hashed toghether and stored in the next block. This leads to immutability and security.
To have a proper hash in btc to validatea block, the hash have to start with a certain amount of zeroes. For doing that miners have to combine data in order to satisfy the condition. Whan the mining difficulty increases is because another zero was added as a condition for mining.
3. Collision resistant means that it is really hard to find two different inputs that give the same output as hash string

1 Like
  1. Hash functions have a unique fixed length output for every unique arbitrary length input.

2.Hash functions are used in bitcoin by giving a unique address for every transaction. Bitcoin public and private keys are also a hash function.

  1. Collision resistant hash functions are ones that a very difficult or practically impossible to identify an identical output with two distinct inputs.
1 Like
  1. Describe hash functions with your own words Has functions are unique bits of code that are created from inputs. If any slight bit of information changes in the code the hash number also changes.
  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 mathematical operations run on digital data bases. SHA256 is used in Bitcoin as it is infeasible anyone will be able to guess any of the codes and also can only go from input to output.
  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). They need to be collision resistant because no two inputs and have the same output. Cryptographic has functions are designed to be collision resistant.
  1. Hash function is a function that takes an input and gives a unique output for the particular input. it is on way function.
  2. Hash Functions play big role in cryptocurrencies, hash function has been a fundamental to blockchain technology. for instance in bitcoin, the blockchain is a linked list that contains data and a hash pointer that points to its previous block. The hash pointer contains the address of the previous block and not only points to the previous block it also contain the hash of the data of the previous block. imagine if you try to make some change in a single block and this small change will affect the whole chain, which is impossible. That is how a blockchain attain the immutability.
  3. It means for a unique input must have a unique output like a digital finger prints.
4 Likes

Hash functions are never collision resistant, but the larger the range is for the output, the less likely you can have a collision. If a certain hash function has only a 2 digit output, you would find a collision very quickly. The output of a Sha256 hash is 256bits long or 64 hexadecimal characters. This is a very large range of possible outcomes that finding a collision is very unlikely, but not impossible

1 Like
  1. Hash function is a computation using a hashing algorithm like SHA-256, where a unique input is entered and a unique output is generated. The direction is only input to output and cannot go from output to input. The output length is a fixed length

  2. Miners run a series of SHA-256 functions to create the hash of a block. The hash gets a timestamp.

When the nodes reach consensus, the block is added to the blockchain. The block has its own hash and the hash of the previous block and chains them together. It is not possible to change a block due to the avalanche effect, they would need to change every consecutive block as well.

  1. Collision resistance means that it will be very difficult, but not impossible to find two different inputs that result in the same hash. This means that the hash function is second pre-image resistant.
1 Like

1.A hash function takes any input data and converts it into a digital fingerprint for that input.

2.Hash function used in bitcoin for mining, tranactions, for private keys and public keys.

3.Collision resistant means that any input data cannot be the same as the output data.

1 Like
  1. Describe hash functions with your own words

a hash function is a function that takes an input produces a fixed-length 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).

they are used to pass information from one block to another in a secure way, and in a way that can be checked without exposing the private keys (via signing)

  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 the hash of a value (A) should never be equal to the hash of another value (B), or at least that the probability is so low as to be the equivalent of impossible

1 Like
  1. Hash functions implement algorithms that convert each different input they are given into a unique output, like a digital fingerprint. All outputs of a hash function have the same length, regardless of each input’s length. Hash functions are not reversible, meaning that it is impossible to uncover the input by using its output. Additionally, each slight change in an input of a hash function results in major changes in its output.

  2. Cryptocurrencies like Bitcoin are a sequence of blocks that contain and store the data of all transactions that were executed on their respective blockchain. Each block stores the hashes of the transaction data that was validated with that block and the hash of the data of the previous block. Using hash functions, these cryptocurrencies store all transaction data in a simplified, immutable and secure way.

  3. A hash function is collision resistant when it is safe to assume that two different inputs will not return an equal output, or that given two outputs that are equal their inputs are the same. It is an assumption and not an absolute certainty due to the fact that, although there are many, many different possible outputs for a hash function (2^256 for SHA 256), they are a finite number, and its possible inputs are infinite, making it impossible to guarantee absolute uniqueness of every single output for every single possible input. To illustrate with two hash outputs H(A) and H(B), and their respective inputs A and B, with a collision resistant hash function H(x) it is “statistically safe” to assume that:

    1. If A != B then H(A) != H(B)
    2. If H(A) = H(B) then A = B
1 Like

Public keys are derived using the elliptic curve function. :slight_smile:

1 Like

1.- Describe hash functions with your own words
1.R A has functions convert any input data in a 256 bits hexadecimal number of 64 digits output.

2.- How are hash functions used in cryptocurrencies like bitcoin?
2R. 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?
3R. 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 ab but H ( a ) = H ( b ).
The pigeonhole principle means: that any hash function with more inputs than outputs will necessarily have such collisions; the harder they are to find, the more cryptographically secure the hash function is.

1 Like
  1. Input data and output something unique.
  2. It’s used as a security layer.
  3. It must hard to collide or take a very long time to.
1 Like
  1. A hash function is a function that takes an input and runs it through an algorithm to create a unique output to that input specifically

  2. Hash functions are used in bitcoin by representing the transactions with hashes and linking those hashes together in blocks so that if any transaction is tampered with then all other blocks are changed and therefore exposing the altered data.

  3. Collision resistant means that all hashes need to be unique to a specific input and not generate the same hash for different inputs

1 Like