Skip to content

How Bitcoin Works

How Bitcoin Works

Today, we are going to discuss how cryptography is used in Bitcoin and How Bitcoin Works. When you think about a currency, you think about something that is easily exchangeable and can hold the value that you need it to. Let’s think about currencies for a second, in their most basic form and why we need them.

The reason currencies exist is to be able to facilitate income and spending. If you work for a computer company, you can’t really be paid for computers – that would be too problematic. You would not be able to take the product that is used as your wage to the grocery store and exchange it for food or send it to your landlord as rent.

So instead we use something that can be transported easily and be held and exchanged without worry about its value altering while we hold it. These are inflationary effects that modern economics is concerned with. If you earned a dollar today and that dollar was able to buy you a sack of potatoes now, but would only be able to buy you half a sack in a month, then the value of your currency – and by extension, the value of your work – has been deemed lesser in value.

What you provide in terms of products and service to your employer or customer, needs to be paid for in a neutral token. Something that can be used in any situation across any platform.

In the last century, currency economics has greatly evolved and matured to the point that we no longer need to barter or use gold as the medium of exchange. We have now got to the point that we can use a physical token to represent the value that we have earned. We call that currency. But to be clear, nationalistic views aside, that dollar bill we have in our money clip is not what is valued, it merely represents the value.

We have security features in those pieces of paper so that those who are not authorized to print them, can’t. As a society, we elect a government to take care of things like that and we empower them to take care of it on our behalf. That’s a key understanding that you must keep with you throughout the discussion and journey in understanding Bitcoin or any other cryptocurrency for that matter.

We give our government the authority to do that so that they can manage the process of the currency and make it easy for us to use and to keep it safe from fraud and manipulation. The reason we need them to do all that is because paper currencies are inherently unsafe. They can be forged; they can be manipulated or stolen – and we are talking about the physical store of value, that dollar bill you have in your money clip.

As we evolved, commercially, we found that it was no longer efficient to just use paper fiats and wire transfers to conduct business. Because we are adopting new methods of commerce. It is trivial to say that online, eCommerce has changed our definition and needs of a token currency. In the past, we needed something light to carry (instead of lugging around heavy coins of gold or copper) to exchange with merchants and vendors in the market square. Today we also need that currency to be used in online transactions. We can’t seem to be able to tear up the paper currency and shove them through electronic cables to be sent to the vendor we are dealing with, so we instead use banks and payment processors, and credit cards to effect the payment.

To make a simple payment involves so many intermediaries and so many wheels to turn just to affect something as simple as a dollar. The reason this is the case is that the payment we need to send to that person needs to go from our credit card company to a payment processor who then deals with the banking system and then sends your payment across. There are just too many intermediaries involved and that is because this legacy system cannot handle today’s online commerce.

It would be like saying we do not want to use planes to fly from San Francisco to London because we want to continue using a horse and carriage.

The horse and carriage constituted the bulk of our transportation technology a century ago and it worked well then because we didn’t travel very far, and didn’t do it very often. It is also all we knew how to build. This is the same way that fiat currencies (our country’s paper and metal coin currencies) relate to commerce. The fiats worked well a generation ago because we bought locally, even if the item was imported. Because storeowners would buy from stockists, stockists would buy from wholesalers, wholesalers would purchase from importers, then importers would deal with foreign exporters.

These importers would make large purchases using their banking facilities. But all these middlemen caused the cost of things to inflate. At that time, it was a necessary cost of doing business. Not anymore. You were at an online store the other day and bought everything from moisturizing lotion to art supplies and shoes, and it was significantly cheaper because there was no need to account for costs and mark-ups of all the intermediaries the conventional supply chain presented.

You can even go directly to the seller in a cross-border transaction and buy what you want. None of the purchases you made, and you can easily relate to this, needed hard fiat currency. If you think about it, you will realize that this mode of payment is inefficient, ineffective, expensive, and outdated.

There is one other thing. Fiat currencies leave room for fraud and theft in ways that require a special infrastructure to enforce laws and deterrents against bad actors. Bitcoin changes the entire supply chain structure with the ability to allow payments to be processed anywhere in the world, even on Mars, when we get there, with inexpensive and impenetrable means.

As soon as we figured out how to make trains and build ships, we were able to cross the Atlantic by ship and take trains across great lands. Then the plane arrived, and we no longer needed to take two different modes of transport. We just got on a plane in London, and hours later we would arrive in San Francisco. The efficiency of the new mode catapulted the speed of business and the overall wealth of the civilizations we are a part of.

Bitcoin is poised to do the same because it is more adept at online transactions. Bitcoin can transact within ten minutes and have the payment in the seller’s hands at a speed that is unprecedented.

Cryptography

What is cryptography? In its basic form, cryptography is about changing content to something that is unrecognizable to those who are not authorized to consume it. So for instance, the Department of Defense could send its nuclear submarine captain orders, and anyone who intercepts the message could not decipher it because they don’t have the proper codes to do so. That’s just one example. There are two basic kinds of cryptography. One is where you can process a cipher in one direction, then process it back in the reverse to make it so only the person who is the intended recipient is able to decipher the message.

The Coin

There is no physical coin. This is typically the hardest part for anyone to understand. The vernacular used in cryptocurrencies tries very hard to approximate the language used in ways we can relate to, and that’s about as far as it goes. For instance, mining is not really using a pickax to remove bits of currency out of rock, and the coin is not bits of round metal that you make from the thing that you mine. These are all just terms that are used in the industry and do not mean the same thing in other industries.

The coin is not really a physical coin. It is not even an intangible coin. The funny thing about this coin is that it exists, but not in any way that you can touch, hold or observe it. The only reason it exists is that the universe of nodes within the network that you are in says it exists. The bottom line is that you own the coin because the community says you do, and the coin exists because the community says it does.

Let’s take this one step further. The community has no choice but to say that a coin exists. They don’t have any choice in this matter. The moment it comes into being, the community cannot say that it does not exist; it is not an opinion, it is a fact. It does this through an algorithm that is called the consensus algorithm. In the consensus algorithm, the coin that exists is the one that has a history behind it, and the community backs up its existence.

For all those of you who think that there is a specific coin, albeit one that is cryptographic, we are sorry to say this is the prevailing misunderstanding of Bitcoins. There is no physical product or electronic product – there is only the spirit of the product that exists because the community has agreed that it does. This makes Bitcoin the perfect holder of value. It cannot be created and it cannot be destroyed; it can be sequestered though, and never used again. But human self-interest will protect against that, although human weakness erodes that every time we forget our passwords. When we do, the coins that are stored in that account with a particular private key, are lost to the world of Bitcoin.

Let’s start at the beginning of how Bitcoin works and how it comes into being. We can answer this question in two ways. First, is if we look at the question to refer to the genesis of the cryptocurrency itself. The second would be to man how each coin comes into being and how it then gets passed from one person to the next. This is the part that is totally interesting and completely novel. It should have been patented but it wasn’t, and that is a great way to allow it to flourish.

Bitcoins don’t exist and are merely ledger balances that are attributed to the rightful owner by the previous owner and witnessed by the entire community. So, there is no physical manifestation of the coin. Think of it this way. Imagine if every single person in a town of one hundred people used the same bank, and none of those people bought any good or service from beyond that town or the world outside that town. In essence, you would have a closed ecosystem where everyone made and spent their money within the town.

So that town has one bank and all the townspeople have a checking account in that bank. Think about how that would work out. No cash would need to change hands if everyone just used a check to notify the bank to transfer their available balance to the person they identify. So if Alice needed to pay Bob $10, then she would give him a note (we call these checks in today’s banking system) that says “Pay Bob $10” and include a signature to indicate to the bank that it was indeed Alice who was giving the instruction. Upon receiving the instruction, the bank would then alter the appropriate ledger balances. It would reduce Alice’s balance by $10 and increase Bob’s by the same amount. What it would not need to do is actually, or physically, is move a physical $10 bill and give it to Bob.

The bank would have a large pile of cash in its vault and the balance that is in each person’s account is a testament to how many claims they have to the funds in the vault. You need to picture it in such a way that there is a pool of funds within the vault and the total pool of funds amounts to all the claims that depositors have.

