“Blockchain” is one of those words that has the power to confuse even the smartest people.
And the media hasn’t been at all helpful explaining how this technology actually works.
For starters, blockchain is the technology behind cryptocurrencies like bitcoin.
The Bitcoin blockchain allows us to transfer bitcoin person to person (or “peer-to-peer”) without any intermediary. When I transfer U.S. dollars to you, we either have to do it in person – with me handing you cash – or through the banking system, which involves me telling my bank to send money to your bank account.
(Bitcoin with a capital “B” refers to the blockchain, whereas bitcoin with a lowercase “b” refers to the cryptocurrency.)
But how does this actually work?
Today, I’ll explain everything you need to know about the inner workings of blockchain – by breaking it down into simple steps…
A good analogy is to think of the Bitcoin blockchain as a giant Excel spreadsheet that shows the complete transaction history and location of every bitcoin.
Every 10 minutes, the spreadsheet gets updated as an additional “block” of new transactions is permanently added to the spreadsheet.
Everyone can have their own copy of the spreadsheet. It’s completely transparent.
Let’s say Jim sends one bitcoin to Sally. When the transaction is processed by the bitcoin network, the spreadsheet is updated. Jim’s balance is decreased by one bitcoin, and Sally’s is credited one.
But who updates the spreadsheet? And how do we stop people from trying to make false updates to the spreadsheet? What prevents someone from awarding themselves more bitcoin or trying to “double spend” the bitcoin by sending it to two different people at the same time?
All of that is the job of participants on the network called “nodes,” which are also known as miners. Nodes are the computers or large computer systems that support the Bitcoin network and keep it running smoothly. Nodes are run by individuals or groups of people who contribute money toward buying powerful computer systems, known as “mining rigs.”
Two types of nodes exist – full nodes and lightweight nodes.
Full nodes keep a complete copy of the blockchain ledger (i.e., the giant Excel spreadsheet). This is a record of every single transaction that has ever occurred. This is currently more than 250 gigabytes in size.
Lightweight nodes, on the other hand, only download a fraction of the blockchain. Lightweight nodes are used by most folks as a “bitcoin wallet” for bitcoin transactions. A lightweight node will communicate to a full node when it wants to transact.
So the full nodes (or miners) run the spreadsheet, but how do they keep the spreadsheet synchronized between them all? This is the key, considering the number of people who can run their own full node isn’t limited. (See the figure below.)
Let’s go back to Jim and Sally…
Jim wants to send one bitcoin to Sally.
Sally creates a bitcoin wallet. Anyone can create one in a couple of minutes. When you create your wallet, two pieces of information are created for you…
One is your “public key,” which is also known as a public address, or your bitcoin address. It’s a string of numbers and letters. Think of it like an account username.
The other is your “private key,” which is effectively your bitcoin password, and you need to keep it safe. If you lose it, it means you lose access to your bitcoin. (No centralized entity exists that can recover your password for you. It isn’t like if you forget your Facebook password and you have e-mail instructions sent to you to reset it.) More important, if someone else gets your private key, they can take your bitcoin.
Sally tells Jim her public key. Jim opens his bitcoin wallet, puts in the instruction to send one bitcoin to Sally’s public address, enters in his private key (password) to authorize the transaction, and hits send. (See the figure below.)
After a few minutes, Sally checks her wallet again and sees she now has a bitcoin in her wallet. But what’s happening behind the scenes?
First, the network (in this case a lightweight node) makes a quick check of the proposed transaction. It checks to see that Jim has enough bitcoin in his account. And it checks if the address Sally provided is a valid bitcoin address.
After the transaction passes those two tests, the transaction gets bundled together by miners with other pending transactions into a “block.” The goal of the miners is to verify the block, and add it to the blockchain (i.e., update the spreadsheet).
How does a miner get to add a block to the blockchain? This is where brute force mining comes into play. To understand this, we need to touch upon “hashes”…
A “hash value” is a series of numbers and letters strung together that looks something like this: 1gwv7fpx97hmavc6inruz36j5h2kfi803jnhg. A hash value is generated by pushing data through a mathematical formula called a “hash function.”
Another way to think of this is like the ingredients for a smoothie and a blender. You take your ingredients (your data), put it through a blender (the hash function), and you get your smoothie (the hash value).
Hashing is a one-way process. When you give me a hash value, I can’t turn it back into its original input data, in the same way I can’t turn my smoothie back into its original ingredients.
When miners are given a block of transactions to try and add to the blockchain, they are using a hash function to try and solve a cryptographic puzzle.
The miners take the new block with all the transactions in it, combine it with a randomly generated string of numbers (called a “nonce”), put it through a hash function, and then get a particular hash value.
The miners are trying to find a hash value that starts with a specific number of zeroes. They will keep trying different nonces until they get the necessary hash value. This trial-and-error computation is shown in Step 1 and Step 2 in the diagram below…
All the miners are in a race to find the correct hash value. This is because the miner who finds it (Step 3) will broadcast the correct solution to the network (Step 4), which will verify it is correct.
The new block then gets added to the blockchain (Step 5), and the winning miner gets awarded 12.5 bitcoin by the blockchain for his success. (The miner who successfully finds the block also receives all of the fees from bitcoin transactions that were included in that block.)
Sally’s bitcoin transaction is now recorded in the blockchain. Her bitcoin wallet is now credited a bitcoin, and Jim’s is debited one.
The mining process then starts over again, with a whole new bunch of transactions bundled into a new block, and the miners all compete again to find the correct hash value.
In the media, bitcoin tends to dominate the headlines when it comes to cryptocurrencies. But bitcoin itself is just the beginning for blockchain.
Bitcoin’s success has shown the world it is possible for independent and fragmented entities (miners) to enable strangers to exchange value with no need for an intermediary. And it can be done in a completely transparent, verifiable, and open way.
Good investing,
Eric Wade
Strange change at your bank [sponsor]At least 41 major US banks have just made a drastic change to the way money in America works. It could have some major implications for you, your money and your retirement. But it's crucial you understand what's happening, before these changes get applied to your bank account. Here's everything you need to know.
Source: Daily Wealth