Microsoft is making a blockchain that’s fit for business

Blockchain, the technology that digital currencies like Bitcoin are based on, ought to be ideal for business applications – if only it was fast enough and coped better with scale. Bitcoin, for example, could only cope with a fraction of the numbers of card transactions that Visa or Mastercard handle.

As a transparent, decentralized shared ledger that can’t be changed, blockchain systems should be ideal for, say, tracking products all the way through a supply chain, whether that’s car components, fruit and vegetables or pharmaceuticals, without waiting for all the updates to go through some central approval process.

“We think blockchain has huge potential across a whole set of industries,” Azure CTO Mark Russinovich told TechRadar Pro. “Typically, enterprises want to use blockchain in a consortium environment, where there are multiple parties, different organizations or different groups in the same organization who want to get rid of the friction of a centralized ledger, or a consortium where there’s no single authority that everybody trusts to maintain the source of truth.

“Blockchain, distributed ledger, gives them an opportunity to get rid of the middleman and have full transparency about the interactions between different organizations.”

Key problems

But businesses that have been trying out blockchain systems have been running into some key problems that Microsoft’s new open source Coco Framework is designed to solve. The first thing is to get rid of the compute-intensive proofs of work that make Bitcoin mining use so much energy, and slow down transactions because everyone in the consortium has to calculate them all.

“If you’re using a proof of work like the open source Ethereum ledger you end up having very high latencies and low throughput and the consensus algorithms take time to converge,” Russinovich explained.

Ethereum mines blocks about every 10 seconds, so the latency is 10 to 20 seconds and the throughput only 15 or 20 transactions a second, he estimates. In practice, the latency can be close to a minute. “If you want to wait for a transition fully committed on the network, you're typically waiting for multiple blocks to be mined on top of the one you're interested in, to make sure it's not going to be undone because there was a split in the network and another longer blockchain ends up winning, invalidating the one with your transaction in.”

This is further complicated due to smart contracts that need to refer to information that changes over time – like currency rates or LIBOR – or to information from a database that’s only available inside one company, because the validation nodes calculating the same transaction won’t get the same information at the same time if they don’t have access to the database.

Managing who’s part of a blockchain consortium is also complicated, because you have to distribute keys to new members – and try to remove them from anyone who leaves.

Coco is significantly faster than Ethereum because it doesn’t waste time on proof of work

Faster and fairer

Microsoft’s Coco Framework solves all those problems by replacing the tedious proof of work computation with trusting submissions to the ledger because they come from a ‘trusted execution environment’ (TEE) secured by silicon. After all, if you trust the secure enclave on your iPhone to store your fingerprint and use that to make credit card transactions, why not trust the same hardware encryption to protect a blockchain transaction?

“You can put code into processor-protected memory, where nothing outside, even in the processor, can see anything that's going on; it can’t see the data or the compute that’s going on in the enclave,” Russinovich explained. That lets you build a trusted network between everyone in a consortium blockchain.

He elaborates: “You put the Coco code in the secure enclave, along with the code that implements the ledger, the transaction validation and processing of the ledger, and the smart contract runtime, plus the constitution that has the rules for how new members get added to your network and how you eject members from the network.”

The constitution includes the network addresses for everyone in the consortium. Because a secure enclave can attest to what it's got configured inside it, all the nodes can trust each other because they trust the trusted environments to protect what’s inside them (and they encrypt the transactions they send to each other).

Russinovich notes: “They trust the TEE to prevent outside tampering – so a transaction processed by one of them is simply broadcast and you use a normal quorum-based algorithm for achieving consensus like any kind of distributed system.

“You don't have to worry about hostile parties, because the network is fully trusted. That removes the need for complex proof of work mining and other complex algorithms, and that gives you throughput and latency that looks like what you would get out of any distributed database.”

Coco consensus

Note that Coco is a framework, not a ledger; in fact it uses other ledgers. Ethereum is working already, and Intel along with J P Morgan Chase are porting their ledgers to Coco – plus other blockchain ledgers will also integrate with it.

You can also choose what algorithm you want to use to achieve consensus. In one test using the Ethereum ledger in Coco, the network delivered 1,500-1,600 transactions per second with latency between 100-200 milliseconds – far faster than Ethereum itself running on the same hardware. Russinovich says Coco will also scale to networks with hundreds of thousands of participants.

Because each transaction is only calculated once, time-sensitive or restricted data isn’t a problem either. As long as you see all the same transactions on every node and there’s no double spending, it doesn’t matter what order they arrive in (so you can have the flexibility to deal with network faults and nodes that are only online during business hours, for example).