Blockchain Basics

At the heart of all of these techs is a structure called the blockchain. Weird name ya, but it makes sense, as we’ll see.

Say you want to keep a record of something important, like real estate or stock trades or, say financial transactions. The way this has been done historically is by a ledger system. Back in the day, businesses kept an actual book of their recorded transactions, and that morphed into software spreadsheets and the like. The trick with these is, say your business burns down and takes the ledger with it; poof, gone baby gone, your entire biz history is smoke.

A digital ledger can be copied and stored in different locations, as many times as you have time for. That builds in redundancy, which keeps your info safe, but there are a couple of catches. First, having copies is great but then there’s the overhead of propagating any ledger updates out to the others. You want make sure that each copy is exactly the same as all of the others, and VERIFIABLY so.

What about other dangers? A single ledger is vulnerable to someone changing it, hacking it to their advantage, but if you have copies of the records in other locations, the perp would have to change those as well. If that bad actor makes a suspect change, do the other copies just blindly accept the update? How do you know that your records haven’t been messed with? It would be great if, once the data was written to the ledger, it was locked in place, with no way of sneaking in a revision.

The best system would of course be digital, have built-in redundancy via a distributed copy mechanism and also keep things verifiably in-sync through a method that forced each copy to agree on the content they stored. You can always add data and transactions to the ledger, but it would be appended as such, the original content being forever out of reach to revision.

What about scalability? If you’re planning on your ledger growing to enormous scale, it can collapse under its own weight if you don’t design it in a modular way that contains content in manageable chunks.

Let’s design our system. Take a bit of content, such as a list of transactions complete with dates, amounts and who bought and who sold. How to lock that info in place, to keep it safe from revision? You could use what’s called a ‘hash’ in computer speak. A hash is a process where you take your content and run it through an algorithm that then spits out a string of numbers that’s totally unique to that content, kind of like a digital fingerprint.

You can use that hash to compare one copy of the content to another without revealing the content itself. If anything in the content has been changed in a certain copy, the resulting hash will be different from the original and you would know that the copy is not really a verifiable mirror image of your original data. Hashes are used all of the time with digital software downloads to ensure that the entire app or movie has downloaded successfully.

Now that we have our little ‘block’ of data that has been verified by undergoing a hash, we can save it and distribute it out to the other places we’ve designated; call them nodes if you want. Say you want to add to your ledger, it’s a simple act of creating a new block and adding it behind the other block in a chronological order, ‘chaining’ it in place. Do this as many times as you need, and kick the update out the door to the nodes.

But what of the question of security and verification? You still need a way to ensure that all records can agree, or have consensus, about the integrity of the string of blocks as a whole. A good way to do this would be to store the hash of the prior block in the data itself of the following block, actually write that hash as content which then gets hashed along with the other transactions of that block. This effectively locks the content of each block in place as the chain grows.

Modern computers are speedy beasts, and depending on the complexity and length of your chain of blocks (let’s start calling it a blockchain now, shall we?), it could be a very trivial thing for a powerful computer to rewrite a transaction in a block, rehash that block and recompile all subsequent blocks’ data and hashes in the chain, effectively hiding their tracks. No bueño. What to do, what to do?

Back in the heyday of the 90’s when spam email was becoming a thing, efforts were made in the code of email programs to build a ‘speed bump’ in the send function of the app. The thinking was that, if you had the computer chew on a bit of a puzzle or computation before sending an email, it would prevent someone from easily sending out millions of emails (i.e. spam) at once. The computation wouldn’t have to be very complex, but just difficult enough to slow the process down to where sending out those millions of messages would take long enough to deter a person from using the app for such a purpose; your holiday email to your friends and family list would cause nary a moment’s hiccup to your machine and you’d never notice, but a big-time spammer may tear their hair out waiting for their massive batch to execute.

What’s that even mean for our dear blockchain? Well, if you wanted to make sure that someone couldn’t simply strongarm suspect changes into the chain, you need some way of slowing down the process. A great way to do this would be to require some sort of speed bump in the creation of new blocks, say, a very complex computation that the block creator would need to undertake in order to create said block. Once the block was indeed birthed, the computation’s result could be shared with the rest of the nodes, proving that the creating node did the required work to create the new block. This is called ‘proof of work’, and it’s at the core of what’s called ‘mining’ with cryptos such as Bitcoin.

Let’s quickly touch on storage. In our system, the copies of the ledger would be stored in independent, decentralized and distributed nodes. That way nobody could get at them once shared. You’d probably want to have volunteers give copies shelter, and you could compensate them for doing that by giving them something of value in return. With Bitcoin, it’s the proof-of-work mining that can potentially kick out a bitcoin to a lucky node. This is worth it for people to do, since a single bitcoin is worth gaga now.

Wrapping up, we have built a cool digital ledger that allows records to be stored in a independently redundant system where the content is securely locked in place and is verifiable in its integrity to each of the other copies. Also, we’ve built it in such a fashion as to prevent a brute-force rewrite of the data, effectively preventing nefarious revisions to the ledger. This, from my limited understanding thus far, is what constitutes the foundation of blockchain technology.

Much thanks to these vids that shed light on this subject:

Leave a Comment