Everything you always wanted to know about bitcoin hashing, but were afraid to ask. How Can I Buy Bitcoin? Bitcoin transaction hash Does Bitcoin Mining Work? How Do Bitcoin Transactions Work?

How Can I Sell Bitcoin? How Does Blockchain Technology Work? What Can a Blockchain Do? What is a Distributed Ledger? How Do I Use Ethereum? What is a Decentralized Application?

How Do Smart Contracts Work? Anyone with an interest in bitcoin will have heard the phrase ‘cryptographic hash function’ at some time or other. But what exactly does it mean, and how is it connected to cryptocurrency? Hash functions are an essential part of, not only of the bitcoin protocol, but of information security as a whole. In the following article we’ll take a look at some simple examples of how they work, with a simple demonstration, too. In the abstract, a hash function is a mathematical process that takes input data of any size, performs an operation on it, and returns output data of a fixed size. A common use of this kind of hash function is to store passwords.

When you create a user account with any web service which requires a password, the password is run through a hash function, and the hash digest of the message is stored. This means that if a hacker is able to access the database containing the stored hashes, they will not be able to immediately compromise all user accounts because there is no easy way to find the password which produced any given hash. You can experiment with hash values using Python, a programming language installed on Mac and Linux operating systems by default. This will put you into the Python REPL, an environment where you can try out Python commands directly as opposed to writing a programme in a separate file. And press ENTER to see the hash digest of that string.

In the code example above, we’ve already seen that changing a small part of the input for a hash function results in a completely different output. It’s the need for this large amount of processing power that means new bitcoins get mined over a long period of time, not all at once. Any crypto basics you’d like explained next? Interested in offering your expertise or insights to our reporting?