It is the same way with Bitcoin. Contrary to popular belief, coins are never taken out of the system. We’ve seen some places that tell you that the coin is removed and placed for safekeeping; you can’t do that because the coin doesn’t really exist. The only thing that you can do is print the string that represents the coin, But even that doesn’t do much, because the coin always stays in the system.

Imagine a ledger where all the transactions between members of the community are recorded. Just like the bank in the ongoing example. If you were to go in and remove your Bitcoin from the system, it would be like saying that you could go to the bank and remove a line from the ledger. It can’t be done. Even in a bank, it doesn’t matter what’s taken out of the safe, it’s what’s in the ledger that matters. If someone empties the contents of the safe, the bank still owes the depositor the value that is stated in the ledger. Because the ledger is the central record of ownership.

In Bitcoin, that ledger keeps all the coins because the coins have no other identity except that of whom the last user and the previous user were – all the way back to the time the coin was created.

When we use physical fiat currencies, the legitimacy of the currency is ascertained by the security features that are embedded in the currency, i.e., serial numbers, watermarks, and so on. We gain assurance from the knowledge that it was printed by a government-sanctioned mint, and issued into circulation by a duly authorized bank. Plus the fact that there are laws to protect it and agencies to enforce those laws. It is legal tender because the currency is given the force of sovereignty by law.

On the other hand, Bitcoin has none of these, but we take that it is legitimate by at least two systemic features of the coin. The first is that the coin wasn’t randomly created – this is most important. Because if anyone could create coins at any point they wished, there would be no ability to create or transmit value, since there would be an oversupply of phony money.

Bitcoin is not phony money because you have to actually work to get it. You can’t just buy it from somewhere and inject it into the system. It either already exists in the system, in which case you can buy it from someone who owns an existing coin, or you earn it by doing a service to the Bitcoin community, called mining.

Since Bitcoin can’t be produced out of thin air, it passes muster as a realistic and serious tool born out of equitable standards – something from something, not something from nothing. By that we mean, you can’t just make it because you feel like it. Currency must be a carrier of value and if it ever this world not carrying any value, it will not be able to carry value as part of its existence in this world. So to make the first coin, there needs to be a reward for that work – and that’s where mining comes in. You do some work; you get a coin. Then from there, you pass it on to someone else for whatever you want for it in return.

All coins originate in this way and the algorithm that controls bitcoins has a predetermined number of coins that will be released: in total there will be 21 million coins. At the moment, there are just under 18.5 million coins in circulation with only two and a half million left to be mined into circulation. Once that last coin is mined, there will be a fixed number of coins theoretically available. Theoretically, because the number of coins, while fixed at 21 million, may end up being less because there are coins that fall out of the system constantly. This happens because people sometimes forget their private keys or misplace them, and since they are misplaced, they can never be retrieved. So that means they are lost to the system forever.

Contrary to what most people tend to pontificate, Bitcoin is not designed to take over or replace fiat currencies. It is an integral part of the existing fiat currency ecosystem. In its current state, it will not displace the system, and that is a good thing for now.

The entire Bitcoin network really has nothing to do with coins, at least in the way you would imagine. There are no coins at all, actually. They are mere transfers of value and you don’t need to represent them with a physical token of some sort. In any transaction, you need three elements: a buyer, a seller, and a witness to the ledger entry.

When you have those three things plus the ledger entry, what you experience is a robust system that gives you a credible stream of the transfer of value. Think of it this way: Let’s say there is a palette of freshly minted dollar bills. When you work or trade something of value, the new note is given to you in exchange for the value of your product or service. If it is given to you in exchange for nothing, that currency eventually will end up being worthless – like monopoly money. In essence, for the store of value to be of use, it needs to enter service and be exchanged for value.

The initial value is that of the mining. Mining is a tangible value that is captured and contained within the consideration that is paid for the coin. That initial coin is then paid to the miner who conducts the mining and expends real-world resources. That coin now has a tangible value which is then used by the miner to do one of two things.

He can sell the coin to someone who wants it in return for a different currency – this may include a fiat like the US dollar, British pound, or even something more arcane like the Nigerian naira. That exchange between the miner’s coin which he received as reward/payment for a service he provided, and the person offering real-world currency, is based on market forces and conditions – just the way the forex market or the stock exchange operates. Buyers and sellers determine the exchange value and it can fluctuate daily, hourly, or even moment to moment.

The second thing a miner can do is spend the coin for a product or service. In fact, the first purchase ever made with Bitcoin was from a pizza parlor. Just because Bitcoins can never leave the network does not mean they can’t be used to pay for real-world goods.

The Value of a Coin

You may wonder who or what determines the value of a coin. That is a valid question and it deserves a serious look at the economics of exchange and value. This is in essence the fiber of any economic system and that, in turn, is the fabric of human interaction and commerce. From centuries ago, the first form of commerce was conducted by bartering. The dairy merchant exchanged his milk for the farmer’s grain – the farmer got the milk and the butcher got the grain. There was a direct exchange of value fueled by need. It was a better alternative to one person milking his own cow, slaughtering his own meat, farming his own grain, and building his own dwelling. Specialization was indeed a better way of communal living, as long as there was a way to exchange and transmit value.

In the barter system, there was an inherent perception of value. A bottle of milk would be worth a cup of grain, perhaps. But the price was not predictable. What happens when the dairy farmer didn’t want grain today? That would deprive the farmer of milk because a barter deal could not be struck. The dairy farmer would have two problems, he couldn’t keep the milk till tomorrow at which point he could find another buyer, and he was not able to get the grain he needed to feed himself for that day.

To increase the complexity of the transaction, let’s say there is a third buyer, who wants the dairyman’s milk, but has bricks to sell, and the dairy farmer does not need bricks. That compounds the problem. While barter unlocked the potential of specialization, there was a third element in transactions that could not be solved, and that was the coincidence of need, or to put it in another way, the coinciding of need. If our need for your product does not coincide with your need for ours, it changes the dynamics of the transaction.

To level the playing field, civilization developed currency. Currency held the value of anything. Today it could hold the value of milk; tomorrow it could hold the value of bricks. Currency is not fixed to the tangible product but to the value of the exchange, which can change from one moment to the next even for the same product. With this in mind, it is easier to understand why Bitcoins were worth five cents in the early days and then hit a value of $50,000 till the date.

Human exuberance is not the measure nor value of the cryptocurrency and to confuse the two would be foolish. As a side point, economists are talking about cryptocurrencies and blockchains as a flash in the pan and as having no merit. We agree and disagree with them. We agree with them because the idea that Bitcoin is going to replace fiats is ludicrous. It has neither the infrastructure nor the sovereign backing to do so. But we also disagree, because blockchains and cryptocurrencies are valid mediums of exchange that deconstruct trust and value institutions to the point that a revolution in currency is on the horizon.

In short, the currency should be deconstructed into two forms to be able to understand the extent of its use thus far in economics. This also includes its future use, as the nature of society is changed at a fundamental level.

The first is that it is a token to carry the value and to be exchanged for whatever the holder desires. You may use your currency to put food on the table; another may use that money to get medication. Currency has allowed value to be fungible; and cryptocurrency, in turn, has allowed the currency to be virtually frictionless. It is indeed the next evolution in value transmission.

The point of all this is that you understand that the physical dollar you have in your hand is different from the value that you need it to represent. In the case of cryptocurrencies, the thing that is being monetized and valued is the expression of transfer. When you look at the details of a blockchain, you will start to realize that instead of a physical coin, or a packet of strings, Bitcoin is merely a message. It is a message that is composed and sent between sender and receiver.

Basically, Bob sends Alice a message saying he has sent her 1 BTC. Alice and the rest of the community are aware of that message. Now because the community knows that Bob sent Alice a message, Alice is the owner of the right to spend 1BTC.

When Alice then spends that BTC by buying something from Chuck, she sends a message to Chuck that she is paying him 1BTC, and that message is shared with the whole community. So now the whole community knows that Chuck has access to 1 BTC. Of course, the thing to note here is that we use the names Bob, Alice, and Chuck, but in reality, no one knows the identity of the person. They only know the Bitcoin address the message was sent to.

Bitcoin Address

It is the Bitcoin address that has the right to spend that Bitcoin. A typical Bitcoin address is one that begins with the number 1, the number 3, or the string bc1. They are typically 35 characters in length and are generated in a process that we will explain further on. Addresses starting with the number 1 are older addresses, and those starting with the number 3 or bc1 are newer.

There are three numbers you need to be aware of as far as the Bitcoin protocol is concerned. The first is that it needs a private key, a public key, and a Bitcoin address. The Bitcoin address is where a certain value is sent to and it is free to obtain. Each address is unique.

Private Keys

Let’s start with the Private Key part of the entire messaging system. The private key is the key (like a password) that you use to access or authenticate the message that you send in a transaction. Remember in a transaction, it is merely a message that you send from one address to another address. In the example above we sent a coin from Bob to Alice. To make sure that Bob’s message was authentic, he would have had to sign in with a private key.

This private key is unique and it corresponds with the address but you don’t get the address first. Instead, the entire process starts with the private key. At its heart, the private key is merely a hash of a random number. And that random number can be any one of 296 numbers. That works out to be 8 x 1028. Just to make a comparison, there are approximately 7.5 x 1018 grains of sand in the whole world. Just keep the quantum of the universe of private keys that are available at the back of your mind.

You can generate a private key for yourself using any means you like as long as the number is between 1 and approximately 296. There are people who decide to choose private keys that are easily remembered, but this would be a mistake. Because if you can easily remember them, then there is some sort of pattern to them, which in turn means that they are not entirely random. Anything that is not random, can be predicted and brute-forced. So don’t do this. You are better off using a truly random generator to get a private key.

There are also ways that you can remember your address and private key and that is by using a brain wallet. In this case, you enter a passphrase that only you can know. Take for instance the passphrase “Oh My God”. This passphrase, when converted using 256-bit SHA results in a private key:

FA988589BE4EC0D5C87892FDD20575AA1981601C4AB234B5F4A353E4CD032828

Once you have this secret key, then the system will generate the corresponding Bitcoin address. Just out of curiosity, If you do a search at https://www.blockchain.com/btc/blocks and find that the address is not taken then you can use it if you want.

Public Keys

Once you have a private key, the Bitcoin wallet then calculates the corresponding Public Key and the corresponding Bitcoin Address that goes with the private key. So you see the whole thing is actually backward. You are normally used to creating an email with a user name and then creating the password to go with it. In this case, you are actually creating the password first – which is a long, random alphanumeric string, and then deriving the public key from that using the Elliptic Curve Digital Signature Algorithm – ECDSA.

You don’t need to worry too much about the cryptographic math behind the calculation’ except to know that it is a mathematical relationship that is asymmetric. That means you can only go from a private key to a public key and on to the address, but never from an address to a public key and back to the private key.

However, you could try to guess private keys and then find the address from there, but that would be dishonest and almost impossible. That’s because it would take you more than the energy of the sun to be able to compute all the existing private key possibilities and the addresses which correspond to them.

Hacking Bitcoin

You already know that Bitcoin has addresses where coins are stored. It is the only way to have a coin. That address is then ‘unlocked’ with a private key, which as we said earlier is a random number that you can generate. But now the thing is that many Bitcoin owners decide that they want to have a Vanity Passkey so that it is easy to remember. What they do is use phrases and convert them to keys and addresses. They think, as everyone does, that they can’t backtrack from an address to a passkey, but can certainly fall forward from a passkey to an address.

So when you have a phrase that is converted to a passkey, there are bots out there that just continuously check for random phrases and look for addresses that conform to that. When they find it, they just drain the account since they already have the passkey. That’s how easy it is to hack a Bitcoin address, especially if the person is not willing to use the protection of random numbers. The moral of the story is that you should always use a random generator for your passkey, and not use a passphrase.

So the lapse in security is not because the system is poor, but because the private key was easily guessed. That is not machine or algorithm error, it’s human error.

nv-author-image

Era Innovator

Era Innovator is a growing Technical Information Provider and a Web and App development company in India that offers clients ceaseless experience. Here you can find all the latest Tech related content which will help you in your daily needs.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.