Wednesday, May 4, 2016

Bitcoin, Blockchain, IoT, AI and Cloud




Bitcoin, like many transforming movements in history, started out as an esoteric ideological experiment to create “a purely peer-to-peer version of electronic cash to allow online payments to be sent directly from one party to another without going through a financial institution,as described by Satoshi Nakamoto, pseudonymous inventor of Bitcoin.
The need for digital currencies has arisen since the dawn of Internet commerce. Most prior attempts have failed, but what makes Bitcoin different is the decentralized nature of its systems -- “A lot of people automatically dismiss e-currency as a lost cause because of all the companies that failed since the 1990’s. I hope it’s obvious it was only the centrally controlled nature of those systems that doomed them. I think this is the first time we’re trying a decentralized, non-trusted based systems,” said Satoshi Nakamoto.

Creating a Digital Currency
A Bitcoin coin is defined by a chain of digitally signed blocks of transactions -- Blockchain. In a way, Blockchain can be viewed as an immutable (append only) database of linked transaction records. A new node that joins can reconstruct the current state of the ledger from Blockchain.


The Bitcoin network protocol is summarized as follows:    
  1. New transactions are broadcast to all nodes
  2. Each node collects new transactions into a block
  3. Each node works on finding a difficult proof-of-work for its block
  4. When a node finds a proof-of-work, it broadcasts the block to all nodes
  5. Nodes accept the block only if all transactions in it are valid and not already spent
  6. Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash

In a simplified analogy, it could be imagined as a dollar bill with a QR code that contains a link to a distributed network of databases with its transaction history and the signatures of “owners” -- e.g, ID’s of cash registers, wallets, bank accounts, etc. These signatures could be verified before each new transaction is accepted.  If such a system exists, there would be no robberies or thefts because the offenders would need all “signatures” of the prior “owners” to convince all nodes that their “wallets” should hold these new funds.)

The Value of a Dollar
The concept of digital money is a dubious proposition to many people since it is still outside the realm of daily experience, but if one examines the history, functions (i.e., unit of accounting, medium of exchange, and store value), and properties of money (i.e., durable, portable, and scarce) the ideas is not so far fetched. To further define value we look to Adam Smith’s “The Wealth of Nations.”

“The word VALUE, it is to be observed, has two different meanings, and sometimes expresses the utility of some particular object, and sometimes the power of purchasing other goods which the possession of that object conveys. The one may be called 'value in use;' the other, 'value in exchange.' The things which have the greatest value in use have frequently little or no value in exchange; and, on the contrary, those which have the greatest value in exchange have frequently little or no value in use. Nothing is more useful than water; but it will purchase scarce any thing; scarce any thing can be had in exchange for it. A diamond, on the contrary, has scarce any value in use; but a very great quantity of other goods may frequently be had in exchange for it.”

Currencies are created by sovereign nations with their scarcity imposed by central banks and governments -- anti-counterfeiting technologies, law enforcements, e.g. United State Secret Service and their values in exchange regulated by monetary and fiscal policies, GDP and the consensus among holders of the currencies. Fiat currencies have worked well in physical marketplaces in which money, goods and services are exchanged with counter-parties in the present, but there is friction when it comes to trades the can not be conducted in person; for example Internet commerce transactions and international trades. Trusted intermediaries such as banks and escrow services are needed to facilitate these trades and additional fees will also be obtained. However, as the financial crises in the past has shown the vulnerability of reputation and trust: e.g. the ARS (Auction Rate Securities) dealers decline to honor their promise of making the market, causing pains and grievances of securities holders and tons of lawsuits. Some politicians have advocated bringing back the gold standard; however, the value of gold, which also does not have much value in use, is a result of consensus as well with its scarcity imposed by Nature -- well, until someone manages to master the art of Alchemy. It also has high costs for storage and transportation. Therefore, bringing back the gold standard does not make much sense in the digital age.

The scarcity of digital currencies such as Bitcoin is enforced by the network’s consensus protocol, cryptography and distributed ledger - Blockchain. They enable people to transact directly without the need for trusted intermediaries. The cost for digital currencies is computing power, storage, and electricity. The current Bitcoin network is estimated to consume about a few hundred megawatts. Counterfeiting US dollar has high fixed costs but a very low marginal cost for each additional fake bill, whereas the cost of counterfeiting Bitcoin is the same or increasingly higher for each additional coin, and, arguably, a less economical incentive for counterfeiting.  


Blockchain and Smart Contracts
The success of Bitcoin has proven the potential for the creation of a resilient peer-to-peer financial system and has inspired potential disruptive applications of Blockchain, the underlying Bitcoin technology. The Blockchain is a distributed ledger of transactions that can enable the implementation of smart contracts.

How smart contracts work is described as follows.
  • Pre-written logic in computer code
  • Contracts are stored and replicated in a Blockchain
  • Contracts are executed by a network of computers (nodes on the Blockchain) and the ledger is updated (cryptocurrency payments, transfers of documents, etc).


The potential applications of smart contracts include:
  • Transfer of property titles
  • Auto-settlement of financial derivatives contracts
  • Copyrights and royalty payments
  • Inter-bank settlement
  • Gaming
  • Voting (Decentralized Autonomous Organizations)
  • IoT
Besides financial uses, the potential applications for IoT seem limitless. For example, smart contracts can be used to transfer properties, hotel check-ins or to deploy device certificates securely to different IoT devices.

