Poetry #12: Crypto-

Oh! Crypto- you are no longer concealed
Paired with currency, you are not what it seems

I was never in it for the ride or the pride
Didn’t ever have an iota to hide

So, is there a use for you I wonder?
Or pump and dump will tear you asunder

What shall I buy, ask the newbs
HODL! says the one astute

Buy, buy, buy; it is flashing green
To the moon it shall careen

The coin of bits is still the king
But others have come along to sing

Ether shall never see its nether
Ripple is making all the waves

Request Money and you shall get
But there is nothing quite so Stellar

The bubble balloons as the tulips bloom
Is that the sweet smell of success or demonic doom?

Musing #37: Revisiting the Bitcoin Frenzy

I always thought that I was a bit late to the uptake of Bitcoins when I made my first purchase in 2015, having read about it for a long time as a technology enthusiast. However, I never imagined that the real frenzy would come much later. Along with it, comes the regret of immediately selling off the miniscule number of bitcoins I had purchased. Perhaps the bigger regret should be of not purchasing more of it and just letting it sit idle. If I remember it right, bitcoins were around the $300 mark at that time and what else would have ever provided a 10x return in less than 2 years?

While regrets live and die with the sole purpose of being detrimental, my purpose then was served which was understanding the workings of it. Of course, it came with the added benefit of arbitrage for back then the merchants that accepted it had a lower rate for BTC than for USD when converted from my local currency. My focus and hope for bitcoins was that it would be an effective alternate payment channel. Unfortunately, recent developments have shown it to not be the case.

Throughout this year, bitcoin has been in the news for all the wrong reasons which culminated in the forking of the currency earlier this month. It was this event that made me revisit bitcoins. What is now truly evident is that bitcoin has passed the point of no return in terms of being a viable alternate currency. Rather, it has become an instrument of speculation and greed. Merchant adoption has diminished with the passing of the day as the long waiting times and high transaction fees have made it the antithesis of what an ideal payment instrument should be. The only ones really vested in it are hoarders and miners who continue to thrive with each executed transaction.

For some, it would still make sense to purchase bitcoins even today, despite the fact that it saw a swing of 40-60% just in the past month (or may be because of it). A scarce resource will see appreciation in time as long as the want is there; want since no one really needs it at the moment. The association of idealism, freedom and anarchy with bitcoins has long passed. Now it is only about greed and nothing else. This is precisely the reason why I don't wish to purchase bitcoins again. However, I still see a transactional value for it since the world needs better cross-border instrument than PayPal.

This also gave me a reason to login to my years-old accounts in Indian bitcoin exchanges and see how they have fared over time.

1. Zebpay: The reasons why I had registered for it in the first place were its accessibility on the mobile, purchase price lock-in and vendor offers. Unfortunately, none of it seems to be of any value at the moment. While the main attraction in terms of purchase price protection has been discarded, it would have mattered if I could access my account in the first place. Despite contacting customer service, they haven't been able to unblock my account for over a week. The unblocking from the app fails to work as the SMS is never received (probably being sent from a number on the TRAI DND list) and the call option leads to an app error. While "caveat emptor" applies to any purchase, it seems to be particularly relevant here when you also consider the non-transparent fees and high purchase/withdrawal limitations. Definitely, a no-go for me.

2. Unocoin: You can never be too careful and in my case, it meant having to get 2FA disabled on my account, having long deleted it from my Authy accounts list. The call from customer care came within 24 hours which was a good sign considering that most wallet credits used to take a significantly long time. However, I would put this down to the fact that I did it when bitcoin trading was suspended for the fork and the customer service might not have had anything better to do. The big change that I was looking forward to was the support for PayUMoney which I hoped would finally enable me to bypass the frustrating wait for the amount to be credited to the wallet. Unfortunately, my spirits were dampened the moment I saw the 1.9% transaction fee. It just lobs the ball in my court once again and I can't simply figure out a better use case for considering Unocoin over other options.

