Author

Topic: Can someone thoroughly explain what a SHA-256 function instructs? (Read 876 times)

hero member
Activity: 588
Merit: 500
Will Bitcoin Rise Again to $60,000?
I would recommend watching this video too:

https://www.youtube.com/watch?v=Lx9zgZCMqXE

Really explained well to me how everything with bitcoins work. Smiley
legendary
Activity: 1904
Merit: 1005
PGP ID: 78B7B84D
Great explanation! Thanks so much!
full member
Activity: 238
Merit: 100
Thanks alot for the help. I didn't know this before either and was interested, now I know it clearly and well.

Thanks again Danny!
legendary
Activity: 3472
Merit: 4801
Can someone ELI5 how exactly the function 'hashes' something?

ELY5?

No.

A 5 year old is not capable of understanding SHA-256.

Lets try something a bit less complicated than SHA-256.  We'll call it a "addemup hash".


Start with  some sort of data (perhaps a paragraph from a newspaper article).

Then we assign every character a number, A=1, a=2, B=3, b=4, C=5, c=6, etc.

Now, instead of a paragraph of words, we just have a long string of numbers.

Next step, add up all the numbers.

If the total is more than 1000, then add up all the digits in the total.

If the new total is more than 1000, then add up all the digits in the new total.

Repeat this adding process until the total is less than 1000.

Voila, we now have a "addemup hash" value.  It is guaranteed to be a number between 1 and 1000.

If someone else starts with the exact same paragraph, and follows the exact same rules, they will get the exact same "addemup hash" result.

This way they can check to see if the paragraph has changed at all.  (If I change some of the words in the original paragraph, I'll have a 998 out of 999 chance of getting a different total.  So by checking the "addemup hash" value they can determine if it is likely that the paragraph has changed.

Meanwhile, if I start with an "addemup hash" value of 639, there really isn't any good way of figuring out what the original paragraph was that was used to get that value.

Quickly and easily verified, but nearly impossible to reverse.

Now the "addemup hash" really isn't a very good hash for the purposes of bitcoin.  It has the necessary requirements of being fast and easy to generate, and difficult to reverse, but it is pretty easy for a computer to create a completely different paragraph that has the exact same "addemup hash" value.


The technical details of SHA-256 are more than I'm going to be able to explain to a 5 year old, but the important things to know are that SHA-256 has the added benefit of having more than 100,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 possible values (instead of only 999 possible values).  It also has a benefit of it being nearly impossible with any currently known mathematics to find 2 different starting "paragraphs" that result in the exact same hash value.

legendary
Activity: 1904
Merit: 1005
PGP ID: 78B7B84D
I'm curious, but very new when it comes to cryptography and it's new components. Can someone ELI5 how exactly the function 'hashes' something?
Jump to: