If youâ€™ve been watching the news lately, you might have heard about something called a blockchain. Itâ€™s a concept that makes data ultra-secure for specific uses. Youâ€™ve probably heard it in connection with Bitcoin, but it has applications far beyond everyoneâ€™s favoriteÂ cryptocurrencies. Hereâ€™s a quick explanation of how it works.
It All Begins with Encryption
To understand blockchains, you need to understand cryptography. The idea of cryptography is far older than computers: it merely means rearranging information in such a way that you need a specific key in order to understand it. The simpleÂ decoder ring toy you found in your box of Kix cereal is a form of the most basic cryptographyâ€”create a key (also known as a cipher) that replaces a letter with a number, run your message through the key, and then give the key to someone else. Anyone who finds the message without the key canâ€™t read it, unless itâ€™s â€œcracked.â€� The military used more complex cryptography long before computers (theÂ Enigma MachineÂ encoded and decoded messages during World War II, for example).
Modern encryption, though, is entirely digital. Todayâ€™s computers use methods of encryption that are so complex and so secure that it would be impossible to break them by simple math done by humans. Computer encryption technology isnâ€™t perfect, though; it can still be â€œcrackedâ€� if smart enough people attack the algorithm, and data is still vulnerable if someone aside from the owner finds the key. But even consumer-level encryption, like the AES 128-bit encryption thatâ€™s now standard on the iPhone and Android, is enough to keep locked data away from the FBI.
The Blockchain Is a Collaborative, Secure Data Ledger
Encryption is normally used to lock files so they can only be accessed by specific people. But what if you have information that needs to be seen by everyoneâ€”like, say, the accounting information for a government agency that has to be public by lawâ€”and still needs to be secure? There, you have a problem: the more people that can see and edit information, the less secure it is.
Blockchains were 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 sealed off by encryption, unable to be edited again. The set of changes are then saved and added to the total record. The next time someone makes changes, it starts all over again, preserving the information in a new â€œblockâ€� thatâ€™s encrypted and attached to the previous block (hence â€œblock chainâ€�). This repeating process connects the very first version of the information set with the latest one, so everyone can see all the changes ever made, but can only contribute and edit the latest version.
This idea is sort of resistant to metaphors, but imagine youâ€™re in a group of ten people assembling a LEGO set. You can only add one piece at a time, and canâ€™t ever remove any pieces at all. Each member of the group must agree on specifically where the next piece goes. In this way, you can see all the pieces at any timeâ€”right back to the very first piece in the projectâ€”but you can only modify the latest piece.
For something a bit more relevant, imagine a collaborative document, like a spreadsheet on Google Docs or Office 365. Everyone who has access to the document can edit it, and every time they do, the change is 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 modify the past versions of the spreadsheet that have already been locked.
As youâ€™ve probably heard, this idea of a secure, constantly-updated â€œledgerâ€� is mostly being applied to financial data, where it makes the most sense. Distributed digital currencies like Bitcoin are the most common use of blockchainsâ€”in fact, the very first one was made for Bitcoin and the idea spread out from there.
The Technical Stuff: Step By Step, Block By Block
How does all of this actually play out on a computer? Itâ€™s a combination of cryptography and peer-to-peer networking.
RELATED: How Does BitTorrent Work?
You might be familiar with peer-to-peer file sharing: services like BitTorrent that allow users to upload and download digital files from multiple locations more efficiently than from a single connection. Imagine the â€œfilesâ€� as the core data in a blockchain, and the download process as the cryptography that keeps it updated and secure.
Or, to go back to our Google Docs example above: imagineÂ that the collaborative document youâ€™re working on isnâ€™t stored on a server. Instead, itâ€™s on each individualâ€™s computer, which are constantly checking and updating each other to make sure that no one has modified the previous records. This makes it â€œdecentralizedâ€�.
Thatâ€™s the core idea behind the blockchain: itâ€™s cryptographic data thatâ€™s continuously accessed and secured at the same time, without any centralized server or storage, with a record of changes that incorporates itself into each new version of the data.
So we have three elements to consider in this relationship. One, the network of peer-to-peer users that all store copies of the blockchain record. Two, the data that these users add to the latest â€œblockâ€� of information, allowing it to be updated and added to the total record. Three, the cryptological sequences that the users generate to agree on the latest block, locking it into place in the sequence of data that forms the record.
Itâ€™s that last bit thatâ€™s the secret sauce in the blockchain sandwich. Using digital cryptography, each user contributes their computerâ€™s power in order to help solve some of those super-complex math problems that keeps the record secure. These extremely complex solutionsâ€”known as a â€œhashâ€�â€”resolve core parts of the data in the record, like which account added or subtracted money in an accounting ledger, and where that money went to or came from. The more dense the data, the more complex the cryptography, and the more processing power is needed to resolve it. (This is where the idea of â€œminingâ€� in Bitcoin comes into play, by the way.)
So, to sum up, we can think of a blockchain is a piece of data that is:
- Constantly updated.Â Blockchain users can access the data at any time, and add information to the newest block.
- Distributed.Â Copies of the blockchain data are stored and secured by each user, and all must agree on new additions.
- Verified. Both changes to new blocks and copies of old blocks have to be agreed upon by all users through cryptographicÂ verification.
- Secure. Tampering with the old data and altering the method of securing 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 consider an example of how this applies to a cryptocurrency like Bitcoin. Say you have one Bitcoin and you want to spend it on a new car. (Or a bike, or a house, or a small-to-medium sized island nationâ€”however much one Bitcoin is worth this week.) You connect to the decentralized Bitcoin blockchain with your software, and you send your request in to transfer your Bitcoin to the seller of the car. Your transaction is then transmitted to the system.
Every person on the system can see it, but your identity and the sellerâ€™s identity are only temporary signatures, tiny elements of the huge math problems that form the heart of digital cryptography. These values are plugged into the blockchain equation, and the problem itself is â€œsolvedâ€� by the members on the peer-to-peer network generating cryptography hashes.
Once the transaction is verified, one Bitcoin is moved from you to the seller and recorded onto the latest block in the chain. The block is finished, sealed and protected with cryptography. The next series of transactions begins, and the blockchain grows longer, containing a complete record of all transactions each time itâ€™s updated.
Now, when you think of a blockchain as â€œsecure,â€� itâ€™s important to understand the context. Individual transactions are secure, and the total record is secure, so long as the methods used to secure the cryptography remain â€œuncracked.â€� (And remember, this stuff is really hard to breakâ€”even the FBI canâ€™t do it with mere computing resources alone.) But the weakest link in the blockchain is, well, youâ€”the user.
If you allow someone else to use your personal key to access the chain, or if they find it by simply hacking into your computer, they can make additions to the blockchain with your information, and thereâ€™s no way to stop them. Thatâ€™s how Bitcoin gets â€œstolenâ€� in highly publicized attacks on major markets: itâ€™s the companies that were operating the markets, not the Bitcoin blockchain itself, that were compromised. And because the stolen Bitcoins are transferred to anonymous users, through a process thatâ€™s verified by the blockchain and recorded forever, thereâ€™s no way to find the attackerÂ orÂ retrieve 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â€™s constantly updated, accessible to anyone, verified by a non-centralized network, and incredibly secure, has a lot of different applications. Financial institutions like JP Morgan Chase and the Australian Stock Exchange are developing blockchain systems to secure and distribute financial data (for conventional money, not cryptocurrency like Bitcoin). The Bill & Melinda Gates foundation is hoping to use blockchain systems to provide free, distributed banking services to billions of people who canâ€™t afford a regular bank account.
Open source tools like Hyperledger are trying to make blockchain techniques available to a wider range of people, in some cases doing so without needing the monstrous amounts of processing power it takes to secure other designs. Collaborative working systems can be verified and recorded with blockchain techniques. Pretty much anything that needs to be constantly recorded, accessed, and updated can be used in the same way.