Just a little Bit on BITCOIN

Just a little Bit on BITCOIN

The funny thing about Bitcoins is that they don’t exist “nowhere”, you can’t even carry them in pen drive!!

We talk about someone having Bitcoins, but when you look at a particular Bitcoin address, it does not have “Digital Bitcoins” held in it, similar to how you might hold pounds or dollars in your bank account. You just can’t point to a physical object, or even a digital file, and say “this is a bitcoin”.

But, there are only records of transactions between different addresses, with balances that increases and/or decreases with every transaction that ever took place and is stored in a vast general ledger (public ledger) called the Blockchain. You can work out the balance of any Bitcoin address by reconstructing the Blockchain.

What is Bitcoin? At a very basic level:

  • Bitcoin is just a digital file or a ledger that contains names and balances, and people exchange money by changing this file. For ex: when Sumit sells Neeraj his skateboard for 3 Bitcoins, Neeraj’s balance goes up by 3, and Sumit’s down by 3.
  • Sumit is only willing to trade his “real-life” Skateboard for a higher number in this digital file because he has faith that other people will also trust the system.
  • Remember as explained earlier, there’s no gold/securities or government issued money backing these numbers.

So, who maintains this ledger and makes sure no one cheats?

  • Goal of Bitcoin is to avoid any centralized control, so every participant maintains their own copy of the ledger (also termed as public ledger)
  • One surprising consequence of this is that everyone can see everyone else’s balances (interesting fact: the real system only uses account numbers and not names, so there’s some level of anonymity maintained)

If everyone maintains their own ledger, how are all the ledgers kept in sync as money is transferred?

  • So, this is how you transact, when you want to send money, you simply tell everyone else by broadcasting a message that has your account number, the receiver’s account number and the amount of the transaction.
  • Everyone across the entire world then updates their ledger. 

Sending/Spending money seems to be very simple, isn’t? You just create a message with some account numbers, how would you stop a thief Ricky, from spending Sumit’s money by using his account number? 

Accessing someone’s money and using it for wrong purpose is not a cakewalk and just like a pen and paper check, Bitcoin requires a kind of signature to prove that the sender is the real owner of an account, but it’s based on math rather than handwriting. How is any Account Secured?

  • When a new account number is created, it comes along with mathematical private key that is linked to that account number. If you’ve heard of a Bitcoin wallet, these keys are what it holds, and are what allow you to create signatures.
  • To create a signature, a private key and the text from a transaction are fed into a special cryptographic function. 
  • Another function allows other people to check the signature, making sure it was created by the account owner, and that it applies to that specific transaction.
  • Unlike the handwritten version, these signatures can’t be copied and reused in the future, as they’re unique to each transaction.

Let us use an example to understand the above and also see how it solves the “double spending problem”

  • If I have “back to future part 2” (my favorite childhood movie) digital file on my computer, I can freely copy that file a thousand times and send it to a thousand-different people.
  • For a digital currency, the possibility for unlimited copying would mean a fast-hyperinflationary crash.
  • Bitcoin solves this by maintaining a peer to peer network and recording each transaction in a public ledger called the block chain.
  • If I send 1 bitcoin from my bitcoin address to my friend Neeraj. The bitcoin network records that transaction in the block chain and I no longer have possession of that bitcoin. The coin ‘’moved’’ from my bitcoin wallet to Neeraj’s wallet.

You would notice that, sometimes must wait before your transaction is marked as cleared. Why do you have to wait?

Though Bitcoin will have mathematical signatures proving the sender’s information but they lack the time-stamp thus you can’t when it was sent, and this turns out to be problematic.

Let us see how this is addressed in our traditional banking system (centralized ledger),

  • If Amit wrote two checks giving each to two different folks, but only had enough money to cover one of them, the bank would pay the first person attempting to cash his check, but refuse the 2nd, because Amit’s account would be empty.
  • What does it prove? The order of these checks is critical, because it determines who should get paid.

It is very difficult to determine in Bitcoin the sequence of transaction, as the ledger is not centralized but, there are individuals (miners) all over the world.

  • Network delays might cause transactions to arrive in different orders at different places, and fraudsters could lie about time-stamps.
  • Two recipients might both think their transaction is first and ship the product, effectively allowing Amit to spend his money twice!

