Email FacebookTwitterMenu burgerClose thin

What Is Blockchain, and How Does It Work?

Share
What Is Blockchain, and How Does It Work?

Blockchain, the digital technology behind cryptocurrencies like Bitcoin, is finding profitable applications in more and more industries. Blockchain is often described as a decentralized currency network, which means it is not controlled by a larger entity, like a government. Investors interested in getting financial exposure to this increasingly important and commercially viable technology will find that it’s complicated, but potentially rewarding.

Do you have questions about blockchain or investing in general? Speak with a financial advisor today.

What Is Blockchain?

Blockchain is a data storage coding format. Essentially, it is a relatively new and secure way of building a database. Blockchain is entirely software-based, meaning that this isn’t a piece of hardware. It’s a way of writing code.

Traditional databases store information in a central server. They might back that server up to other locations, but the database is defined by one, single location. This makes the data both private and vulnerable at the same time. It’s private because the owner of that server can tightly define who can access it and who can’t. It’s vulnerable because anyone who wants to access, steal or manipulate that data knows right where to go. The system is as secure as the security on that individual server.

Blockchain databases store information differently. We delve into the various components of blockchain below.

Blockchain: The Data & the Hash

Say you want to keep a record of transactions. You create a ledger that tracks each transaction as it comes in:

  • Eric owes $5 to Steven
  • Eric owes $20 to Liz
  • Roger owes $10 to Eric

To help secure this data, you create what is called a “hash function.” This is a piece of software which takes any block of text and turns it into a long series of letters and numbers based on a mathematical formula. You make it very complex, so this formula takes time and processing power to complete.

For each transaction that you record in your database you generate a hash string. You then add the previous record’s hash string to each new entry. This goes as follows:

  • Record 1: Eric owes $5 to Steven
  • Hash 1: “Eric owes $5 to Steven.” generates the hash ABC123
  • Record 2: Eric owes $20 to Liz. ABC123
  • Hash 2: “Eric owes $20 to Liz. ABC123” generates the hash XYZ456
  • Record 3: Roger owes $10 to Eric. XYZ456
  • Hash 3: “Roger owes $10 to Eric. XYZ456” generates the hash TUV789

This is a form of linked list because each record in the database now depends on every record that came before it. Now let’s say Steven wanted to change his entry to say, “Eric owes $20 to Steven.” This would change the hash key that his record generated. Our database would read:

  • Record 1: Eric owes $50 to Steven
  • Hash 1: YKW937
  • Record 2: Eric owes $20 to Liz. ABC123
  • Hash 2: XYZ456
  • Record 3: Roger owes $10 to Eric. XYZ456
  • Hash 3: TUV789

It’s immediately obvious that someone has changed the data. To make this change Steven would need to change every single record that follows the one he altered and calculate a new hash output for each one. This is why we based our hash function on a messy and complicated mathematical formula. It takes time to produce even one hash output, making it a reasonable deterrent to someone who needs to perform that calculation for every single record in the database.

Blockchain: The Public Ledger

What Is Blockchain, and How Does It Work?

But if we’re storing valuable information in our database it’s entirely possible that someone would be willing to spend a long time processing all those numbers.

To prevent that from happening you take your database and duplicate it across 1,000 computers, all of which are linked. Each computer is called a “node” and together they comprise the public ledger. The “ledger” can also refer to the copy of the database that each computer has on it.

Whenever the data on this public ledger changes, every computer on the network checks its data against the other. If one node’s data doesn’t match the network at large, that node is changed back to the consensus.

So, let’s say Steven really wanted to soak me for more money. He created a new mathematically generated hash for every entry in my record, then hacked in and changed my database. That computer would check its records against the other 999, realize that something was wrong, and update its records to reflect the accurate data. To make this change, Steven would have to hack 501 computers on the network at the exact same moment in order to convince the minority of machines that they were in the wrong. Not exactly easy.

Think of it like the difference between keeping a single book of transactions vs. having a room full of accountants with copies of that book, all sitting in a circle watching each other.

Blockchain: The Key

Of course, you’d like to make changes as well. It won’t do you any good if every time you update your records the network at large changes things back. So you create what is known as a cryptographic key. This key lets me log on and add information to the records, updating my database as necessary. The nodes on my network check any changes and, if they were made with the proper key, all update as needed.

Here’s the thing though: you can only add data. The nature of your hash structure means you can’t ever go back and change or erase previous entries. Now, suppose you notice Steven’s attempts to hack your records. You decide this means you now owe him nothing. You can’t go back and erase Record 1. Instead you add a new record saying, “Eric owes $0 to Steven because he’s a jerk.”

