Showing posts with label Bitcoin. Show all posts
Showing posts with label Bitcoin. Show all posts

Tuesday, October 18, 2016

“The Business Blockchain” by William Mougayar

Amazon link

Bitcoin emerged on the scene in 2009, the first digital currency to achieve lift-off. Satoshi Nakamoto's brilliant innovation was to make the transaction the central concept. The Blockchain is a complete record of every Bitcoin transaction ever carried out. The wallet containing ‘your Bitcoins’ is a secondary construct, computed from scanning the public Blockchain on the Internet and adding up all the ‘unspent transaction outputs’ which have one of your Bitcoin addresses as a recipient.

The Blockchain is public, duplicated on all full Bitcoin nodes (i.e. computers), and the transactions, organised in blocks, are unencrypted. Yet transactions are still sufficiently secure and anonymous – the architecture and protocol design to accomplish this is both complex and amazing. It soon occurred to people that the Blockchain concept could be repurposed to support other services across the public Internet: the management of contracts, the administration of digital identity, healthcare records.

Just as the public Internet spawned private Intranets and business-ecosystem Extranets, Blockchain technology has begun to interest companies looking to exploit a robust, decentralised ‘smart database’ function internally, or with their customers/suppliers. We are in the earliest days of this new network technology and many, even basic, questions of architecture, design, implementation and operation are deeply unclear. It’s timely then, to have a book explaining the ‘Business Blockchain’.

Chapter 1 of William Mougayar’s book aims to explain what the Blockchain is all about. He uses a great many metaphors intermixed with appropriate tech buzz-words, but I don’t think the reader will be much the wiser after reading it. Saying endlessly that the Blockchain is like a decentralised database, like a shared accounting ledger, like a transaction platform, it’s a peer-to-peer network and a trust services layer is all sort of true, but leaves the reader ignorant as to how the Blockchain manages to accomplish all these marvels. It was at this point, I decided to read Andreas M. Antonopoulos's excellent “Mastering Bitcoin: Unlocking Digital Cryptocurrencies” which made everything a lot clearer (the book is accessible to non-developers).

Chapter 2 focuses on the Blockchain’s role in distributing trust. In Bitcoin, trust is about ensuring that someone who pays you has a right to the Bitcoin they’re sending you, and that they can’t spend that amount twice. There are specific mechanisms involving digital certificates and the Blockchain mining protocols (producing ‘confirmations’) which implement the trust relationship. The author doesn’t engage with these issues, however. Instead we get lots of cotton wool marketing speak, essentially hand-wavy boosterism for how wonderful the Blockchain model is, leading to further and rather vague excitement about Ethereum-style smart contracts (no details). The ratio of useful-ideas to words-expended is particularly low in this chapter.

Chapter 3 is a simple ‘innovator’s dilemma’ style essay on Blockchain acceptance. We are in the earliest stages of take-up, mostly because Blockchain architectures and implementations are very new and there are plainly many issues in adapting these ideas to other application areas, and up-scaling the platforms. This is entirely normal – most new technologies go through a phase where the technical guys have to link up with the business strategy guys to research possible new solutions. I think I just summarised that chapter.

Chapter 4 is entitled, ‘Blockchain in Financial Services’ and starts with an overview of the Banking and Financial Services industries’ responses to the Internet (less than impressive). There then follows a list of financial services where you could imagine Blockchain technologies having an impact with a few summary examples of exploratory prototypes. Regulation is correctly identified as a major constraint for Blockchain-type architectures. The chapter ends with a little more boosterism, although the truth is that all major financial institutions have already set up task forces to research this area. As before, there is no real content to this chapter.

The short chapter 5 looks at some more far-out examples of Blockchain-powered applications, specifically the ‘Distributed Autonomous Organisation’ (DAO) based on smart contracts and pioneered by Ethereum: again, very hand-wavy and speculative, with no depth.

Chapter 6, ‘Implementing Blockchain technology’, advises your organisation to appoint a “Blockchain Czar” to get things moving, and then lists all the requirements for a successful software project - which would apply to any new development programme: statements of the blindingly obvious, really.

The final chapter, ‘Decentralization as the way forward’, is an unashamedly utopian vision of 2025, when Blockchain-powered, decentralised crypto-services will have transformed the world.

No they won’t.

In summary, this book is superficial boosterism expressed in crass marketing-speak. The reader, far from being enlightened, will end up more confused than ever. My advice is to find a text which explains – in conceptual outline – how the Blockchain (and its main application, Bitcoin) actually works (Wikipedia is not bad). You will then be in a position to assess whether this model has any application for your business. Unless you are a disruptive, entrepreneurial innovator or a company operating in a specialist niche, you will probably correctly conclude that it is too early to tell. Ask the strategy guys to keep an eye on it. And save your money on this book.

