Explaining Distributed Data Consistency to IT novices? Well, …

Greek Shepherd

it’s all greek to me. Bruce Stidston cited a post on Google+ where Yonatan Zunger, Chief Architect of Google+, tried to explain Data Consistency by way of Greeks enacting laws onto statute books on disparate islands. Very long post here. It highlights the challenges of maintaining data consistency when pieces of your data are distributed over many locations, and the logistics of trying to keep them all in sync – in a way that should be understandable to the lay – albeit patient – reader.

The treatise missed out the concept of two-phased commit, which is a way of doing handshakes between two (identical copies) of a database to ensure a transaction gets played successfully on both the master and the replica sited elsewhere on a network. So, if you get some sort of failure mid transaction, both sides get returned to a consistent state without anything going down the cracks. Important if that data is monetary balance transfers between bank accounts for example.

The thing that impressed me most – and which i’d largely taken for granted – is how MongoDB (the most popular Open Source NoSQL Database in the world) can handle virtually all the use cases cited in the article out of the box, with no add-ons. You can specify “happy go lucky”, majority or all replicas consistent before confirming write completion. And if a definitive “Tyrant” fails, there’s an automatic vote among the surviving instances for which secondary copy becomes the new primary (and on rejoining, the changes are journaled back to consistency). And those instances can be distributed in different locations on the internet.

Bruce contended that Google may not like it’s blocking mechanics (which will slow down access while data is written) to retain consistency on it’s own search database. However, I think Google will be very read heavy, and it won’t usually be a disaster if changes are journaled onto new Google search results to its readers. No money to go between the cracks in their case, any changes just appear the next time you enact the same search; one very big moving target.

Ensuring money doesn’t go down the cracks is what Blockchains design out (majority votes, then change declines to update attempts after that’s achieved). That’s why it can take up to 10 minutes for a Bitcoin transaction to get verified. I wrote introductory pieces about Bitcoin and potential Blockchain applications some time back if those are of interest.

So, i’m sure there must be a more pithy summary someone could draw, but it would add blockchains to the discussion, and probably relate some of the artistry behind hashes and Git/Github to manage large, multiuser, multiple location code, data and writing projects. However, that’s for the IT guys. They should know this stuff, and know what to apply in any given business context.

Footnote: I’ve related MongoDB as that is the one NoSQL database I have accreditations in, having completed two excellent online courses with them (while i’m typically a senior manager, I like to dip into new technologies to understand their capabilities – and to act as a bullshit repellent!). Details of said courses here. The same functionality may well be available with other NoSQL databases.

Blockchain: the ultimate and positive chaotic disruption

Light Bulb Lit Up

The future is here. It’s just not evenly distributed yet“. Those were the words of Tim O’Reilly, owner of O’Reilly, producer of many of the definitive books on software systems and associated conferences. His company’s Radar blog is also noteworthy for it’s excellent peeks into the future of high technology related products and services. One subject seems to pass it by, and I can’t help think the implications are much more significant than people really comprehend yet; that of the technology that sits behind Bitcoin (Bitcoin itself is but a small part of it).

The mechanics of Bitcoin are described in the original Satoshi Nakamoto paper here. Alternatively, an earlier introductory blog post from me.

The main truly disruptive innovation with much wider utility is that of a Blockchain. A public record that is stored across many hundreds or thousands of machines, in hundreds of different legal jurisdictions, but together forming a definitive record of activity without any central control. A sort of ledger that lives in the worlds commons, and operable in a way that ensures a single digital object cannot be “double spent”; only transferred between entities.