How is the above prevented? Bitcoin prevents this by providing a way for the entire world (miners) to decide on transaction order. Because your transaction must be verified by miners, you are sometimes forced to wait until they have finished mining.

  • The bitcoin protocol is set so that each block takes roughly 10 minutes to mine.
  • As new transactions are created, they go into a pool of pending transactions and from here, they’ll be sorted into a giant chain that locks in their order.
  • To select which transaction is next, a kind of mathematical lottery is held. Participants select a pending transaction of their choice, and begin trying to solve a special problem that will link it to the end of the chain. The first person to find a solution wins, and gets to have their transaction selected as the next in the chain (Note that these are batches of transactions).
  • Besides a random guess, you also input a transaction from the pending pool and chain, which is where the linking part comes in.
  • Some merchants may make you wait until this block has been confirmed, meaning that you make yourself a cup of English tea and come back again in a short while before you can download the digital goods or take advantage of the service that you paid for.
  • Now, there are times when some merchants won’t make you wait until the transaction has been confirmed. They effectively take a chance on you, if you won’t try and spend the same bitcoins somewhere else before the transaction confirms. Mostly happens for low value transactions, where the risk of fraud isn’t as great.

So, what’s this mathematical lottery or linking problem? It is basically a special function called a cryptographic hash. Scary, isn’t? It just mixes up its inputs and spits out a number, but it’s special because it’s irreversible. Thus, there’s no easy way to start with an output and then find an input that generates it other than making lots of guesses.

Interesting Fact: This is literally what people (miners) are doing in Bitcoin--feeding this function random numbers until the output meets certain criteria.

What is cryptographic hash? Below is a very simple and week hash function using prime numbers. Take out your calculator,

Perform the Sqrt(3) = 1.73205080756887729352744634150

Defined Range: Now take the digits from the 5th place after the decimal all the way to the 10th place after the decimal.

1.7320”508075”6887729352744634150, as you can see, its 508075.

Let us try that with another prime number 7.

Sqrt(7) =2.6457”513110”645905905016157536393.

Defined range that we have is “5th number after decimal all the way to 10th place”: 513110.

For any given prime number, we can find a number (the 6 digit resultant output) that seems to have nothing to do with it, but can be consistently calculated easily. If i were to give you the output 512754, what would be the input? If i didn’t tell you it was 13 (3.6055512754639892931192212674705), you would have to resort to trial and error to find it.

Well, the fate of a bitcoin is decided by a lottery opened to the entire world (miners) deciding which bitcoin transaction is going to be settled next. Interesting fact about this lottery is, it also helps ensure that everyone agrees about past transactions and that helps in avoiding any Fraudulent Ledgers.

What happens with the first-time miners like Sumit, joining the Bitcoin mining for the first time? Sumit would be seeking a copy of the transaction chain to get caught up with the current transaction queue and end up getting several multiple versions.

What does he do? Which one should he trust? Well, in the ideal case Sumit would trust the one that most miners are using, isn’t? Nope, it is not that easy.

Any individual miner can vote millions of times and thus it would appear as this chain is the one used by majority. How would you stop an individual from faking the mining?

Bitcoin solves this by requiring miners to solve math problems (yes again a math problem) to vote.

  • The decision as to which miner gets to add their block is done by exhibiting “proof of work”.
  • Put simply, this proof of work is doing complex calculations which take up computing power.
  • The first miner to generate an answer from the calculations gets to add their block to the blocks already present (which form the ledger) thereby creating a chain of blocks or a "Blockchain".
  • To ensure that the miner just hasn’t come up with a random answer, the system ensures that it is easy to cross-check the answer with the problem.
  • Thus, other miners don’t have to do the full calculations themselves but can simply check if the answer provided is correct. If most miners approve the answer then the new block is considered part of the Blockchain and everyone works from there.

Thus, you see the cost of computing power would makes it unlikely that a single person or group could ever afford to outvote or out-compute most users.