Sunday, October 16, 2016

The Bitcoin Transaction Process Model

The process of setting up and validating a Bitcoin transaction is complex and seems under-explained in the literature. For what it's worth, here is my own attempt to figure it out.

Some caveats. I have oversimplified, not taking account of transaction fees. I have not tried to be faithful to the syntactic format of a transaction; I'm after maximum conceptual clarity.

As is traditional, Alice is going to pay Bob 12 milliBitcoins, which I estimate today is worth £6.36.

The idea of Bitcoin is that everything is transactions. For Alice to pay Bob, someone else must have already paid her. I'm going to make it real easy and assume Alice has already received a single payment (from someone else) of 12 mBTC - this is called an 'unspent transaction output - UTXO', and she is merely going to 'pass along' that 12 mBTC to Bob.

---


This is how Alice got her 12 milliBitcoins

The transaction I'm calling TX: Pre was set up by someone else to pay Alice 12 mBTC. The payment was to Alice's Bitcoin address, a designator (like a bank account), which was constructed by hashing one of Alice's Public Keys and encoding it into an alphanumeric format (Base58). There are no security issues here, Alice published this Bitcoin address freely to accept payments. It all worked.

---


Alice constructs a transaction to pay Bob 12 mBTC

So TX: A2B (my name for the purposes of this post, not a Bitcoin term) is a new transaction. Alice (Alice's wallet software in fact) first inserts a pointer to TX: Pre, to its location on the public Blockchain - recall this is the source of Alice's 12 mBTC.

Secondly, she combines (most of) the fields in TX: Pre along with Bob's Bitcoin address to produce a hash code. This is then encrypted with her Private Key (corresponding to the already mentioned Public Key) to produce a digital signature. Only Alice can produce this digital signature as only Alice knows her own secret private key.

She then adds Bob's Bitcoin address as the destination, the amount of 12 mBTC to pay, and some other stuff (of course!) and the transaction is now ready to be launched onto the Bitcoin peer-to-peer network. Every node that receives it will check the transaction for validity (there are many checks in fact).

---

How can the Bitcoin network ensure Alice is the only one who can spend that 12 mBTC on prominent public display on the Blockchain as TX: Pre? Note that like all transactions on the Blockchain, TX: Pre is read only and cannot be altered. To do so would constitute a successful attack on the Blockchain - the 'confirmations' mechanism is one way this risk is mitigated.




The transaction validation  process model (carried out by all full nodes) 

A validating node (including Bob, who has perhaps the greatest interest in determining that Alice is legitimately able to pay him) first repeats Alice's hash.

TX: A2B has a pointer to TX: Pre so this can be retrieved from the public Blockchain and concatenated with Bob's Bitcoin address which is stored in the 'output locking script' part of TX: A2B. So these two items of data are hashed.

At the same time, Alice's public key (in the 'input unlocking script' of TX: A2B) is used to decrypt Alice's digital signature, uncovering Alice's original hash. If the two hashes are equal, this proves that Alice originated this transaction.

We finally make sure that Alice's Public Key (which we know to be valid because it unlocked Alice's digital signature) matches Alice's Bitcoin address (the latter is a hash of the former) from TX: Pre. Once this is done we are assured that the Alice who was the recipient of 12 mBTC in TX: Pre is the same Alice as the one who has originated (and signed) TX: A2B.

Bob can breathe a sigh of relief.

Note that formally, the above validation procedure is a concatenation of the 'input unlocking script' from TX: A2B and the 'output locking script' from TX: Pre.

And once TX: A2B has been lodged on the public Blockchain, transaction TX: Pre will be 'chained' to it, so will now be considered 'spent'. No-one else can spend it.

---

If anyone sees an error in this account which is more than just sloppy over-simplification, I'd be grateful if you could put something in the comments and I will fix it.