Much of the economic activity in the world is currently served by institutions who possess “choke points” through which activity is carried and who charge (in some way) at the gate. If I want to send cash to someone, I typically pay commission or transaction charges to a number of institutions to do so. There are many areas that could be unleashed when transaction costs tend to zero and the record of some activity is stored in a publicly accessible entity without any central control:

  • Proof of Existence. One of the innovations of GIT (the Source Code Control System written by Linux author Linus Torvalds) is that every individual document/file is recorded in it’s database as a “hash”. When any piece of Digital material is passed through this piece of maths, the hash is a 8 byte “signature” that is effectively unique (the change of two random documents having the same hash is circa 1 in 83 million). So, you can immediately see, with very little comparison work, whether two documents are exactly the same or different. Manuel Araoz, a 25-year-old developer in Argentina, uses a blockchain to prove authoritatively that you had a specific document in your possession on a specific date, without having to publicly publish it’s content. The fact that electronic signatures can be part of the document being held (and hashed with the rest of its surrounding content) means that you have a distributed contract “system of record”.
  • Namecoin. The current Domain Name System (DNS) is effectively the web’s telephone directory that translates memorable names (like www.bbc.co.uk) into the Internet Protocol Address(es) at which that web site resides (in this instance, and 10 others). However, the central repositories where this information is stored can be systemically blocked or willingly corrupted by owners of the various choke points, or the governments under whom they operate from a legal jurisdiction perspective. Namecoin is an attempt to mirror the DNS in a widely distributed blockchain, with domain names ending “.bit”, and hence operationally difficult to corrupt or censor. Although I have no useful application for it at this stage, I have already registered “ianwaring.bit” to reserve my presence there.
  • Music Distribution. Following a Kickstarter type model, would you like to buy shares in a specific musicians new song? That way, you’d see a return on your investment if it proved popular and you managed to help promote it widely to a bigger audience. Piracy in reverse! The Blockchain protocol does have the ability to run such Assurance Contracts (ie: this project is funded only if pledges of a specific value are achieved by a certain date, or annulled if the target is not met by then), so there are similar precedents for Venture Capital, or even what has to date been tax funded Government projects for the public good. I sometimes wonder how HS2 would do if the UK Government ran the whole thing as a Kickstarter project, and see if the beneficiaries were willing to put money where their political mouths are!
  • Voting. One of the ultimate choke points where MPs act as a proxy for the voters in a geographic area they represent for a multi-year term. The act of multi-year elections is probably an edge case; it’d be more radical if I could choose when I want my MP to act as my proxy and when I wish to register my share of the decision making process personally instead. I somewhat doubt that folks currently in Westminster would wish to put their constituents in control of their own interests, despite how refreshing and re-engaged we’d feel as a result.
  • Vendor Relationship Management. This is the ultimate result of Doc Searl’s work on VRM, where we ask commercial entities to bid for our business. Given the low or zero transaction cost, you could delegate a lot of the associated work to software agents if the product or service was a commodity. Like a Taxi or self-driving car, as given in this excellent 25 minute talk by Mike Hearn, an ex-Google employee (it is a great talk to listen to – not least the effect when some of the actors in transactions are machines themselves, complete with their own bank accounts and long term trade related decision making). Even Yelp, TripAdvisor or Social Media recommendations would be more plausible if subjected to the authoritative “someone I can trust” standards that the underlying technology can provide.

I’d thoroughly recommend this article on Business Insider, which does a great job of highlighting some of the possibilities.

There are many challenges ahead. Some regulatory (I hope Politicians and our Public Servants do act in our long term best interests, without being victim of the lobbying of interests rendered on the wrong side of , or distorted out of shape, by a drive for our mutual good). Some technology (things like Bitcoin will need improvements to bring down the current 10 minute delay to provide definitive authentication, and to handle an increase in Blockchain size to handle the transaction volumes currently seen by Mastercard and Visa networks). But the potential applications are dizzying both in number and of disruptive impact to everyone.

As Fred Wilson, notable VC, said recently: Let’s go back and revisit the big innovations on the commercial Internet over the past twenty years. TCP/IP, HTTP, The Browser, Search, Social, Mobile, Blockchains. Each one of those innovations drove an investment cycle. Our 2004 fund was built during social. Our 2008 fund was built during social and the emergence of mobile. Our 2012 fund was built during the mobile downturn. And our 2014 fund will be built during the blockchain cycle. I am looking forward to it.

Bitcoin (which I described in greater detail here) was only the start. The main challenge now is one of identity, and protecting it from interlopers. You have to keep your private key insanely private (even to the extent of keeping it off Internet connected machines), as that is your definitive personal identifier that someone else could use to masquerade as the real you everywhere online. At least until something can check your own physiology (it is really you), and your state of mind (you haven’t been sectioned, frail nor threatened), prior to any transaction being authenticated. Or is that what the Apple iWatch will be all about?

