That’s it. Each block is backed with a hash that was generated by the miners work. Keep up the great work.
Hi there!! Sorry about the typo. I meant to say when and where. I just want to know how Bitcoin uses the hash functions. Makes sense?
Hash functions hash, they don’t encrypt. All in all great answers. Don’t worry too much about it, its alright to mix these terms up if you are new. Hash functions are one way function and encryption is a two way function.
Thank you for the correction!
No problem James. I am glad I could help you out.
Describe hash functions with your own words.
Hashing takes any string of data and converts it into 256 bits. This process is impossible to reverse and provides a unique identifier for your 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).
Well, one of the first ways is its unique ability to allow for a one way verification throughput to create addresses, verify transactions and securely provide the means to pay. -
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
It simply means that it needs to be resistant to being duplicated for obvious security reasons. With SHA- 256 the the possibility of having 2 of the same outcomes is so extremely unlikely the time times the computational power needed to purposefully achieve that even by brut force is just too small to ever be valid.
- A hash function is a one-way function that that for each unique input gives an unique output.
- In bitcoin hash functions are used for every transaction. The output data is then stored in a block.
- A collision happens when two different inputs generates the same output. A collision resistant hash is when this is very extremely unlikely.
-Hash functions are one-way computational functions, follow certain mathematical algorithm, with any input, get fixed size output.
-Cryptocurrencies like bitcoin, the transactions are taken as an input and run through a hashing function which gives an output of a fixed length.
-Collision resistant means given two different inputs A and B where H (A) and H (B) are their respective hashes, it is near impossible for H (A) to be equal to H (B).
For cryptocurrencies, hash functions have to follow this property. Otherwise the output is not unique.
Correct. You will learn more about this as you go on. But you are on the right track.
- Hash functions encrypt your input data into some kind of random or mathematically calculated output code.
- Basically Bitcoin uses hash functions to encrypt the transaction sensible data.
- Collision resistance is a property of finding or not finding a twin hashes
-
Hash functions are one-way algorithms that convert input of any size into a unique output of a fixed size.
-
One way that hash functions are used in cryptocurrencies is in mining. In mining, the input usually includes unconfirmed transactions, their timestamps, and references to the previous block.Once the inputs are run through the hash function, the outputs are compared to the target output, which starts with a certain number of zeros. Miners add arbitrary data to the input to get the output to start with the required number of zeros in order to solve the hash.
-
Collision resistant means that there is a very low probability that two unique inputs will produce the same output.
Describe hash functions with your own words
A hash function creates an output from an input by applying a mathematical function.
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).
Every time a new block is created within the blockchain the entirety of the previous block plus the new transactions are hashed into the new 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).
Collision resistance is the likelihood of two distinct inputs resulting in the same output (the more complex/longer the hash output the smaller the chance of collision).
Yes, this is the definition of a function, but what about a hash function ? What is the difference from a normal function? (think about input and output)
-
Describe hash functions with your own words
Hash functions are algorithms by which a unique digitized input (a number, a string, etc.) is transformed into a unique output of a fixed-length. In this way, the output is a unique identifier of the input. A useful hash function must also guarantee that inputs cannot be deduced by recording and manipulating the corresponding outputs. -
How are hash functions used in cryptocurrencies like bitcoin?
Hash functions are used to preserve the integrity of transaction data in blockchain cryptocurrencies. With Bitcoin, all transaction data in a block are hashed, and the identifier of each block is a hash based on the transaction hashes and other essential information (the nonce and the hash of the previous block). A slightest change in the transaction data will led to a totally different block ID hash, signalling data tampering. In addition, each block on the chain is linked to its previous block by including the previous block’s ID hash into the ID hash of the block in question. Thus, a change in any transaction data not only alters the ID hash of the block containing the changed data but its effect will show up in the alteration of ID hashes of all subsequent blocks. This makes data tampering extremely hard to conceal in Bitcoin. -
What does it mean when we say that hash functions need to be collision resistant?
Hash collision means that a hash function produces the same output for two different inputs. Collision will happen with all hash functions because there is a limit to the number of possible unique values a hash function can produce but the number of possible inputs is practically limitless. For a hash function to be collision resistant, it must make collisions very difficult to find. Collision resistant is important because data integrity depends on an output being a unique identifier of an input. If it is not the case, hashes may not be reliably revert back to their corresponding inputs, and hackers can exploit the collision to change data without being spotted.
Thanks Mauro makes sense.
Thanks I understand now
Hash functions are a unique digital fingerprint computed by a mathematical equation. You can turn a text of any length into a fixed number sequence called a hash. This hash is unique. Likewise, a hash cannot be computed backwards only computed input to output.
Bitcoin uses the SHA-256 hash function. Hash functions are used to write new transactions into the blockchain through the mining process. Inputs generating a unique hash is crucial to the proof of work process. Hashing also must be efficient and fast.
A collision is when two different inputs create the same output. Collision resistance does not mean that no collisions will exist, only that they are hard to find like on a SHA-256 model as opposed to the broken MD-5 or SHA -1 which have been broken by brute force.
1: A hash function creates a unique output (fingerprint) from the input that is almost impossible to reverse, making it a very secure method of encryption.
2: Hash functions are used by the bitcoin network to validate the data that is being transacted has not been tampered with and is secure. edit
3: Collision resistance means that due to the SHA256 algorithm producing a unique, 1 way function/ fingerprint, it would be almost impossible to match the output to the original input.
Hi @SiBTC I will have to correct you on your second answer public and private keys are not hashes. The private key is a random number and public key is derived from it using elliptic-curve cryptography. However we hash the public key to get the bitcoin address
Hi @Alko89, thanks for pointing this out it seems I have not understood the process properly… I think I get it from your explanation, so the hash function is used to create an address from the public key to allow for a private transaction?