Back to the Old West: Hashing and Mining in Cryptocurrency
By Tokenfolio on Altcoin Academy
Today we are going to focus on two new elements of cryptocurrency. Even though hashing and mining sound more like actions out of a Western, they are essential to understanding this wild new frontier in human history.
But first, to understand hashing, we need to go back to encryption. For most of human history, securing information was done by scrambling letters and words according to a given key. (A=1, B=2, etc) Think of it like translating a document into another language.
But if an outsider knows the encryption key — in this case, French — your document can be read and therefore isn’t secure.
So the modern world has turned to hashing.
Where encryption is like translating into another language, hashing is like putting your document through a shredder. Your document goes in, and something completely different comes out.
With the SHA-256 hash function, your information goes in, and a unique string of 256 letters and numbers comes out. This is why your login information is safe in this world of password protection — when you set up a new account or update your password, the site isn’t saving your password, it’s saving the hash of your password.
Your password might be R2D2swears!, but feeding that password through the shredder gives the site a string of meaningless letters and numbers.
That’s why getting one element wrong in your password is such a big deal for the system. The hash of R2D2swears! might be the Sdkd, but when you enter R2D2Swears!, the server compares that 092j hash to the Sdkd hash it has on record, and they don’t match.
This is why most of the world’s information is secured using hashes: every hash is as unique as its input. And this kind of digital fingerprint works with inputs of every size. I could feed my 2005 Merriam-Webster Dictionary, with its two torn pages and the coffee stain on the cover, into this shredder, and I’d still get a unique 256-character hash.
Looking at that string of letters and numbers, you would never know it was originally my roughed-up, well-loved dictionary. It could be state secrets, passwords, a wire transfer, or a meme from 2010 — you don’t know, and there’s no way for you to tell. That hash cannot be translated, decrypted, or reverse-engineered back into my dictionary.
So in the context of cryptocurrency, when someone makes an exchange or purchase, that purchase information is fed through the shredder, and the resulting hash is sent out into the ether.
But how do you know which hashes are information, which are spam transactions, and which are valid trades?
This is where mining comes in.
Let’s think back to the Gold Rush. People knew there was gold out West, but they knew it would take time, work, and strategy to uncover the gold nuggets themselves. Mining for bitcoins is an exhaustive set of calculations much like panning, and as in the Old West, it’s the best, the fastest, and the luckiest that strike gold.
Imagine a classic saloon. Six cryptocurrency miners sit around a poker table betting their time, software, and hardware investment against everyone else’s. Because whoever confirms a transaction first gets the bounty — the reward for adding a valid transaction to the blockchain.
But how does the mining itself work? To be frank, it comes down to a lot of educated guesswork. Because a hash cannot be decrypted or reverse-engineered, miners have to run a lot of information through their software, run that output through the SHA-256 hash function, and hopefully hit the target hash.
To quote a brilliant man, “It’s like jumping from a moving car, off a bridge, and into your shot glass.” And it’s worth trying, for the reward money alone.
The cryptocurrency system remains stable and secure through all of this because it is automated to be government, bank, and sheriff all in one. It 1) rewards a set amount of new bitcoins for every successful addition, 2) adjusts the bitcoin amount every 4 years to maintain inflation, and 3) makes the math problems proposed to miners harder according to how fast they’re being solved. This keeps the network stable, secure, and continually improving, and it encourages more and more people to pool resources and get into mining — improving the security of the network exponentially.
For more on the wild world of cryptocurrency, follow Tokenfolio, your easy-to-use portfolio manager, on Instagram, Twitter, and Facebook.
Stay cool!