What is BlockChain? – Part 1 – The Building Blocks

Posted: August 9, 2016 in Work Stuff

BlockChain is the new must use buzzword in technology and it claims to provide the capability for building trust between disparate and non connected systems.

This post is based on the presentation I wrote to explain the potential of BlockChain for my employer.

So what is BlockChain, where did it come from and why the sudden interest?

Why?

The sudden interest comes from the fact that in theory a BlockChain allows for a trusted, accessible, permanent, encrypted, distributed record that is almost impossible to modify. It allows two parties to perform transactions without the need for a trusted third party – something that can add both costs and complexity to the original transaction.

BlockChain is being used for everything from currency and diamond registry through to medical record management and music rights control. Large scale schemes such as welfare payment control are being investigated by the UK government.

Where?

BlockChain is the underlying technology for a virtual currency called BitCoin. As a technology used for the manipulation of funds, it has to be transparent, reliable and secure. While BitCoin initially suffered from bad press relating to its association with criminal organisations (Silk Road) and the high profile failure of businesses (Mt Gox), it is now established as a true virtual currency.

What?

At its most basic BlockChain is the combination of four current technologies in a new and unique way:

  • Asymmetric encryption (A.K.A. Public Key Encryption)
  • Hashing
  • Peer to peer networks
  • Consensus

Asymmetric Encryption

Public key encryption uses two keys to protect content.

One key is Private and is held ONLY by the user, the other key is Public and is available to everyone. These two keys are created together at the same time and are a mathematical pair – they will only work together.

If I want to send a message to someone, I use their public key to ‘sign’ the message. Signing the message effectively encrypts it so that only the private key can open it. Any attempt to change the message will change it and will result in the private key not opening it. The inability to open it implicitly implies tampering has occurred.

Software such as Pretty Good Privacy (PGP) made this incredibly complex topic easy for everyone to use, much to the horror of law enforcement agencies worldwide. At one point the PGP software was classed as a weapon and placed on a restricted list limiting it’s availability outside of the US!

Hashing

Cryptographic hashing converts a value of variable length into an alphanumeric string of fixed length. Hashes are a ONE WAY function – you can’t take a hash and find out the original value. Hashes are also very quick to calculate with the ability to do so available in all programming languages.

The specific method of hashing used determines the length of the final hash output. SHA1, MD5 & SHA256 are all common hashing methods, each providing different levels of complexity and output size.

For example using SHA1 to hash a simple string:

Hello world => 7b502c3a1f48c8609ae212cdfb639dee39673f5e

Changing even the smallest thing (“H” to “h”) results in a completely different result!

hello world => 2aae6c35c94fcfb415dbe95f408b9ce91ee846ed

Hashing can be used in everything from password validation to ensuring the file you download has not beed altered by malicious third-parties.

Peer to peer

Using Peer to peer technologies allows the BlockChain to be distributed across hundreds if not thousands of nodes.

A node can be a simple device making use of the BlockChain or a more complex or powerful device that is used to manage the BlockChain itself.

As only 4 nodes are required to ensure that the BlockChain remains available, accurate and up to date, the more nodes that host it serve only to increase reliability, speed and robustness.

Consensus

Consensus is a technique in which a set of nodes can reach an agreed outcome without a designated leader and with automatic detection of tampering.

When a new block is proposed to the BlockChain, all nodes must add it to their own BlockChain. If any node tries to lie, that node becomes tainted. As long as there is no single party with the control of >= 51% of the nodes, the BlockChain is always up-to-date and truthful.

Quorum systems are applied in BlockChain to reduce the complexity of the consensus algorithms with no penalty in consistency, partitioning the nodes in a similar way to electoral constituencies.

Consensus must happen before a new block can be added to a chain, so the only way to add a ‘bad block’ to the chain is to control the majority of the nodes.

As the nodes are distributed throughout the internet, this becomes impractical and this means that we have established an effective trust between all the users of the BlockChain without requiring a third-party.

Building the Block

By combining these technologies we can create the next block for inclusion on a chain:

  • The contents can be encrypted using Public Key Encryption
  • Hashing protects against the contents changing
  • Consensus agrees which block will be the new one on the end of the chain and that everyone agrees that this is true
  • Peer-to-peer networking distributes the new block to all locations for inclusion
Advertisements
Comments
  1. […] What is BlockChain? – Part 1 – The Building Blocks […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s