The two checks — digital signatures and proof of work — when put together, ensure that only A gets to spend their money (because the entry is digitally signed), and gets to spend only what they have (because the miners verify the entry). For the user, the transactions are extremely simple as Bitcoin functions as an app on their phone where they simply input how many bitcoins they want to transfer to whom and the system automatically takes it from there.

Finally, how does the money get created?

  • Every time someone wins the lottery to pick the next transaction in the chain, new Bitcoins are created out of thin air and awarded to their account.
  • Solving these problem is commonly called “mining,” as this is how money enters the system, but the main purpose of the math is to make sure there is an agreement on public ledger.
  • The system simply provides a convenient way to randomly distribute money into the world. In fact, sometime around 2140, no more money will be created, the maximum number of total bitcoins is fixed at 21 million, and participants will only be paid from fees added on to transactions.
  • The x amount that miners give themselves is pre-decided and decreases every time a certain number of bitcoins are generated.
  • Eventually it will fall to zero and then the miners’ incentive will come entirely from transaction fees.

Not everyone participates directly in the Bitcoin system. Most people take part in it indirectly through exchanges which make the experience more user-friendly. It is here that you can buy bitcoins in exchange for “normal” currencies like the dollar or the pound.

Even though the exchanges enrich the user experience, they also introduce the biggest vulnerabilities in the system as they give a centralized target to hackers. In fact, the most famous hack in Bitcoin history took place at its then biggest exchange, Mt. Gox when hackers took off with 850,000 bitcoins and caused the exchange to collapse.

There are numerous other examples of exchanges being hacked. The legal position around Bitcoin also remains unclear and most recently the Indian government has said that it does not recognize cryptocurrency as legal tender in the country as of now.

Connection with Blockchain: Bitcoin at its core is based on a concept called the Blockchain and for many, it is this concept which is far more interesting than Bitcoin itself. Now it is very important to realize that the use of the Blockchain for a cryptocurrency is a low-level use of it. Over the period, since its inception in 2008, Blockchain technology has evolved by leaps and bounds and can do a whole lot more.

One of the best examples of the Blockchain’s potential is exhibited by Bitcoin’s biggest competitor, Ethereum.

  • Created by a then-19-year-old Vitalik Buterin, Ethereum uses a cryptocurrency called ether and adds the concept of “smart contracts” to the blockchain.
  • This allows a user to create conditions which must be met before a transaction is executed. This completely cuts out the need for any middlemen and reduces processes.

Let’s take an example where A wants to buy a computer from B and B has bought the CPU/motherboard from C. The price is decided and the smart contract monitors the transaction from there on. Thus, if B sends the computer in time, they get the money, otherwise it goes back to A. All of this is monitored by the Blockchain and cannot be tampered with by a middleman. Many such smart contracts can be linked together to form a chain such that once a computer is sold, B’s CPU manufacturer (in this case C) automatically receives payment too, all this leads to greater efficiency. Another good use case would be you ordering meat from your nearby store and the temperature to maintain the quality is set by the retailer. The temperature is being monitored by a device and if the device triggers an alert that the temperature has crossed its threshold the transaction is cancelled and retailer does not get paid and delivery is canceled.

Another very important use of the Blockchain could be in politics, deciding the future of political parties by “Blockchain Voting”.

We would agree that the political system in many countries is rife with corruption and incidents of booth capturing are very common. Even in scenarios where the system isn’t biased towards one party, it can still discourage voters to come and vote and help in forming a “performing government”.

A Blockchain model will allow voters to vote using their phones and they need not to be at the booth, also giving them comfort that their vote will not be manipulated.

The decentralized nature of the Blockchain becomes extremely important here as no single authority would be able to manipulate these votes thereby resulting in a near-ideal election process. Well, far easy said than done!!

The next topic that I am finding a lot more interesting these days is Voting Power in Blockchain. Will share my notes soon.

Ana Simoes

Business Development | AI/ML GenAI Principal Specialist at AWS | Haas MBA

7 年

Great information - thank you for the article!

要查看或添加评论,请登录

Sumit K.的更多文章

社区洞察

其他会员也浏览了