One of the main pillars of cryptocurrencies the world over is that they are trustless systems. What does that mean? It means you don't have to rely on a third party, like a bank, or government, to prove who you or someone else is. How does it do that?
A hash function, a clever bit of cryptography that allows people to be identified, without, well, being identified. We explore this more below.
What is a hash function?
A hash function is a technique whereby any piece of data is converted into a long jumble of letters and numbers in order to conceal the original piece of data. A hash function is special because it will always produce the same jumble of letters for a set piece of data, but if you change any tiny thing in the original source, the jumble will be completely different.
This means hash functions can be used to determine who owns a piece of data without them revealing what the data is. Clever, huh? Think of it as a digital key.
How does the hash function work?
Hashing turns a piece of data into binary code, essentially a bunch of 0s and 1s. Once it's done that, it breaks up the numbers into sections and applies the secret jumbling, also known as a computation function. The end result is typically a 64-digit string of numbers and letters. This 64-digit string is then used in a whole bunch of different ways, which we explore below.
But before that, the 64 digit string is almost impossible to hack. Because the conversion is done by an algorithm, the formula it uses isn't known. To try and hack that would be like trying to navigate a path through a kaleidoscope. However, for pieces of software to read the hash function and check whether it has come from the right place, it's almost instant.
Did you know?
A computer capable of running 15 trillion calculations per second would take almost 0.65 billion billion years to crack the hash of a single Bitcoin address.
What are hash functions used for?
Creating Private and public keys: To send and receive crypto, or carry out a transaction on blockchain, you need a pair of keys. Keys typically come in pairs, private and public. The private key is connected to the public key via a hash function to keep your details safe. You could send your public key to anyone, or have it on a public profile, and no one will be able to work out the private key thanks to the hash function. We've done a whole guide on keys and wallets if you'd like to know more.Did you know?
In 2013, the Bitcoin blockchain accidentally split in two because some miners hadn’t upgraded their software. During this time, double spends were possible.
Did you know?
In October, 2018, the Bitcoin hashrate was 50 Exa hashes per second. This makes the network 15 million times more powerful than the world’s fastest supercomputer, the tianhe-2.
The future
Nothing in computing is unhackable but hashing helps make things fiendishly difficult. Right now, with current computing power, it would take millions of years to hack a hash function. But in future, things like quantum computing could shorten the time it would take significantly. But blockchain builders are aware of what lies on the horizon and are actively building quantum resistant algorithms. But for now, hashing, as it exists today, is here to stay.