3. Coinsecure: Since I only intend to use bitcoins for transactions, time is of the essence considering the volatility of bitcoin. In that respect, coinsecure performs really well even though it doesn't have the same accessibility due to lack of an app. The Material Design interface gets in the way more often than not, especially when there are notifications flying all over the screen like the persistent one about the fork and subsequent closure. However, my deposit through IMPS was registered in a matter of minutes and subsequent withdrawal of the same amount was executed during working hours. The real trouble was finding the matching order volume which in the least was for a few thousand bucks. I remember that in the past I could place a buy order without a matching order volume hoping for it to be fulfilled some time later, but that doesn't seem to be the case anymore. Despite this, I prefer it over the other exchanges.

There are other references that I came across such as bitxoxo but I can't be bothered to test them out for as I said before I am out of the bitcoin bubble for good. It certainly feels odd to not be part of something that is going to appreciate monetarily but then it is a matter of principle and belief, the belief that bitcoin could have been a low-cost, global payment channel. The soaring prices have tilted the scale against currency arbitrage; the high transaction fees would put PayPal to shame and the transaction times are nothing to write home about. Thus, bitcoin has become analogous to gold as a hoarder's asset, only difference being its wild swings lending it to immense speculation. Bitcoin's relative anonymity has tilted more in favour of the dark side rather than the envisaged utopia of freedom and invisible borders.

Bitcoin's lasting legacy would be the blockchain which still has a significant potential in having a real-world impact. Bitcoin itself is now no more than a game of timing and pricing, leaving the scope for the rise of a true nationless currency that is without its pitfalls.

Review #32: The Digital Money Game

I will admit that my interest in the book was piqued by the recent demonetization exercise. For most of us, digital money extends to any non-cash means of payment. Thus, in India, digital wallets like PayTM, Mobikwik and Freecharge are synonymous with digital money. However, as the book points out, digital wallets form only a small proportion of digital money which consists of any form of digital value transfer.

A thing to keep in mind before starting off with the book is that it considers its target audience to be those who are looking to enter in to this line of business more than any other subset of people. Hence, the book is not as strong conceptually as it is in helping understand the market through its myriad of case studies. It also uses a gaming paradigm which works really well. Normally, a game paradigm would work for any industry but it fits really well over here since it is an emerging and evolving industry.

Section I (The Game Space) of the book introduces the concept of digital money by dispelling the myths most commonly associated with digital money and gives an indication to the size of the addressable market. Section II (Player Perspectives) focuses mainly on the stakeholders in this sphere of business and this is where the gaming paradigm of the book comes to the fore. The inclusion of past play, current status and future play for each category of player (eg. Mobile Network Operators) puts one on a coherent path that is easy to grasp. Section III (The Endgame) of the book sets up a formal framework and explains the characteristics of digital money in further detail before laying out a future vision.

In terms of the Indian landscape, the book mentions the presence of 8 pre-paid payment providers but the only notable name included is Airtel Money. Aadhar is spoken of as an enabler though recent developments like Aadhar enabled payments don't find a mention in terms of future possibilities. ICICI Bank finds a mention because of its size. A prominent case study from the Indian perspective mentioned in the book is that of FINO which I was not aware of.

Ultimately, the book falls short in 2017 on account of being a victim of time. The latest reference I could find is from July 2014 which is a lifetime in this fast evolving sector. This anachronism is amusing in the way the book speaks of European Unity, the revolutionary Amazon Fire phone and Bitcoin. Consequently, the vibrant Indian payments landscape that has developed since is sorely absent. The book feels like a plug-in for the Shift Thought portal which itself is terribly dated. Hence, while the book is a decent read, it is perhaps worth less of the time it necessitates.

Tutorial # 4.2: Understanding cryptocurrency (Bitcoin) - The workings

As I mentioned previously (in the other post), cryptography is at the heart of a cryptocurrency. Hash functions and public-key cryptography play a key role here.

      a.  Hash function and digest: A hash function outputs a fixed sized data called digest for an arbitrary sized input. This fixed size makes it ideal as input for various mathematical operations. Hashes are deterministic (always produce the same output for the same inputs), computationally efficient (requires little computation to process) and collision resistant (difficult to find two inputs that produce the same digest). The major application of the hash function is the creation of digital signatures.

      b.  Public-key cryptography: Public-key cryptography uses a pair of keys, a public key that is known to everyone and a private key that is known only to the owner. While the public key can be used to verify the identity of the sender, it cannot be used to derive the private key and thus imitate the sender. 