You may also be interested in my review of "Mastering Bitcoin: Unlocking Digital Cryptocurrencies" by Andreas M. Antonopoulos, and the diagram (from Satoshi Nakamoto's original paper) there.

Bitcoin: the suits move in

From The New York Times (Oct 11th 2016) via Marginal Revolution: "Central Banks Consider Bitcoin’s Technology, if Not Bitcoin".
"Bitcoin was created by libertarian-minded programmers with a deep suspicion of central banks and the national currencies they issue.

"Yet it is central banks that are doing some of the most ambitious work of late in trying to harness the technology introduced by Bitcoin.

"The central bankers do not want their institutions to own or use Bitcoin itself. Instead, they hope they can use the decentralized method of record-keeping introduced by Bitcoin — known as the blockchain or distributed ledger — to complete and record transactions in the real economy more efficiently, quickly and transparently.

"The most enthusiastic central banks — including the Bank of England and the People’s Bank of China — have discussed issuing their national currencies onto some sort of distributed ledger, a name that comes from the concept of several parties keeping records simultaneously.

"Blockchains allow several players to keep a shared spreadsheet using cryptography and so-called consensus mechanisms that provide a way to agree on which transactions happened at what time.

"For the central banks, the promise of the technology is that it would allow them to track every pound or renminbi on every step of its travels through the financial system in real time — something that is impossible now. The goal would be to make the financial system more transparent, fast, efficient and secure.

"If the central banks succeed, it would be one of the greatest unexpected twists in new technology: An invention aimed at dethroning central banks and making it harder for money to be tracked instead ends up empowering those central banks and making money more easily traceable.

"The Bank of England has produced several research papers on the topic. One suggests that the economic benefits of issuing a digital currency on a distributed ledger could add as much as 3 percent to a country’s economic output, thanks to the efficiency it could offer."
Inter-bank settlements and a means to ensure "a financial system that does not go down even if the central bank’s computer systems are temporarily taken offline," seem to be important drivers.

Friday, October 14, 2016

"Mastering Bitcoin: Unlocking Digital Cryptocurrencies"

Amazon Link

Anything digital can be copied, indeed duplicated endlessly, while the Internet is full of bad people. It's clear that designing digital money to be exchanged anonymously over the public Internet was never going to be easy.

Bitcoin (and similar digital cryptocurrencies) have to solve a number of problems: security of the contents of your 'wallet', trust between buyer and seller, the integrity of the currency itself. Any robust solution is plainly going to be both complex and counterintuitive.

Bitcoin's key architectural innovation is the blockchain: a list of every transaction which has ever occurred. Transactions - as they occur - are broadcast across the peer-to-peer network, validated by each node, assembled (for a fee) by 'bitcoin miners' into a new block which is then rebroadcast (there's a kind of race to finish a new one), the new block being finally stacked by each full node onto its local copy of the ever-growing blockchain. The protocol provides mechanisms to ensure global consistency as divergences (forks) are quickly damped out.

Transactions are protected (signed) by private keys (permitting you to spend your own coins) and public keys - used to construct bitcoin addresses (like bank account numbers) to which payments are addressed, and also serving to validate signatures.

The mechanism is illustrated by this diagram from Satoshi Nakamoto's original short paper (PDF) which has taken me hours to properly understand.

The bitcoin chain of ownership

There are endless overviews of bitcoin which handwave about how it works. You will never understand bitcoin that way, because the reason it works is in the detail. Andreas M. Antonopoulos's book contains that detail and is accessible if you already know about public key cryptography, cryptographic hashing and digital signatures.

The book itself is focused on developers - plenty of code examples - and is weaker on the overall architecture and those essential usage models. However, if you read it alongside Satoshi Nakamoto's original paper and the Wikipedia article on bitcoin, then you will get there -- and be both amazed and impressed.

Monday, October 10, 2016

Diary: blockchain + becoming a hipster



As mentioned in my previous post, I started reading the above thinking it would explain about Bitcoin, Ethereum and the blockchain. Sadly, I was mistaken. It's a business book with the same airy hand-waving that you get in popular science books 'explaining' quantum mechanics to the unwashed.

