What is bitcoin & blockchain

in #bitcoin9 years ago

 This article is part of a series of essays I am planning to write to make understanding bitcoin, blockchains and crypto currencies easy. I hope it helps you and is worthy of your vote. I value any feedback especially if it is constructive and will make sure to respond to it as well. Enjoy. 

My goal: An easy to understand yet comprehensive explanation of bitcoin and its blockchain. I want you to be able to make your own judgment about it. 

There is a new technology on the block and currently its hippest buzzword is blockchain. So with this article I want to explain what both of these are and how they fit together. I am going to try to make this as simple as possible while at the same time making sure you get a comprehensive overview and understanding. If you are thinking about getting into it and maybe buying some bitcoin my goal is that at the end of this article you have a good enough understanding of it so you can make your own decision instead of having to rely upon some expert to tell you what to do.   

 Before we dive in, you need to have an open mind. General media covering bitcoin usually like to evaluate it in reference to something they are familiar with or think you may relate to. A few years ago this meant that coverage tended to be critical, now that everyone talks about it, the tenor is more like “this will disrupt everything”. Neither is useful and instead of thinking about how bad or amazing bitcoin and blockchains are, lets just try see how it works. The good news: Bitcoin is actually not that complicated to understand and the key mechanics are quite basic if you focus on why it was invented and how these objectives were accomplished. 

Why was it invented: Peer to Peer without permissions. 

We do not know who Satoshi Nakamoto -inventor of Bitcoin- is and why he invented it, however the white paper called “Bitcoin: A Peer-to-Peer Electronic Cash System” states: “A purely peer-to-peer version of electronic cash would allow online payments to be sent directly from one party to another without going through a financial institution.” 

So the “WHY” is actually very simple: Create electronic cash that can be transacted between anyone just like you would take a coin or a bill and give it to whoever you want to pay. Just electronically. If you could pay someone the same way you sent your friends an IM message would that not be amazing? 

Why was this not possible before bitcoin? Because nothing digital can be unique. This is because anything digital is made of 0s and 1s and thus can always be reproduces or copied with no distinction from the original. This has many advantages, however for money it does not work very well. Money only works if it is scarce. If we could copy money at no cost there would be infinite amounts of it and consequently all the money would be worthless. The solution to this problem is to instate a 3rd party, such as a bank, government or paypal to keep a record of who owns how much. If I sent money from my paypal account to yours, paypal will simply change mine and your entry in their records accordingly. This works, however not automatically. Because a 3rd party controls the ledgers they have power over who has how much money. As such they need to be regulated so that this power cannot be abused. We need laws and regulations, courts, police and jails, all so that if paypal and one of its customer had a disagreement, there are processes in place to figure out who is in the right and punish anyone that does not follow the rules or steals. In addition, only some people can use these services as they require permission and do not work everywhere. You won’t be able to go to a foreign country and just open up a bank account. Today our financial systems are very local to countries and moving money across borders is expensive and inefficient. Even within one country it takes days to actually settle funds. So the goal of bitcoin is to create a trustless and permission-less access to money. No more asking for permission means the transaction can be done directly between the parties that want to to exchange value and anybody (and in fact anything) can use it without asking for permission. Worried about skynet yet? 

How does this work: Blockchain makes every transaction public.   

So clearly whenever anyone has control of the accounts their values and the money creation process we have the above described inefficiencies. Bitcoin changes who controls the ledger. A blockchain is essentially a database nobody owns. Instead of a particular party having control over the accounts, the ledgers are made public so that everyone has a synchronized copy of it. A blockchain is a public database, which contains transactions between accounts and they are public and visible to anyone. The database is updated with new transactions which are combined in blocks (blocks of transactions). Each block references the previous block and hence we have a chain of blocks or blockchain. In bitcoin accounts are also not directly related to a person or personal information but are just a combination of a bunch of characters like this one: 1Mx4UaYuDhWxRgyXgQhruFxGjBhiJ27Fkw (this is one of my accounts). Anyone can create as many of these bitcoin addresses as they want, technically they are just a very large number. So essentially pick a large random number and you have a bitcoin address. You can watch the bitcoin blockchain on sites that are called blockchain explorer and for bitcoin the most popular is https://blockchain.info. There you can look up any bitcoin transaction ever made.   

How is the blockchain written: Consensus and mining. 

