I have been using Bitcoin for quite some time now, but didn’t bother to go deeper in to its mechanics until now. Having done so, I find cryptocurrency to be an absolutely fascinating subject, having gone through it at a high level. I will use bitcoins and cryptocurrency interchangeably throughout this post. My learning was concentrated over a period extending a couple of days, so my understanding may be flawed in some respects, but at the same time, I intend to maintain my notes over here so as to be accessible to me as well as anyone else.
What is a cryptocurrency?
A cryptocurrency is a digital de-centralized (peer-to peer) medium of exchange. The prefix crypto indicates that it employs cryptographic methods at its heart which accounts for the security of the entire system as well, though one may easily misinterpret it as being “cryptic” to understand. It is digital for it deals with the exchange of bits rather than any physical notes and coins. It is de-centralized for it is neither issued nor maintained by any central authority like real world currencies but is in fact controlled and maintained by each and every user. Lastly, like any other currency it carries an intrinsic value that is accepted by all its users.
Why is a cryptocurrency appealing?
A cryptocurrency is appealing chiefly because of its decentralization which brings with itself a certain degree of anonymity and most definitely low transaction costs. The transactions for cryptocurrencies like Bitcoin are completely transparent for they are logged in a public ledger. For merchants, the irreversibility of transactions and for the consumer, not having to identify yourself when making a purchase, unlike credit cards or PayPal accounts, can be considered to be appealing. Also, it quite easy to start off with transacting bitcoins as all you require is a client installed on your machine.
However, if you are buying bitcoins off an exchange that require you to submit KYC, it is quite possible to trace a transaction and its bitcoins to you. At the same time, it is possible to create and use a cryptocurrency that is less transparent and thus untraceable, though its acceptance would be questionable.
Is cryptocurrency fungible?
This is a rather contentious debate. In terms of transacting with bitcoins, each bitcoin can be deemed to be like any other. However, by its open nature, every bitcoin can be traced back to its genesis and this makes each bitcoin different from any other.
Can anyone create a cryptocurrency?
The answer to this is yes. However, it is possible to do so because of the ground breaking work done by the person/people going by the pseudonym Satoshi Nakamoto when he/they invented the bitcoin and released it under the MIT license. For my learning purposes, I had created one using Forknote which is based on Bytecoin. You would only need to setup the seed node and the blockchain (which can be done using a VPS) and you would be good to go. Samacoin anyone?
Is it created out of thin air then?
Any cryptocurrency is created out of solving cryptographic mathematical functions. So, you could say yes, but then you can philosophically question the existence of any real world currency which is backed by the trust in a government rather than any physical asset.
How does it work?
This answer is rather long, so I have split it in to another post. So, buckle your seat belts before you click the link.
What incentive does a miner have to solve the complex proof of work puzzle?
The miner gets to specify a reward transaction within the transaction block which at the time of writing is 25 bitcoins. The reward gets halved every 210,000 blocks. The reward in itself acts as an incentive to “solve the transaction block”. Moreover, each transaction in the block is accompanied by a transaction fee which too goes to the miner and this amount is not too insubstantial as well when you consider the large number of transactions involved. While I speak of miner in singularity, the reality is that with the odds being so high, there is always a pool of miners working together to solve the problem and thereby share the rewards.
Does each miner work towards the same proof-of-work puzzle?
Since the miner adds a different reward transaction to each transaction block, the hash generated for a transaction block containing the same transactions will be different. As the challenge string to the puzzle is different, so will be the proof-of-work.
What happens when there are two different versions of the next transaction block submitted for verification?
The nodes always consider the longest chain to be the valid one. ‘Longest’ refers to the one on which most proof-of-work has been done and has a higher difficulty level. It is quite possible that different nodes may receive different proof-of-work transaction blocks at the same time. In that case the nodes work on one chain while also saving the other branch. Subsequent proof-of-work transaction blocks will make one branch longer than the other and then all nodes will switch to the longer chain. Usually, a transaction is considered to valid after it has been confirmed six times i.e. five additional proof-of-work blocks were added since the particular transaction featured in a block. The possibility of the transaction being invalidated by an alternate block chain in such a case goes down to less than 0.1%.
Can the same bitcoin be spent twice?
Bitcoin was created keeping in mind the problem of double spending and solving it in a decentralized manner by using the peers or nodes in the network. As has been mentioned above, the nodes accept the longest chain as the valid one. To invalidate one transaction and to use the same bitcoin in another transaction would imply that the dishonest node would have to build a parallel block chain that is longer than the one that contains the first transaction.
The dishonest node would be starting at a disadvantage for it has to play catch-up to all the blocks that were mined for the first transaction to be confirmed. Then, it has to beat all the other honest nodes in building a longer chain that will be accepted by all the nodes in the network. This won’t be possible unless the dishonest nodes in the system outweigh the honest ones in terms of computing power. At the same time, the system heavily rewards honesty for the dishonest nodes, if they do have so much computation power at their disposal, would be better off mining legitimately and earning the rewards of proof-of-work for each transaction block rather than trying to overturn a transaction.
Is it really possible to trace right back to the first transaction in a block chain?
Since each new transaction block incorporates the hash of the previous accepted transaction block, it is indeed possible to go back to the first transaction. The first block in the block chain is called the genesis block and in the case of bitcoin, the first transaction was the one paying a reward of 50 bitcoins to its inventor – Satoshi Nakamoto.
Is the supply of bitcoin limited?
There shall only ever be 21 million bitcoins mined. However, the total supply will be less than that because of loss of bitcoins over time because of the loss of private keys. New bitcoins are created whenever a block is validated and appended to the block chain. The rate at which the blocks are validated and appended (known as network difficulty) is adjusted every 2016 blocks with the aim that it should take two weeks for 2016 blocks to be appended to the block chain. This comes out to 10 minutes per block on average. If the addition of the previous 2016 blocks took more than two weeks, then the difficulty is reduced and it is increased if the opposite is true.
I am just starting out and understand that I need to create a wallet to transact. What does it represent?
The wallet is simply a container of a user’s private keys. As we know, the public keys are generated from the private keys and they are in turn hashed further to generate the bitcoin address. The wallet is able to generate a balance corresponding to all your addresses using the transaction history that is contained in the block chain. Thus, the wallet is nothing more than a glorious digital key chain. However, if you lose your wallet, you lose your private keys and with it the ownership of all the bitcoins associated with it.