If you’ve been watching the news lately, you may have heard of something like a blockchain. It is a concept that makes data extremely secure for specific uses. You’ve probably heard it related to Bitcoin, but it has uses that go far beyond everyone’s favorite cryptocurrencies. Here’s a brief explanation of how it works.
It all starts with encryption
RELATED: What is bitcoin and how does it work?
To understand blockchains, you must understand cryptography. The idea of cryptography is much older than computers: it just means that you rearrange information in such a way that you need a specific key to understand it. The simple decryption ring toy you found in your Kix cereal box is a form of the most basic cryptography: create a key (also called a number) that replaces a letter with a number, run your message through the key, and give the key to someone else. Anyone who finds the message without the key cannot read it unless it has been “cracked”
However, modern coding is completely digital. Today’s computers use encryption methods so complex and so secure that it would be impossible to break them with simple human math. However, computer coding technology is not perfect; it can still be “cracked” if smart enough people attack the algorithm, and data is still vulnerable if someone other than the owner finds the key. But even consumer-level encryption, such as the AES 128-bit encryption now standard on the iPhone and Android, is enough to keep locked data away from the FBI.
The blockchain is a collaborative, secure data book
Encryption is normally used to lock files so that they can only be accessed by specific people. But what if you have information that must be seen by everyone – such as, for example, the accounting information of a government agency that must be legally public – and still be secure? There you have a problem: the more people can see and edit information, the less secure it is.
Blockchains have been developed to meet the security needs of these specific situations. In a blockchain, every time the information is accessed and updated, the change is recorded and verified, then closed by encryption, which cannot be re-edited. The set of changes is then saved and added to the total record. The next time someone makes changes, it starts all over again, keeping the information in a new “block” that is encrypted and associated with the previous block (hence, “block chain”). This repeating process links the very first version of the information set to the latest, so everyone can see all the changes ever made, but only contribute and edit the latest version.
This idea is more or less resistant to metaphors, but imagine you are in a group of ten people putting together a LEGO set. You can only add one piece at a time and you can never delete pieces. Each member of the group has to agree specifically where the next piece will go. This way you can see all the pieces at any time – all the way back to the very first piece in the project – but you can only change the last piece.
For something more relevant, imagine a collaborative document, such as a spreadsheet on Google Docs or Office 365. Anyone who has access to the document can edit it, and each time they do, the change will be saved and recorded as a new spreadsheet, then locked in the document history. So you can go back step by step through the changes made, but you can only add information to the latest version, not change the previous versions of the spreadsheet that are already locked.
As you’ve probably heard, this idea of a secure, constantly updated “ledger” is usually applied to financial data where it makes the most sense. Distributed digital currencies such as Bitcoin are the most common use of blockchains – in fact, the very first was created for Bitcoin and the idea spread from there.
The technical matters: step by step, block by block
How does all this actually work on a computer? It is a combination of cryptography and peer-to-peer networks.
RELATED: How does BitTorrent work?
You may be familiar with peer-to-peer file sharing – services like BitTorrent that allow users to upload and download digital files more efficiently from multiple locations than through a single connection. Imagine the “files” as the core data in a blockchain, and the download process as the cryptography that keeps it up-to-date and secure.
Or, to go back to our Google Docs example above, suppose the collaboration document you’re working on isn’t stored on a server. Instead, it resides on each individual’s computer, who are constantly checking and updating each other to make sure no one has changed the previous records. This makes it “decentralized”.
That’s the core idea behind the blockchain: it’s cryptographic data that is continuously accessed and secured at the same time, without any centralized server or storage, with a record of changes incorporating itself into each new version of the data.
So we have three elements to consider in this relationship. First, the network of peer-to-peer users who all store copies of the blockchain record. Two, the data that these users add to the last “block” of information, allowing it to be updated and added to the total record. Three, the cryptological strings that the users generate to agree on the last block, locking it in place in the string of data that makes up the record.
It’s that last bit that is the secret sauce in the blockchain sandwich. Using digital cryptography, each user adds to the power of their computer to solve some of those super complex math problems that keep the data safe. These highly complex solutions – known as a ‘hash’ – solve core parts of the data in the record, such as which account added or subtracted money in a general ledger, and where that money went or came from. The denser the data, the more complex the cryptography and the more computing power is needed to solve the problem. (By the way, this is where the idea of ’mining’ in Bitcoin comes into play.)
In short, we can think that a blockchain is a piece of data that is:
- Constantly updated. Blockchain users can access the data at any time and can add information to the latest block.
- Divided. Copies of the blockchain data are stored and secured by each user and everyone must agree on new additions.
- Verified. Changes to new blocks as well as copies of old blocks must be approved by all users through cryptographic verification.
- Safe. Tampering with the old data and changing the method to protect new data is prevented by both the cryptographic method and the non-centralized storage of the data itself.
And believe it or not, it gets even more complicated than this … but that’s the basic idea.
The blockchain in action: show me the (digital) money!
So let’s take an example of how this applies to a cryptocurrency such as Bitcoin. Let’s say you have one bitcoin and you want to spend it on a new car. (Whether a bicycle, or a house, or a small to medium-sized island state – no matter how much a Bitcoin is worth this week.) You connect to the decentralized Bitcoin blockchain with your software and send your request for your Bitcoin to the seller of the car. Your transaction is then sent to the system.
Anyone on the system can see it, but your identity and the identity of the seller are just temporary signatures, small elements of the huge math problems at the heart of digital cryptography. These values are plugged into the blockchain equation and the problem itself is ‘solved’ by the members of the peer-to-peer network generating cryptographic hashes.
Once the transaction is verified, one Bitcoin will be moved from you to the seller and registered on the last block in the chain. The block is finished, sealed and secured with cryptography. The next set of transactions begins and the blockchain grows longer and contains a complete record of all transactions each time it is updated.
If you consider a blockchain to be ‘secure’ it is important to understand the context. Individual transactions are safe, and the total record is safe, as long as the methods used to secure the cryptography remain “unbroken”. (And remember, this stuff is really hard to break – even the FBI can’t do it with just computer resources.) But the weakest link in the blockchain is, well, you – the user.
If you allow someone else to use your private key to access the chain, or if they find it by simply hacking into your computer, they can add additions to the blockchain with your information and there is no way to stop them. That’s how Bitcoin is “stolen” in much publicized attacks on major markets: it is the companies that exploited the markets, not the Bitcoin blockchain itself, that were compromised. And because the stolen Bitcoins are transferred to anonymous users, through a process that is verified by the blockchain and logged forever, there is no way to find the attacker. or get the Bitcoin.
What else can blockchains do?
Blockchain technology started with Bitcoin, but it’s such an important idea that it didn’t stay there for long. A system that is constantly updated, accessible to everyone, verified by a non-centralized network and incredibly secure has many different uses. Financial institutions such as JP Morgan Chase and the Australian Stock Exchange are developing blockchain systems to secure and distribute financial data (for conventional money, not cryptocurrency such as Bitcoin). The Bill & Melinda Gates Foundation hopes to use blockchain systems to provide free, distributed banking services to billions of people who cannot afford a regular bank account.
Open source tools such as Hyperledger try to make blockchain techniques available to a greater number of people, in some cases without the monstrous amounts of processing power required to secure other designs. Collaborative working systems can be verified and recorded with blockchain techniques. Just about anything that needs to be constantly included, opened, and updated can be used in the same way.
Image credit: posteriori / Shutterstock, Lewis Tse Pui Lung / Shutterstock, Zack Copley