But somebody needs to actually write the transactions into the blockchain. Since nobody controls the blockchain it has to be written by everyone. So a consensus mechanism is needed to write the next new block. In bitcoin this consensus mechanism is called Proof of Work. It is essentially a race to “find” the next block. Miners, those are the participants in this race, compete with their computing power to find the next hash of the next block. A hash is a crypto function that creates a technical fingerprint of always the same length no matter how small or large the input is. You can hash your name, a movie, picture or the text of the bible and the output has always the same length. If you change just one character or byte in your input the output looks entirely different. You cannot deduct the input from the output but you can always verify that the hash represents the input by running the hash function yourself. In the bitcoin mining race the input are essentially all the new transactions, some other information and a reference to the previous block, which are combined and hashed to look like this “00000000000000000039fba693e27c7d9e5364e2f0d776c2e8379419f45685c8”. Notice how this hash starts with many ‘0’. That is the difficulty. In order for a hash to be accepted as a solution to the race, it has to start with a certain amount of 0s. A nonce –an additional number- is added to the information that is to be hashed randomly until the resulting hash starts with the needed amount of 0s. So miners have a set of information and add a number to it, hash that information and check if the results starts with the needed amount of 0s. If not, they change the nonce and try again. When a solution is found, the lucky miner publishes this new block to the network and everyone now will start to mine the next block on top on this just newly found block by referencing it in their next solution. Everyone can validate that the right information + the nonce returns a qualifying hash simply by running the hash function themselves and only then accept this solution. This way nobody can cheat. There is no other way to finding this hash then by trial and error, so whoever has the strongest computer has the best chance of winning the math race.  The difficulty is adjusted by the network automatically depending on how many miners are working on the solution so that on average every 10 minutes a new block is found. When a transaction is part of a block it is considered confirmed, until then it is considered an unconfirmed transaction.  

Are we done yet? 

Yes, if you want to be this is good enough as an overview:  

Bitcoin is a way to transact peer to peer with anyone. This is possible because we are using a blockchain, which is a synchronized public record that is written via a consensus mechanism.    

If you want to know a few more details, carry on. I will cover why miners enter the race, how to use bitcoin, how to buy it and how you can use it to save money and cover why this new tech is so revolutionary.   

Why do miners work: Rewards and game theory 

The Proof of Work algorithm in bitcoin is very expensive. This is good because it makes bitcoin extremely safe. Since mining is equivalent to running the network, it is actually a good thing that no one can just take over this mechanism. The only way to screw up the blockchain is to control more than 50% of the mining power or in other words dominate the consensus mechanism. 

This is an interesting youtube video about a chinese miner:

Miners today have invested hundreds of millions of dollars to compete in this race. The reason is that the bitcoin protocol rewards miners every time they find a block with a mining reward plus all the tiny transaction fees. This reward started to be 50 bitcoins per block but is cut in ½ every 4 years. Currently the mining reward is 12.5 bitcoins. This is also how the money supply is created as well as how it is limited. Because the rewards keep going down, the overall supply is limited to slightly less than 21 million bitcoins.  

The rewards also makes sure that everyone is honest and that this mechanism cannot be gamed or hacked. Whenever a node does not comply with any of the rules, their blocks will be rejected and as such their work would not be rewarded. In order to participate you have to do the work, once you have done the work you want to collect the reward, which you will only receive if you comply with all the rules. The game theory of the blockchain ensures that the consensus mechanism works using financial rewards.   

How are bitcoins stored and transacted? 

Bitcoins are stored in bitcoin addresses which are cryptographic key pairs consisting of a private key and a public key. The public part is what you can freely share and give to others to receive payment, the private key lets you move the funds again to another address. You can manage these in a wallet. A wallet also lets you create transactions. A transaction signs over coins from one address to the next with the private keys of the sending address. So anyone that has access to your private keys has access to the funds. Your wallet can create transactions for you using your private keys. When you press sent, the transactions gets forwarded to one or many nodes of the network. When a node receives a transaction it has not seen before, it checks that it is valid. There are many rules to be checked, one of which is that you actually must own the funds that you are sending. The verifying node can check this because it has access to the blockchain. When the transaction is valid, it is sent to every other node it is connected to to. As such a new transaction gets propagated practically instantly to everyone in the network including to the miner that will mine the next block. In order for him to include your transaction into the next block, you need to add a small transaction fee, otherwise there is no reason for the miner to actually put it into a block. Your wallet will know what the right fee is.   