First, let me cover what a transaction consists of. A transaction record covering a transaction contains an input side consisting of the digest of the transactions received the sender that are unspent. This can be used to publicly verify the amount as well as from whom the bitcoins were received by the sender. It also contains an output side which indicates to whom and how much is to be sent. Depending on the amount to be sent, multiple input transactions are combined so as to cover the amount. It is important to note that the amount so derived is to be completely spent. For this reason, the output side would most probably also include the sender along with the amount that is to be received as change. Any difference will go to the miner as transaction fee.
Eg. Alice has 50 bitcoins as a result of receiving 20 each from Carol, Dan and 10 from Erin. She is to send 45 bitcoins to Frank. Thus, all 50 bitcoins are included on the input side and 45 is included on the output side. However, Alice wishes to receive 4 bitcoins as change (with 1 contributed as transaction fee) and so will include her own name on the output side.

It is important to note here that using the names above we are speaking of virtual identities. In the cryptocurrency universe, you are only identified by your public key. Thus, the transaction record contains the public keys of the sender, from whom the sender received the bitcoins and to whom the bitcoins is being sent.

Now the public key cryptography mechanism works as follows:
  • The digest of the transaction record and the private key of the sender are mathematically combined to generate a digital signature
  • The digital signature is appended to the transaction record and shared publicly
  • The transaction record, digital signature and the sender’s public key are used by the various nodes in the bitcoin network to mathematically validate that the transaction record has indeed come from the sender.
  • Once validated, the transaction is then processed further to ensure that the payment is transferred to the receiver as per the transaction record.

The transaction validation and its recording in the public ledger takes place in the following manner.

Multiple transactions, similar to the one described above, are combined together in to a transaction block by a miner. A miner is like any other node (user or peer) in the system, but one that is specifically trying to solve a mathematical problem. Solving of this mathematical problem results in the validation of the transaction block and thus all the transactions in it.

So what kind of mathematical problem are we talking about here?

The solution to the mathematical problem involves another cryptographic concept known as proof of work puzzle. The premise here is that mathematical combination of a challenge string with proof of work has to generate a pre-defined output string.

The challenge string is basically a digest of the transaction block. The digest is calculated by hashing two pairs of transaction at a time till a single hash is obtained for all the transactions in the block. This hash in turn is combined with the hash of the previously accepted transaction block. Thus, each new transaction block incorporates the previous transaction block.

The output string in case of bitcoins has a predefined number of leading zeroes which is a condition that must be met for the mathematical problem to be considered as solved.

Thus, the proof of work is the only unknown here. The miner has to calculate this so as to be able to combine it with the challenge string and thereby produce the output string. Generation of an output string containing 40 zeroes as prefix will have 2^40 possible combinations of proof of work. Thus, you can imagine that a miner’s work is really hard. While, generating this proof of work is rather difficult, verifying it is particularly easy for one has to simply mathematically combine the suggested proof of work with the already existing challenge string and verify whether it produces the condition set for the output string (i.e. 40 leading zeroes).

The really interesting thing to note here is that the effort involved in the proof of work can easily be doubled or halved by increasing or decreasing the number of zeroes required in the output string (since 2^41 is equal to multiplying 2^40 by 2 and 2^39 is dividing it by 2). This concept is used to control the difficulty and pace of bitcoin generation as mentioned in the other post.

Generating this proof of work is akin to verifying the transaction block and thereby all the transactions within it. As each transaction block contains details of the previous block, it effectively forms a chain called as transaction block chain. As soon as a miner constructs this transaction block chain containing proof of work, it will be broadcasted to all nodes in the network. Once the newly broadcast chain is verified to contain valid transactions that are not already spent by the other nodes on the network, they will start using it and try to append their own transaction blocks to this newly verified transaction block chain. In this manner, each and every bitcoin transaction is validated and executed.

Thus, we can see that the transaction block chain contains information of all the transaction blocks and in turn of all the transactions that had ever taken place. In this context, the transaction block chain is the general ledger, the transaction block is a page in this ledger and the transactions within the block are the line items in the ledger.

Questions may arise on the possibility of simultaneous proof of work solutions, fudging of the ledger or double spending by the sender and this is tackled in the other post.

Tutorial # 4.1: Understanding cryptocurrency (Bitcoin) - FAQs

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.