- Hash functions are a secure way of condensing data into a single string of characters of a set length (a hash). This hash (depending on the hashing algorithm) is highly unique and unlikely to result in running into another hash that is exactly the same but derived from a different input. It is also highly improbable to discover the original input data from the output hash.
- Hash functions are used for security. The hashing algorithm in Bitcoin, for example, is used to provide public and private keys for a bitcoin wallet. Hash functions are also used to condense the data of blocks into a single hash in order to reduce the amount of data a node would have to store when running the network.
- Hash functions need to have so many possible outcomes that is highly unlikely that 2 or more inputs would result in the same output hash.
-
Hash functions are a special type of function that gives an unique output for each input, but do not allows anyone to get the input from the output.
-
These type of functions are used in cryptocurrencies in order to encrypt transactions and concatenate the blockchain blocks, and also are used in mining.
-
It means that two different txt lines shouldnât output the same hush.
- Describe hash functions in your own words: a hash function allows to generate a value through a mathematical function that has a different output for good security purposes.
- How are hash functions used in crypto like Bitcoin:
- What does it mean when a hash function is collision resistant?
it means that there can not be two outputs that are identitical (immutability)
- Hash functions are one way functions that gives input text to inreversible unique output.
- They are used in BTC by creating encrypted data in a transaction, on an open ledger, easy to verify.
- Collision resistant means it is statistically unlike to generate the same hash for a different input.
- It is a one way mathematical operation(function) that can give a unique output string to any given input.
- They are used to process new transaction data into the blockchain from mining and provide high security so that the intended recipient is the only person who can access the funds.
- Collision resistant means that it is really hard to get the same output for 2 or more inputs.
Describe hash functions with your own words.
By utilizing the SHA-256 generator, by inputting data it will output a unique output fingerprint. This fingerprint is a cryptographic hash.
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 every aspect of the Bitcoin infrastructure. It is what keeps Bitcoin secure in ever aspect. From generating keys to mining.
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 non- collision resistant Bitcoin would shut down! The whole purpose of utilizing the SHA-256 hash function is that there are no two outputs that are same from one input.
-
Hash functions are a system whereby each unique input gives a unique output that is one way and can never be backtracked upon.
-
Hash functions in Bitcoin are used to securely encode extremely long combinations of numbers and letters into a unified form that is accepted by the blockchain to unlock addresses and gain access securely to stored bitcoin.
-
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 .
1 - Describe hash functions with your own words
A hash function is a type of deterministic one way function that produces the same unique output for any given input. For a hash function suitable for cryptographic purposes, it should not be possible to recreate the input given the output.
2 - How are hash functions used in cryptocurrencies like bitcoin?
Hash functions are used extensively in cryptocurrencies. There are many places where hashes are computed and stored.
Hash functions are used in the mining process to generate a hash from a block header plus seed (nonce) to give a result lower than a particular value (determined by the current difficulty).
Hashes for the previous blockchain state (merkle root) and the hash of the previous block are stored in the new block. This makes it quick to check if the chain is still valid without having to examine all of the previous blocks).
3 - What does it mean when we say that hash functions need to be collision resistant?
The hash function needs to generate a unique output for any given input. If 2 different inputs result in the same output, you would have what we call a hash collision. This would be very problematic for cryptocurrencies in many different ways, essentially undermining the trust that the blockchain is providing. 2 or more people could potentially lay claim to certain transactions or wallets, or funds could end up being duplicated.
Homework on Hash Functions - Questions
- Describe hash functions with your own words
it is where a certain input results in a unique output or fingerprint and any change in the input will result in a very different output - 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 follow transactions in the merkle tree and possibly to protect from douplication with the addition of the time stamp - 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 they are not collision resistant, then falsifying or corrupting the info is possible, It is a security device.Any part of the info that is changed will produce a different UNIQUE output .
69 Replies
Describe hash functions with your own words
A hash function takes an input and converts it to an output.
The output acts as a digital fingerprint of the input.
Changing the input in the slightest will result in a vastly different output.
It works one-way: input is calculated by hash function -> results in output. Someone who has the output would not be able to determine the input (as long as the hashing algorithm is secure).
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 hash pointers to link each block on the blockchain.
Each block has a hash pointer that links it to the 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).
A collision resistant hash function means that, for the most part, an input will give a unique output. For the most part because it is still possible for two different input to hash the same output. It happens rarely but can happen.
Collision resistance is a property of a hash function, that ensures us that it is hard to get the same hash output with 2 different inputs. This means that even a slight changed in the input will give us a completely different output.
An example of a hash function that has this property compromised is MD5
From Wikipedia:
âThe security of the MD5 hash function is severely compromised. A collision attack exists that can find collisions within seconds on a computer with a 2.6 GHz Pentium 4 processorâ
Very nice observation. This is one of the important parts when it comes to hashing a new block. This ensures us that we are truly creating a chain of blocks, which we call blockchain. One small changed in the past will invalidate all the blocks behind it. Pretty powerful.
Hash function canât encrypt, they hash. Hashing and encryption are 2 different things.
It means that we canât find 2 inputs that will generate the same output. It has nothing to do with the size of the input.
Private keys and public keys are not generated using a hash function. In order to create a private key, we would want to generate a sequence of 256 random zeros or ones by some kind of algorithm.
Check: https://www.bitaddress.org/ (Source Code: https://github.com/pointbiz/bitaddress.org)
After we have generated our private key, we use Elliptic Curve Cryptography (ECC) to get the public key of that private key. This process always returns the same public key, provided the same private. After that we hash the public key to get the public address. So there we finally have hashing.
@JovanaGG You were 33% right then.
But we use hashing in mining just like you said.
Just a quick note. Hash functions donât encrypt, they hash. Hashing is a one way function, while encryption is a two way function. Donât worry too much about it, you answers are good.
1. Describe hash functions with your own words
A Hash Function is a mathematical function f(x)=y. Hashing is, when taking an input value of any length and computationally calculated, gives an output a value of fixed length.
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 Hash function which is used for cryptographic purpose, specially in Bitcoin context, the transactions are taken as input and run through a hashing algorithm SHA-256, which gives an output of fixed value.
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 resistance is one important property of cryptographic hash function. This means, It is unrealistic to give two inputs (Y1 & Y2), through hashing algorithm, and produce the same output. In such a way that it is computationally infeasible to find a collision.
Yes, You can check MD5 hash. It has a collision vulnerability.
- Hash functions convert any size input into a fixed length output called hash.
- The hash function takes the transactions value and runs it into a hashing algorithm. SHA256
- A hash function is collision resistant if it is hard to find two inputs that hash to the same output
Hash functions hash. Encryption is different from hashing. We hash the blocks in order to get the unique fingerprint of it.
Yes. But if the chances of the collision is very low in a given function, we can say that we have a collision resistant function. As long as there is no known vulnerability. Sha256 is more secure than MD5. MD5 hash has a collision vulnerability. See: https://www.mscs.dal.ca/~selinger/md5collision/