There are different types of wallets   

  • Wallets that are full nodes. Those are wallets that store the entire blockchain. The blockchain is pretty big so it only makes sense to use these because you are curious or maybe when you are using bitcoin as a business. The most prominent of these is bitcoin core which is based upon the software Satoshi wrote and published and still is the reference implementation. The advantage of being a full node is that one can verify everything and therefore this is the safest way to transact. 
  • SPV Wallets. SPV stand for Simple Payment Verification: Instead of downloading the entire blockchain, these wallets only download what is relevant for them, primarily all the history of the bitcoins you own and that are sent to you. As such they work just as well and give you full control of all your keys. The difference however is that you will rely on other nodes for the verification of transactions, so you must hope that the other wallets you are connected to are honest. My favorite SPV wallet is JAXX. Other examples are electrum, Multibit, Airbitz, blockchain.com and several others. Some of them, such as electrum connect to a full node on a server, which means you now need to trust that this server has the correct blockchain. 
  •  Server based wallets. They work like a bitcoin bank by controlling the private keys for you. The advantage is you do not need to worry about the security of your keys, as the website is responsible for it. The disadvantage of course is that they have control over your money. My favorite web-wallet is coinbase, but there are many examples such as Circle as well as all the different bitcoin and crypto exchanges.   

What type of wallet you use, depends on what you are most comfortable with. I personally store larger amounts of crypto currency on exchanges such as coinbase. When doing so I make sure they operate out of a country I am comfortable with, are well funded and big. There have been cases of exchanges simply running away with customer funds. Smaller amounts I keep on my phone and computer via SPV wallets. My favorite is Jaxx, which you can use on any device, but I also use Airbitz and blockchain.com. The most secure way of storing your bitcoins is generating a private key offline, writing it on a piece of paper, making copies of it and storing it in separate safes or deposit boxes. This is called cold storage. Another safe way is to use multi-signature addresses, those are bitcoin addresses that require signatures of several private keys. You can then have the private keys on different devices or be controlled by several people so that hacking all of them becomes effectively impossible. There are also wallets that support this, Coinbase being one of them.   


How to get bitcoins: Coinbase or Exchanges 

If you want to get bitcoins you have to use some exchange. An exchange works like a stock market or forex exchange where people buy and sell bitcoins and other cryoto currencies for USD, EURO and other fiat currencies. The supply and demand creates the current price, which is rather volatile. What exchange works for you depends on your particular country. My favorite way of buying bitcoin is via coinbase. They are connected to my US bank account and allow me to buy bitcoins instantly for up to $2000. Larger amounts will only be released to me once the money they withdraw from my account has been received by them, which usually takes a week. Coinbase works in 24 countries, most of which are in the EU. If you do not have an easy way to buy bitcoin, usually you need to wire money to an exchange directly. When buying bitcoin check the fees. Exchanges allow you to buy bitcoin for usually less than 0.5% while services that use debit and credit cards tend to charge 3-10%. So if you use large amounts it might make sense to wire money to an exchange even if it takes time and is not very user friendly. You can find a good overview of exchanges vie coinmarketcap.com. 

When buying bitcoin make sure you understand its volatility. The price can change 20-30% sometimes in one day. This is because no real economy is behind it yet and the price is driven primarily by speculation as of now. Until the market cap is a bit higher or some killer app uses bitcoin and creates a peg to something that is valuable, expect this volatility to remain, even if the price might seem stable for a few weeks, months or even a year.   

Security: Decentralized 

Bitcoin and any other blockchain are decentralized. This is because no one entity or node controls anything, while a majority of nodes can decide to change rules and even the content of the blockchain itself. An example was the recent Ethereum hardfork

The security of bitcoin is also decentralized. Since everything is controlled by a key pair, every single key pair must be secured. As a result, you are responsible for your keys and when you lose them nobody can help you. Just like when you lose cash. This changes the security responsibility from a single center (i.e. bank, credit card network or company) to the individual holders of the money. Incidents like the Target or BoA hack, compromising thousands of users, are impossible.  As long as the consensus mechanism works the security of bitcoin is practically perfect. Likewise when the consensus mechanism breaks all value is potentially lost. Bitcoin and its blockchain cannot be hacked, because you would have to hack every single participant of the network. However single keys can be stolen and exchanges which have large amounts of bitcoin can be hacked and their private keys can be stolen. This happens frequently, with the key difference that users are never affected. So depending on how much money you control, make sure that the security is appropriate. Also remember that if you store large amounts of coins on your computer or phone, they now become a honey pot for hackers, if the hacker knows about them.    