Introduction to Bitcoin

BitCoin Coin

Bitcoin appears in the news often these days. I’ve found two resources that give an excellent overview of what it’s all about.

The Book

One is a self published Kindle book by David Seaman (not the ex-Arsenal goalkeeper) that – when I bought it – was 27 pages long and £2.51 to buy. As an aside, isn’t it great that publishing economics are such that you can buy a concise book with no useless “filler” to unnecessarily increase it’s page count? The book is:

A Talk

Alternatively, if you prefer to listen – particularly if you have a long train or car journey, I recommend one of the recent John Gruber Podcasts, entitled “Mind of a Gambler”. That’s not in itself a reference to Bitcoin, as he and guest Glenn Fleishman spent the first segment of the show talking about the game of Jeopardy, and then the best strategy when playing BlackJack. That included the findings of an IBM statistician (proven by getting a computer to play millions of games under different player strategies) that you should fold your hand as soon as you get two cards adding up to 12 or above, ie: not to twist if there’s any chance that the next card you twist could make you exceed 21. While it looks odd to quit so early to other human players, it is in fact the strategy that maximises your income on the table. But I digress.

The whole John Gruber “The Talk Show – Mind of a Gambler” (Show number 74) podcast can found at: http://www.muleradio.net/thetalkshow/74/. His guest is Glenn Fleishman, who has written articles for several publications, including The Economist, on the subject of BitCoin. The whole Podcast is 2 hours 24 minutes long, but the part pertinent to Bitcoin is between 26:28 to 1:55:22 – so about 90 minutes long.

Alternatively, if you prefer talks with pertinent slides as a subject expert goes along, there is a good YouTube video that summarised Bitcoin to students at Stanford University, given by one of their Chinese Alumni, Bobby C Lee. You can watch the presentation here; it’s under 75 minutes long and is an excellent summary.

Open Minded Governments (Seriously!)

It’s been really surprising to find how open minded some government institutions are about Bitcoin and other similar “Crypto” currencies – particularly in the USA and in China. A total polar opposite to the norms of the sensationalist tabloid press (who, at this time, are unusually quiet).

How it works

The central tenet of these currencies is that your “cash value” is stored as sophisticated, long number which only you can transact.

When you want to transfer any value to another party, you have to sign the transaction with a long private alphanumeric key (known only to you!), and details of that cash movement is recorded onto a transaction ledger. The main innovation with Bitcoin is that the ledger is viewable by anyone, and copies of it are distributed over many, many computers all over the Internet.

Once a cash transaction is made, many other computers do a complex piece of maths to keep guessing a checksum, which when one somewhere in the world successfully matches, is written back into the ledger to lock the transaction in the transaction history. This result is then written back to all the various distributed copies of the ledger, and the winner of the “be first to complete the checksum” lottery is awarded 25 BitCoins as a prize. This is what “Mining for Bitcoins” is.

The piece of the ledger currently under construction is called “the blockchain”.

Limited Reserves

There are two subsidiary characteristics of Bitcoin. One is that they’ll only every be circa 21 million bit coins minted. This is just like gold bars when major currencies were backed by country gold reserves. At one point, a UK pound or a US dollar was indicative of a share of the gold in the UK Treasury (for GB Pounds) or Ford Knox (for US Dollars). However, a more recent move was to disassociate currencies from underlying gold reserves, giving Governments to print as much money as they wanted with a value based on “trust” rather than a share of the underlying gold reserves. This has enabled successive governments to, in effect, keep devaluing their own currencies (aka “quantitative easing”), which economists have mixed views about. Some even point to what happened to the Roman Empire when such a long term devaluation strategy went to extremes. Bitcoin, by its very nature, cannot be manipulated in the same way; it is a return to the financial discipline of the Gold Standard.

“Mining” Arms Race

