Insights

Learning Crypto

Where do I start?

Comedian John Oliver famously stated:

“Cryptocurrency is everything you don’t understand about money combined with everything you don’t understand about computers”

It can be difficult knowing where to start with your cryptocurrency learning journey as you can approach it from a technical, economic, political and even philosophical view point.

If starting from a technical viewpoint then I usually recommend reading the original white papers of Bitcoin and Ethereum as these paved the way for all the subsequent blockchain / cryptocurrency technology. (See also links at the bottom of this article)

If you don’t have vast knowledge of the computer science domain, reading these papers can sometimes be daunting as you are soon faced with unfamiliar technical concepts and jargon.

It would be difficult to explain all these concepts in this short article, but we can start with the most pervasive piece of technology used which is the hash function.

The hash function is the glue that holds blocks together and ensures that the forgery of coins or balances is just about impossible.

If you search for the definition of a hash function on the web you will probably end up with something like:

“A hash function is any function that can be used to map data of arbitrary size to fixed-size values”

This in itself is probably not that helpful so I will walk you through a working example using your browser so you can see this in action.

There are various online hash calculators, https://xorbin.com/tools/sha256-hash-calculator.

This calculates an SHA-256 hash which is commonly used in Bitcoin and Ethereum.

Here is a screenshot of the page:

unnamed-4-min

If you put some data in the ‘input’ box above and hit the calculate button then you get a hash:

unnamed-6-min

If we add some more data we get a different hash:

unnamed-2-min-1

In both examples above the same input data will always produce the same hash. If you use the online tool and type in the data above exactly as it is (i.e with capitalisation and spaces) then you will get the same result.

If I ‘tamper’ with the data, then I will get a different hash:

unnamed-1-min-1

The original hash was : 

a92b11a66372a0671ee4ab50d46e82de06171ebc0aaeba9f3c3ebbe5742fe798

The hash of the tampered data is : 

6acc45e61ce4487da22b852e36fb7ee34af816f978167814847d7c3d65dc5a32

If I sent you this data along with the hash of it, you would be able to calculate the same hash from the data and verify that I hadn’t messed with it. What we can’t do is easily convert the hash back to the data, as the hash function only operates in one direction. 

In the past, hash functions were used to encrypt passwords – the hash of a password was stored in the database instead of the password itself. However, this is no longer secure as today’s powerful computers can reverse engineer the data from the hash by brute force (i.e by repeatedly attempting to guess the input data that produces the hash) in a much shorter amount of time.

Time is a factor in any secure environment – most methods of security involve some degree of time before you can access secure data.

A good example of this is the 4-digit combination lock I had on my bike when I was younger. If someone wanted to steal my bike, they would have to spend time guessing one of the 9,999 code combinations (the bike thieves tended to prefer other forms of brute force).

In the Proof of Work (PoW) mining algorithm used by the Bitcoin blockchain, the concept of time is used to create transaction blocks.

The Bitcoin protocol states that each block should take around ten minutes to create.

In order to forge a transaction in a previously mined Bitcoin block, you would have to recalculate the block and all of the subsequent blocks, which is virtually impossible.

Using our online hash calculator we can simulate how this works, but first, we need to introduce another computer science term, the nonce.

Nonce in computer science means ’number used once

Each, Bitcoin block has a nonce which has to be guessed. 

In our simplified example, let’s introduce a nonce into the data:

unnamed-5-min

Introducing the nonce changes the hash, but according to Bitcoin protocol, this hash would not be acceptable because it does not begin with one or more leading zeros.

Using the online tool see if you can change the nonce so that the hash that is produced is as follows:

0303aaafba582a99c0c0a92bda7a432a6ba32ae945646843a3e89ca2b2c67975

As a clue, the nonce is less than 20.

You may get this with your first attempt or it may take you several goes.

If I now say that the Bitcoin protocol requires a hash with two preceding zeros, it will take you considerably longer to guess the nonce – I have increased the difficulty of guessing the correct hash value. These leading zeros are known as the ‘hash target’ and at the time of writing, it is around 18 zeroes.

The number of guesses to find a hash that meets the hash target is known as the level of difficulty – click here to see how this has varied over time.

A more technical explanation of how mining and the hash target work can be found here.

To summarise, we’ve learnt a few bits of terminology that will help us navigate the blockchain white papers from a technical viewpoint”

  • Hash: a one-way function that converts a set of data into a fixed-length string
  • Hash target: a hash that has a number of preceding zeros
  • Nonce: a number used once
  • Mining: the process of guessing a nonce to ensure that the block hash meets the hash target.

After reading this, I hope you feel comfortable with these terms and more confident with some of the material in the white papers.

The white papers can be found here – dive in!

Bitcoin: https://www.ussc.gov/sites/default/files/pdf/training/annual-national-training-seminar/2018/Emerging_Tech_Bitcoin_Crypto.pdf

(Note: it is currently removed from Bitcoin.org due to a copywriter dispute with Craig Wright)

Ethereum:

https://Ethereum.org/en/whitepaper/

  • crypto markets

This site uses cookies

We use cookies to improve user experience and analyse website traffic. By clicking “Accept“, you agree to our website’s cookie use as described in our Cookie Policy

Accept