Bitcoin Forum
October 24, 2018, 12:10:19 AM
 News: Make sure you are not using versions of Bitcoin Core other than 0.17.0 [Torrent], 0.16.3, 0.15.2, or 0.14.3. More info.
 Home Help Search Donate Login Register
 Pages: [1]
 Author Topic: 'Hash function' explained simply for Beginners ( + Hash calculator)  (Read 59 times)
vphasitha01
Full Member

Offline

Activity: 168
Merit: 163

 July 06, 2018, 04:09:44 PM

Hash

Every block in a block chain has a hash. It's like a finger print. We can say cryptographic hash is like a signature for a text or data file. It identify the block and all it's content and it's always unique just as like fingerprint. Once a block is created it's hash is calculated. Changing something(data) inside the block will cause hash to change, in other other words we can say hashes are very useful when you want to detect changes in the block.

Hashing function

I think it's the most important mathematical operation used in Bitcoin network. It needs for proof of work. We can say it's some kind of mathematical transformation of data. We can select some inputs and transform those inputs into a 64 characters long number. In fact some of them are letters and numerical digits in hexadecimal[1]. We can input limitless inputs through this mathematical system and can get a output number ( 64 characters long). If we even change small thing, just imagine changing one lowercase in to upper case in a single character in a input, it will ultimately change the whole output number completely. So no one can predict the output from what the given in input.

SHA-256

SHA(Secure Hash Algorithm) is one of a cryptographic hash functions which known as one of the strongest hash functions available. SHA-256 algorithm generates an almost unique, fixed size 256 bit hash. We can call hash as one way function so it cannot be decrypted back. Therefore it's more suitable for password validation, anti-tamper, digital signatures.

SHA-256 Calculator

This is the link >>> "+++hash calculator+++".

Just type whatever you like. So I will type my Bitcointalk username as "vphasitha01" and you can see the resulting hash at the bottom.

If I change one lowercase character ( say "v") into a uppercase character (say"V"), the resulting hash changes completely and just has no resemblance to what happens before.

So let's put some Bitcoin transactions as follows,

Code:
James ->5btc for Alex
Hari ->0.5 btc for Devon
Clair ->1.256 btc Jack

and below that we can input some random number, nonsense number. In fact in Bitcoin network we called as "nonce".

Then we change this number with objective to get the output hash starting with zero. So keep changing until we get the starting number as zero. So using this "nonce" we can able to get hash which stats from zero.

This is actually what Bitcoin miners are doing. They are trying to take their transactions and tries to find the right "nonce". So with those transactions they gets the hash which starts with zeros. In Bitcoin case it's more than one zero it's something like 19 zeros as time of writing. So it will take very long time to even for few zeros. 19 zeros? You will never would be able to do it by your own. There are special hardwares to do this process quickly called as "ASICs" (Application Specific Integrated Circuit chips).

Bitcoin network is calibrated to only miner within the span of ten minutes will be able to find the right hashes with 19 zeros. That gives them the ability to announce their transactions with reference to the Bitcoin network. They actually packaged them into a block with the "nonce" and sent it out to across the network. All the other miners verify for himself. So transaction is valid and has a appropriate hash and add up that block to the chain of blocks to the block chain and that's how blocks grows in the network. This is known as " Proof of Work" ,they proving that doing some work to create a block which leads to consensus.

[1] - It uses sixteen distinct symbols,most often the symbols 0-9 to represent the values zero to nine, and A-F to represent values ten to fifteen.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1540339819
Hero Member

Offline

Posts: 1540339819

Ignore
 1540339819

1540339819
 Report to moderator
pooya87
Legendary

Offline

Activity: 1428
Merit: 1206

Buy bitcoin they said... who listened?

 July 07, 2018, 04:01:37 AM