For example, the transaction for Alice to sell a car to Bob and transfer the ownership and payment simultaneously without going through a centralized organization would involve the following steps:  
  1. The car that is controlled by a cryptographic key, and has its public key hard-coded, is activated upon receiving a message signed by corresponding private key.
  2. The public key is dynamically updated based on Bitcoin Blockchain.
  3. A single transaction is created that combines Bob’s payment to Alice and Alice’s ownership transfer to Bob.


Some enterprises have already implemented Blockchain into their workloads. Several Wall Street firms have started using Blockchain for credit-default swap settlements. Last year Nasdaq Linq allowed private companies to issue stocks to investors through Blockchain technology. Smart contracts are also making their way into the music industry. Ujomusic uses Ethereum’s Blockchain and smart contracts to enable artists and fans to transact directly.

IBM explores the future of IoT using a universal digital ledger, similar to Blockchain.  In their white paper, Device Democracy, IBM provides an interesting perspective for the future of IoT using a universal digital ledger.



It is becoming apparent that Bitcoin’s underlying Blockchain technology has the potential to create disruptive applications in many areas.  However, there are limitations to Bitcoin core, such as it’s ability to support smart contracts and accommodate high transaction volume and throughput.

As a result there are several new ideas for the next generation Blockchain. Ethereum, proposed by Vitalik Buterin, has been adopted widely for implementing smart contracts. Ethereum has a virtual machine that support Turing complete languages such as Solidity and Serpent to write smart contracts. The goal of Ethereum is to make it easy for anyone to build an application with Blockchain. In Vitalik’s word: “I like the idea of 12-year-olds potentially being able to build the next financial system and so forth. That’s a large part of what attracted me [to] blockchain technology.

Steps to Creating a Smart Contract with Ethereum



Linux Foundation’s Hyperledger

Hyperledger is a project sponsored by 30 founding members, intended to be a foundation for “permissioned chains” among large enterprises and trading partners. It’s distributed consensus protocol is based on PBFT (Practical Byzantine Fault Tolerant) protocol. Ethereum and Hyperledger are potentially working together for integration.  


An example use case for Hyperledger is illustrated in the figure below.

Note: The “Oracles” in the picture is not Oracle database, they are a set of specialized entities ,as in Ethereum, for holding funds for contracts.

There may be many different “permissioned” chains versus public chain such as Bitcoin’s. For example, the highly regulated financial services industry will have permissioned Blockchains. (shown in the figure below)




Blockchain in the Cloud
The combination of containerized mining nodes and public cloud would provide an easy and cost effective way for businesses and individuals to participate in peer-to-peer borderless commerce networks and enhance the resilience and integrity of the networks at the same time. Baseline Docker files are available on Ethereum Github. Microsoft’s AZURE offers Blockchain as a service (basing on Ethereum), and IBM’s Bluemix. An example Dockerfile for Bitcoin is at this link.
 
Rethinking Security
The development of Blockchain presents a new perspective on information security. The traditional wall garden approach for information security has not worked very well to increase the connected and digital society. Building systems that can be resilience under any attacks is a better strategy than the attempt to build a moat that isolates them from known attacks. Bitcoin design is a combination of game theory and crypto technology through creating technological barriers as well as decreasing the reward and increasing effort -- i.e. “proof of work” -- for attackers to compromise the network.

The recent $81 MM heist on Bangladesh Central bank might have been averted, with something like Ethereum’s multi digital signature contract with staged releasing and increasing number signatures for larger fund transfers.  There is entertaining talk from Andreas Antonopoulos -- Bubble Boy and the Sewer Rat --that may help stimulate thoughts on security.

In order for the distributed consensus network to be resilient and trustworthy, a large number of honest nodes need to verify transactions to decrease the probability of malicious nodes overpowering the network (see Anonymous Byzantine Consensus from Moderately-Hard Puzzles).

Mathematical model from the original bitcoin paper is shown as follows.

P=probability that an attacker will succeed from z block behind
p=probability of an honest finds the next block
q=probability of an attacker finds the next block

P < 0.001 when z=5 and q=0.1


Be with the Force
AI (Artificial Intelligence) , Blockchain, Cloud and IoT are forces that could converge to become a “perfect storm” of computing innovations, bringing creative destructions that would reshape businesses and societies profoundly and fundamentally. Intelligent devices can bid, trade and exchange assets automatically. For example, a self-driving car can submit a bid for the lowest price parking space nearby, and the systems that manage parking spaces will make offers. Once a trade is consummated, the transaction will be recorded through the Blockchain, and the payment and permission to use the space will be exchanged.  Technologies such as Blockchain and AI, will soon become available on the public cloud, making it easier to create new business opportunities or disrupt existing models. A paper published by two British researchers Carl Benedikt Frey and Michael A. Osborne discusses the aspects and impact of AI on the future of labor market.

What we can learn from the development of Bitcoin is the best strategy for harnessing the forces of change is to be adaptive and have the discipline and agility to experiment and learn from failures continuously and persistently -- for both businesses and people.

“I actually did [Bitcoin] kind of backwards. I had to write all the code before I could convince myself that I could solve every problem, then I wrote the paper. I think I will be able to release the code sooner than I could write a detailed spec.” -- Satoshi Nakamoto