I decided I had to read this first (always O'Reilly!).


Amazon link

So far it's excellent although conceptually deep. You need to know about public key cryptography, digital signatures and hashing as prerequisites; I read with Wikipedia open on my other screen-based device (Base58? Remind me).

When I'm done with Mr Antonopoulos I'll return to Mr Mougayar.

Update: here's my "Mastering Bitcoin" review.

Bitcoin and similar have something else in common with quantum mechanics. Many people have a vague semi-familiarity with both topics (shared ledger, peer-to-peer; probabilities, collapse-of-the-wave-function-whatever-that-is) but to get to a proper understanding takes really significant hard work and the assimilation of a number of difficult intermediary concepts.

Finally, the student does 'get it':

"Finally I understand how [the blockchain; quantum mechanics] really works!"

And then they find they can't explain it to anyone who hasn't shared their arduous journey.

---

A Mummer's Farce

Could someone explain why BBC and ITV news presenters are using their facial expressions, tone of voice and body language to indicate the authorised emotional reaction to news items?
  • "Donald Trump said ..." - the face contorts into refined distaste; 
  • "Refugees in 'The Jungle', Calais ..." - the face beams as if an indulgent relative; 
  • "Britain has just won another Gold medal at ..." - official joy, rejoice!
I'm sick of this manipulative, insinuating nonsense; you?

---

Hipster
"The hipster subculture is composed of affluent or middle class youth who reside primarily in gentrifying neighborhoods. It is broadly associated with indie and alternative music, a varied non-mainstream fashion sensibility, vintage and thrift store-bought clothing, generally progressive political views, organic and artisanal foods, and alternative lifestyles. The subculture typically consists of white millennials living in urban areas."
I'm considering becoming a hipster. I already have the physique I think (do you like the new exercise bike?).

Amazon link

The concept of 'hipster' is an example of what Wittgenstein called a 'language game'. There is no one set of necessary and sufficient defining conditions: you don't need to have your slim jeans rolled up or to wear a plaid shirt - although these things help. Nor do you need a beard (though that certainly helps!) or serve in an artisanal cafe, or be fascinated by all things wood.


Somehow I have to stop being my father: green Gore Tex anorak, beige trousers, dad-trainers (above). I won't get everything right: I can't imagine doing the rounds of the charity shops.

I think my lunge for full hipsterdom may start at a large Bristol department store.

Thursday, October 06, 2016

Go Geth Ethereum

Amazon link

I was enrolled into the Amazon Vine programme back in 2008 (Amazon post a list of stuff they want reviewed tailored to your interests, you choose an item, they send it to you for free, you review it). In the old days there was a monthly email but that, for some reason, got discontinued. I assumed the Vine scheme had lapsed.

Still, you continue to get personal kudos, even on reviews for products you paid good money for.




But Vine is not dead - you merely have to hunt a bit for the obscured product page. Most of my items there seemed bizarre: Mills and Boon style romances, children's books, iPhone covers .. but there was one which looked tolerably interesting and I selected it, half-thinking to test whether Vine was still working for me.

"The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology" by William Mougayar  (Author), Vitalik Buterin (Foreword), arrived yesterday afternoon.

Vitalik Buterin is a 22 year old wunderkind and a founder of Bitcoin and Ethereum.

Ethereum? I knew I had heard something about that recently. I vaguely recalled it was 'bitcoin on steroids', a blockchain with added scripting language which had been hacked! Since the code was meant to be authoritative, no-one knew what to do about that at the time.

Synchronicity. SSC pointed to this breathless tech-journalism and I was transported back to the land of Neal Stephenson: 'Snow Crash' and 'Cryptonomicon'.
"It’s 4am and I’m sitting in a hotel room in Shanghai, China. The second ever Ethereum developers conference is set to kick off in a few hours. The time-zone shift woke me up early, and I’m sitting in my bed playing with my newly modded phone. The Chinese government censors most large American mobile apps behind something colloquially referred to as “The Great Firewall” so you need to use all of these shoddily made, Chinese government approved, replacement apps instead.

"The preferred app for messaging is an app called WeChat, a bizarre Slack / Venmo / Tinder hybrid that 800 million people use to communicate every day. We have a group chatroom for the conference going, which I’m scrolling through when my phone buzzes. Someone posted a new message. “The Ethereum network is under attack”.

"Ethereum is this insane thing going on in the tech world right now. It’s a new cryptocurrency that is picking up the pieces of the fractured Bitcoin ecosystem and trying to succeed in accomplishing what Bitcoin has failed to do, deliver the first batch of successful consumer applications built on top of blockchain technology. You can think of Bitcoin a bit like a shared google doc spreadsheet that anyone in the world can send data to, one global ledger of accounts and balances. Ethereum builds on this idea by providing a mechanism for users to add custom formulas into the cells.

"Anyone who has done any kind of Microsoft Excel programming knows how powerful spreadsheets can become with just a few simple formulas. Ethereum is the first working implementation of programmable money, a simple concept that may one day bring the entire global financial system to it’s knees. And it draws brilliant people from all walks of life into its orbit.

The 4AM attack on the network is bizarre in that it’s not really a malicious hack, but more like comical mischief. Ethereum runs as a distributed system. At any given time, there will be thousands of separate computers (also called nodes) running the Ethereum protocol and keeping the network online. The actual software that the computers use to run the Ethereum protocol comes in many different flavors, the most popular one is an application called Geth, written in Google’s Go programming language. 85% of all Ethereum nodes are running Geth at the time.

"The attack pushes a piece of data onto the blockchain that exploits a bug in the Geth software causing the program to crash. Because every live node syncs the latest version of the blockchain in real-time, just like that 85% of the Ethereum network goes offline. Some developers are able to respond by switching over to the Parity Ethereum client, a new client written in the high-performant Rust Language that is currently gaining market share, but for others switching over to Parity is too risky without having time to run extensive testing. The Ethereum network is essentially frozen until an update can be pushed to Geth.

"The main developers of Geth are asleep in Shanghai. They might not even have their laptops with them, as it’s risky to take your work computer into mainland China if it contains any sensitive information. They’re also scheduled to go on stage and give a presentation in a couple hours. When they wake up, do they fix the bug and miss their talk or go onto the stage? Like I said, comical mischief."
And so it continues.

I can hardly wait. My review should be up in a week or so.

More.