Blockchain: “Blocks” and “Chains”

Finally, let’s say your database is getting unwieldy. It has become difficult to run checks and mathematical processes for every single transaction in my records.

Instead, what you do is begin grouping your transactions together. You collect every 10 transactions onto their own document which is called a “block.” Instead of assigning a hash function to every transaction, now you assign a hash function to each block. This speeds up the time it takes me to record data because now you’re only running and checking mathematical formula every 10 transactions instead of every one transaction.

Your new database looks like this:

  • Block 1: Record 1; Record 2… Record 10
  • Hash 1: ABC123
  • Block 2: Record 11; Record 12… Record 20. ABC123
  • Hash 2: XYZ456
  • Block 3: Record 21; Record 22… Record 30. XYZ456
  • Hash 3: TUV789

Every time your database records a tenth transaction, it “closes the block.” This means it generates a hash for that block, opens a new one and assigns the previous block’s hash as part of the new one’s data. Now that old data cannot be changed without changing the entire database after it and doing so on 501 computers at the same time.

Together your blocks of data create a chain of records going back to the first entry. It is a blockchain.

Why Is Blockchain Technology Important?

What Is Blockchain, and How Does It Work?

Blockchain has figured out a way, at least for now, to solve what economists call the “double spending problem” in the digital space. If you can take one object and spend or use it in multiple places at once, then that object has no actual monetary value.

The context comes from currency. A dollar bill only has value if it is unique or singular. If you can spend the same bill over and over again, say by simply putting it in a photocopier and running off duplicates, then it becomes worthless. Why would anyone trade valuable products for a dollar they could just photocopy at home? Or for bills that flood the market in infinite supply?

In the real world this is a problem for property like paper currency that’s easy to duplicate but is also mostly an economics issue. You can’t, for example, duplicate a loaf of bread. If you try, you will have simply baked a new one. It has also always been a concern for intellectual property industries like movies, music and publishing. Still, that was less of a problem when media was tied to physical storage and distribution, like a DVD or the pages of a book.

The internet changed all that. Property online is infinitely easy to duplicate because it is made of computer code, and computer code is literally intended for duplication. Your computer operates by taking code from one source and copying it to the machine’s memory. Any movie or music file on a computer can be duplicated with nothing more than a CTRL-C and distributed infinitely over the internet. As a result, the double spending problem flourished online.

Blockchain could solve that problem. The architecture of blockchain has created the first actual opportunity for maintaining unique digital ownership of property. By its nature, blockchain can only record forward, never back. This means that anything, from an album to a novel to a token of digital currency, can keep current records of who owns it.

A blockchain database is intended to be copied. Let’s say you create a blockchain to track the ownership of a spy novel. You pick “The Prisoner” by Alex Berenson, copy #123456789. It is a single copy of a single book. Your record might look like this:

  • Block 1: Liz owns “The Prisoner”; Liz gives “The Prisoner to Richard” … Alan gives “The Prisoner” to Melissa.
  • Hash 1: ABC123
  • Block 2: Melissa gives “The Prisoner” to Ellen; Ellen gives “The Prisoner” to Bob.
  • Hash 2: Block still open, no hash.

We can copy this record as many times as we like and we can copy the book’s digital file over and over, but that won’t change the fact that every copy of the record says that this copy of the book belongs to Bob. If Ellen tries to open it on her tablet, the device will check the record and discover that this book doesn’t belong to her.

Bottom Line

For the first time, someone seems to have figured out how to create unique property in the digital space, property that you cannot copy and paste until it has no more value. The idea of unalterable digital records and unique digital property has created an explosion of ideas, from new forms of currency to a new way to store and process data.

Investing Tips

  • Consider talking to a financial advisor about how to get financial exposure to blockchain technology. Finding the right financial advisor doesn’t have to be hard. SmartAsset’s free tool matches you with financial advisors in your area in just five minutes. Get started now.
  • At this point, securities linked to companies incorporating blockchain-based technologies qualify as an alternative investment, not a core component of a basic investor portfolio. Investing in cryptocurrencies is one way to get financial exposure to blockchain technology. There are several different exchanges to choose from, with the most popular being Coinbase, GDAx and Bitfinex. These exchanges allow you purchase currencies like Bitcoin and Ethereum with a debit card.

Photo credit: ©iStock.com/ismagilov, ©iStock.com/NicoElNino, ©iStock.com/peshkov

...