- Unique output that depends on input .
- SHA 256 and bitcoin . https://www.youtube.com/watch?v=0rO6KfQq1Rk&list=PL1-2AKkPHc8rUDoz2X6viaRxcMKahQ8gD this video also explains collision and its some way easy to understand .
3.collision resistant means that two input strings of a hash function that produce the same hash result CAN NOT happen . (however it is possible)
-
Hash functions are used to obfuscate inputs in such a way that we can beyond a reasonable doubt say that the input cannot be easily derived from the output.
-
Hash Functions are used to create public/private key pairs, and then are used to create public addresses, and to also ensure that a particular user actually owns the assets they are trying to move.
-
Collision resistance is used to refer to the likelihood that 2 unique inputs, when passed into the same function, will generate the exact same output.
Hash function is a programming function that takes an input and returns a unique output representing that specific input. This output is called hash. Hashing is a one way computation, itās infeasible to find out the input based on the output.
I have read the information in the last reading assignment for hours trying to understand how hashing works, Iām not sure I understand it actually⦠Hopefully, it will be explained well in future lessons. Someone hopefully will correct me if Iām wrong here. In Bitcoin, blocks are being linked together using hashing. Each block takes inputs of hash of the previous block and the block of transactions. Also, Bitcoin uses hashing to link and create private keys and public keys together??? If someone could confirm this for me that would be great. @ivan @Fabrice
Two nonidentical inputs should not produce the same hashed output. So, there should be no collision in the different inputs returning the same output.
Yes, I think you understand it. Hashing is used to make a digital fingerprint of some data. If you would alter only 1 character, the hash would be completely different. Every block on the blockchain gets hashed and every block also contains the hash of the previous block wich makes every block cryptographically linked together. If you would change 1 digit in a transaction in an older block in history, it would change all block hashes in all next blocks. So every block has an unique fingerprint wich must be the same on all nodes in the network, otherwise we would see that someone changed data in the blockchain, and then this node would be dropped from the network because itās ālyingā
Itās also used to calculate public keys from a private key
For example, hashing is also used by password managers ect. If the hash is the same, it means your password is correct, without revealing your real password
Thanks @Fabrice to clearing it up. But now, I donāt understand how someone can change something in the previous block and have an affect on the whole network, or how the whole network decides to ignore that change.
I think this is way too complicated for me at the moment.
Ah, so when I create my password to this site for example, it just hashes that data, and when I log in, the site just checks the hash output to let me enter my account?
To change data in a block would require alter the information of the blockchain on your local full node, but then all other nodes would immediately see that your blockchain is not the same as all other honest nodes. You could theoretically achieve it in a valid way by re-mining those blocks (51%attack) wich you will learn later in the course.
I donāt know how passwords are managed on this site
I see. Thank you so much for taking the time to answer. It really helped me understanding more.
-
Hash function transform data (input) into a unique digital fingerprint (output). The special thing about the hash function is that if you change the input just a little bit, it immediately gives a complete new output.
-
In BTC the hash function principle works like this, the inputs are new non verified transactions which are checked by mining (hashing) and which comes out as confirmed transactions as output.
-
Collision resistant means that it should be (almost) impossible that multiple inputs come out as the same output through hashing.
-
One-way-calculations of data into a fixed-length output.
-
Public keys, private keys, block signatures,ā¦
-
There should not be a chance for 2 different inputs to have the same output. If they do, thatās a collission.
Homework on Hash Functions - Questions
- Describe hash functions with your own words
Answer: Hash functions are when you provide certain information into the input portion of the equation and you get a digitalized footprint.
- 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).
Answer: Hash functions for Bitcoin use SHA - 256 which means that no matter how much information you put into the Bitcoin cryptocurrency hash, you will get a finite amount of information which is 256 bits.
- 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).
Answer: What it means is that when you put information into the input using two different entries and it produces the same output, you have a collision. This is can not happen with the Bitcoin SCH - 256 hash protocol.
-
A hash function creates a uniqe output from any input. The function is one way only, meaning that it is almost impossible to reverse engineer the process. You can not determine the input from knowing the output. Although same input will always result in the same output.
-
Every block created contains hashed information from the previous block, and the previous block contains information from the one before that. Since the slightest change in any hash will produce a new totally different hash, it will also alter the information in all previous blocks, which will be almost impossible.
-
It means that the probability for two hash functions to result in the same output is theoretically possible but not likely.
- Describe hash functions with your own words: Hash functions take a unique input and produce a unique output whereby the input cannot be ascertained from the 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). Hash functions are used to encrypt the data in the transactions and to provide pointers to old blocks from new blocks. Hash functions are used also, in specific ways, to make miners compete for the incentive (bitcoin) received when they get to add the block and get paid. (I have a few questions on how this all fits together).
- 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 means that the hash function will not produce the same hash for different inputs; this is not likely, though potentially possible. Collisions are thwarted through use of the minerās equation that determines the ādifficultyā of the hash, which determines how hard it is to find the right match to win the āblockā. Also this difficulty is changed depending on the hash rate (how many miners are mining).
-
Has function takes some data (input) does the hash function i.e. SHA256, and outputs a unique āfingerprintā for the original input.
-
Found a concise description on how hash functions are used in bitcoin, link is https://www.mycryptopedia.com/sha-256-related-bitcoin/ . In summary hash function used during mining process (construction of candidate block makes use of double SHA-256) and when creating a new bitcoin address, hash used when generating the public key.
-
Collision resistant; When 2 different inputs are independently hashed if the resulting hashes are the same we would have a ācollisionā. Not good. To avoid this the hash function used needs to be suitably long/complex.
- taking an input string of any length and giving out an output of a fixed length. sha 256
- hashing means taking an input string of any length and giving out an output of a fixed length. In the context of bitcoin, the transactions are taken as input and run through a **hashing algorithm.
3.Collision resistant means this : when it is hard to find two inputs that hash to the same output.
-
Describe hash functions with your own words
Ans.
Takes input characters and converts them into an output of a fixed size. -
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).
Ans.
Bitcoin uses the SHA-256 which is the āblock hashing algorithmā which is used to write new transactions into the blockchain through the mining process. Generating a SHA-256 hash with a value less than the current target difficulty solves a block and generates bitcoins for the miner. -
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).
Ans.
Collision resistant is one of the 6 properties necessary a cryptographic hash function needs to have in order to be considered secure. What that means is that for the most part, each input will have its own unique hash.
-
A hash function is an algorithm that converts a variable length message into a fixed length output.
-
Miners offer computational power to help the Bitcoin network verify transactions. The computational power is used to perform hash functions repeatedly until an acceptable solution is found.
-
There has to be a very small chance that two different messages produce the same hash output. If the message āI owe you $100ā and āI owe you $1000ā produced the same hash value that could cause problems for the Bitcoin network.
- They take a digital medium and output a unique digital fingerprint that no other digital medium can have unless its the same.
- In mining blocks and verifying transactions between nodes.
-
Hash Functions are a unique input that produces a unique output a fingerprint per say.
-
Hash Functions in cryptocurrencies are basically used to produce a unique address and amount of a wire transfer.
-
Collision in this case means when 2 miners come up with the same block simultaneously. The system prevents this from occurring, by increasing or decreasing miners. Thus making it collision free!
Homework on Hash Functions - Questions
- Describe hash functions with your own words
Hash Function is a algorithmic function that generates an output with a fixed lenght. This output is unique and determined from that unique input while it is infeasable deducing the input from the output. - Bitcoin used encrypted hash function - cryptography which means that on top of all the properties of a hash function (deterministic, quick computation, pre-image resistance, collision resistance and puzzle-friendly) Bitcoin requires that the inputs are encrypted before the hash function and de-encrypted after that.
-
Collision Resistant There is always a chance that you can have the same output from different combination of inputs and this happens because you have infinite inputs of an infinite variety of lengh and an output which has a fixed lenght.
A hash function is resistant at collision until someone does not find a collision.
- Describe hash functions with your own words.
Hash function gives a unique fingerprint to the input. This fingerprint (output) is secured in a way that you cannot know what is the input if only what you have is output data.
- 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 function in Bitcoin: Inputs are specific number of not-yet-confirmed transactions (does not mater how big it is) and output hash from previous block which are going trough function so that all you get is fixed lenght data (Output).
- 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: It means that it must be hard to find two inputs that hash the same output.