How to use bitcoins: save 15% to 30% on amazon.  

 There are many merchants that accept bitcoin and for merchants, accepting bitcoins makes sense as they can safe the fees payment processors normally charge and have global access to customers. However, most merchants do not accept bitcoin yet, so you won't simply be able to pay for everything with bitcoins. Even if your favorite store does accept bitcoins, it might not make sense for you to buy bitcoins and then pay for your stuff with it. Its likely cheaper and more convenient to just use paypal or your credit card. 

There are examples where using bitcoins do make sense, such as for digital access, content in foreign countries or when you don’t want to provide personal information or your credit card number. The best reason to use bitcoin I am aware of is buying things on amazon via purse.io. Purse allows people to buy products via wish-list for you with a discount you determine. You on the other hand sent the counterparty bitcoins (minus the discount and a fee to purse.) Purse provides an interface and market place as well as escrow service. I can usually get away with discounts between 15% and 30%, the higher the discount the longer you may have to wait until someone accepts your offer. This works because many people all over the world have amazon credits, and this is a way to turn these into liquid cash. In essence purse is a remittance service. I buy everything I can this way and never had any issue with this service so far that could not be resolved. But keep in mind that things may take a bit longer and sometimes people on the other side are trying to scam you, but because purse acts as an escrow, these issues are always resolved but may take a little time. Purse also is restricted to certain countries, check their website to see if this is a possibility where you live.     

The core technical innovation: All in one vs modular 

The most amazing thing about the bitcoin blockchain to me is how it combines many existing technologies in a new way to create a new form of money and computing all at once. Bitcoin is a new form of money because for the first time money can be decentralized and created by anyone. This has profound implications. Steem is the first real killer application I am aware of that leverages this power to create a whole new ecology and financial system around a social media ecosystem.

 This is only possible because blockchain is a decentralized technology that is open and for anyone to use. The steemit team have taken this open technology and created a new version of it. Bitcoin is a new form of computing because it does everything at once. This is opposite of how computer systems have been designed until today: Different task such as data storage, application logic, networking etc have been solved as their own solution separately and then integrated to work as one system. In bitcoin everything works together as one and no integration is required. To do anything in a blockchain you have to create a transaction, which is sent over the network, has a script that signs over permission (application logic), changes data in the blockchain and is a financial transaction. All at once, all at the same time. You cannot do any of the above without doing all of it. 

Doing everything together creates efficiency and allows to do all these things in a decentralized way. What the potential meaning of this is we cannot possible imagine. I think steemit is an example of how powerful this new type of technology can be. Maybe this topic alone should be covered in its own article some time.   


Steemit is also a blockchain 

When satoshi published bitcoin, he made the software open source. Many developers have taken the code and copied it. Some have copied and improved it. Some have taking its principle and created their own type of blockchain. Steemit is also a blockchain but has many more functionalities and innovations including a very different consensus mechanism. I think the blockchain steem is based on, is likely the best blockchain implementation yet. I will explain how steemit works in separate article. However many fundamentals are the same and thus it is good to understand bitcoin, before looking at how steemit works, which is why I have written this article first.   


I hope this overview of bitcoin & blockchain was useful to you. If so, please upvote and share with your friends. If you have any question let me know in the comments and I will respond as best as I can.   

If you want to learn more, I suggest to first read the bitcoin whitepaper

Then check out the following :   

  • Andreas Antonopolous: he is a big bitcoin Guru and his youtube videos are frequent and always amazing. 
  • EpicenterBitcoin, these guys provide weekly interviews with interesting guests from the bitcoin and crypto world.  
  • Letstalkbitcoin is my favorite bitcoin podcast    

 I am sure you won’t have problems finding content you will enjoy and learn from. Thank you for your attention and your vote.   Also let me know if there are any topics you would be interested to read about from me and check out 


Thank you!

#bitcoin #blockchain #howitworks #whatis #overview #introduction #knircky   

Sort:  

10/10 article man, jeez listen to those fans sing in that video hehe Powerful stuff!

Haha, yea those fans are quite loud!

Thanks much again ! I am learning so much for all your posts !! Keep it coming !

That is precisely why I write them. Thanks for your vote.