The other characteristic is that the processing power needed to enter the lottery to help confirm the validity of Bitcoin transactions in the current distributed public ledger “block chain” – termed “mining” – is getting ever more mathematically complex. What used to take a home PC, escalated into using the Graphics Co-Processors (which are 100’s of times faster at the calculations needed), and to running specialised “mining” computers based on ASICs (Application Specific Integrated Circuits). And people with their own specialised mining hardware started assembling themselves into co-ordinated groups (like lottery syndicates) to increase the chances of winning the blockchain lottery, even if they ended up with a small share of the 25 bitcoins on offer each time their team won.

Personal Security

From a security point of view, your Public Key is something you have to be absolutely inane to keep to yourself and no-one else. If someone else knows it, they can sign off cash transactions as if it were you. Some of the scare stories are where online wallet sites had poor security and leaked this – which is disastrous. You are heavily encouraged to keep your key offline and only to use it when you sign a transaction.

Anonymity – and concerns that go with it

One of the appeals of Bitcoin and other similar crypto currencies is that they are effectively cash, but the only public record is of transactions – not of the assets you may have associated with your private key. This has led to some concern that people can, on the one hand, claim absolute poverty, and in the next minute, throw a significant size transaction. Traditionally, there is no mapping from the owner of a public key to the real person sitting behind that ID – and hence a concern that Bitcoin could be used for illegal purposes.

A Proposal

Simon Wardley made some very valid points on his Bits & Pieces Blog yesterday (entitled “How to fix Bitcoin“) that suggested Governments should enforce a register of who physically sits behind each public key, so then their transactions would expose who they are, and who are they paying. The Chinese Government already enforce this type of registration. Given the transaction ledger is open to all, you could then ensure appropriate tax treatment; on the downside, there is then extreme transparency – anyone can see how much money you receive, how much you pay and the parties at either end of each cash move.

Gaps at the moment

While the desire is valid, I suspect a lot will depend on the veracity of Governments to monitor the creation of virtual tax entities (I think they call them Trusts, or Companies!) and to be able to routinely unwrap who the ultimate beneficiaries of trade with each are. This is a total mess in the world already, but with vested interests at all levels trying to keep the lid on what could be a sizable can of (taxes due) worms between various tax jurisdictions. The alternative is to dispense with monetary movement taxes altogether, but I suspect Simon is totally correct that the result of doing this would not be welcome by society as a whole (you’d then be taxing people on land and assets instead – and leaving insufficient funds to pay for what benefits the population at large).

The other effect is that you can see the amounts, sender and receiver metadata, but you can’t see what was physically traded in the exchange. Only the money values. However, that is why HM Customs and Excise have the powers they currently enjoy for our mutual good – the ability to go look wherever they need to without obstruction in anyones books should they suspect anything untoward exists.

No Transaction Charges!

For the time being, there are lots of positives being discussed by experts, and the market in Bitcoins (and other crypto currencies) is unregulated. You can set up an account on an exchange like Coinbase (in San Francisco, funded by VC Andreessen Horowitz) and set up a trading account to receive Bitcoins area. Effectively a Merchant account but with zero transaction charges.

The downside at the moment is that our current UK Government have hooked onto some nefarious sensationalist media claims that Bitcoin is used to trade in illegal goods, and were indicating that sites that include “Pay with Bitcoin” links as part of their “sites to blacklist” efforts with UK ISPs. Even though I have a Coinbase account set up, i’ve been reticent to put this payment option on my company web site (to pay £360 to pay for a website, at whatever the current GBP/BTC exchange rate is) for that reason alone so far.

I’m sure it will change in time when we have someone in Government with the appropriate cluestick back in the saddle.

Bright Future

For the future, if Bitcoin is to achieve the transaction volumes that Visa or Mastercard manage, the blockchains will need to grow sinificantly in size and some other approaches needed to get the transaction authorisation time down (currently it can take 10+ minutes for a Bitcoin transaction to be notified as being confirmed as complete). We’ll also likely see the unit of value drop by two orders of magnitude to be more representative of a unit of cash useful in people’s lives.

However, early days, interesting alternative approaches on the table and i’m sure an evolution into our ability to realise the potential of a crypto currency in the long term future. At that point, transferring monetary value will be as easy as sending an email – to anyone, worldwide.