Page 43 - MSDN Magazine, July 2018
P. 43

Figure 8 A Ballot Contract in Solidity Code
• Throughput and latency approaching database speeds
• Richer, more flexible, business-specific confidentiality models • Network policy management through distributed governance • Support for non-deterministic transactions
• Reduced energy consumption
It’s important to note that Coco isn’t a standalone blockchain protocol. Rather, it provides a trusted foundation with which existing blockchain protocols such as Ethereum, Quorum, Corda and others can be integrated to deliver complete, enterprise-ready ledger solutions. Coco is designed to be open and compatible with any blockchain protocol. It achieves this through the use of trusted execution environments (TEE), such as Intel Software Guard Exten- sions (SGX) and Windows Virtual Secure Mode (VSM), to enable the creation of a trusted network of physical nodes on which to run a distributed ledger. Figure 9 shows the Coco Framework architecture.
Coco provides code assets and ARM template deployment scripts for the scaffolding needed to create a blockchain network, gateway API and Web application. It also provides for Azure AD and Azure Key Vault integration, and supports SQL databases for collecting on- and off-chain data. Finally, it provides sup- porting code and services for block hashing and signing. Coco uses Azure Event Hubs at its core to add new capabilities, such as sending raw data to Azure Data Lake or providing transaction data to Azure Search.
Coco makes it possible to create blockchain applications without writing any code. It uses the metadata provided for smart contracts to dynamically deliver a contextual UX for participants. Because the framework populates SQL databases as an off-chain store, it enables an organization to leverage existing skills and tools to light up additional capabilities such as APIs, PowerBI reporting, chat bots, Azure Data Factory and machine learning.
Microsoft plans to open source the Coco Framework code later in 2018.
Finally, a word on Azure Blockchain Workbench, which is the primary mechanism for enterprise customers getting started with blockchain. Azure Blockchain is a collection of Azure services and capabilities designed to help enterprises create and deploy a new class of applications for sharing business processes and data with multiple, semi-trusted organizations. Currently, customers can deploy these services into their subscriptions and integrate them with blockchains available on the Azure Marketplace. With Azure Blockchain Workbench the heavy lifting is done for them, so they can focus less on scaffolding and more on logic and smart contracts.
Azure Blockchain Workbench is available now in the Azure Marketplace (aka.ms/tryworkbench). n
Stefano tempeSta is a Microsoft Regional Director and MVP, as well as chapter leader for CRMUG in Switzerland, the largest community of Dynamics 365/ CRM experts in the world. Tempesta is an instructor of courses about Dynamics 365, blockchain and machine learning, and a regular speaker at international IT conferences, including Microsoft Ignite and Tech Summit. He founded Blogchain Space (blogchain.space), a blog about blockchain technologies, writes for MSDN Magazine and MS Dynamics World, and publishes machine learning experi- ments on the Azure AI Gallery (gallery.azure.ai).
thankS to the following Microsoft technical experts for reviewing this article: James McCaffrey
July 2018 37
pragma solidity ^0.4.0; contract Ballot {
struct Voter { uint weight; bool voted; uint8 vote;
}
struct Proposal {
uint voteCount; }
address chairperson; mapping(address => Voter) voters; Proposal[] proposals;
/// Create a new ballot with different proposals function Ballot(uint8 _numProposals) public {
chairperson = msg.sender; voters[chairperson].weight = 1; proposals.length = _numProposals;
}
/// Give a single vote to the given proposal function vote(uint8 toProposal) public {
Voter storage sender = voters[msg.sender];
if (sender.voted || toProposal >= proposals.length) return; sender.voted = true;
sender.vote = toProposal;
proposals[toProposal].voteCount += sender.weight;
} }
and the proposal counter is increased, considering a weight for the vote itself. Figure 8 shows the code for this.
Please note that this is Solidity code, a strongly typed language with JavaScript-like syntax, with a few variants, like the contract, struct and address keywords, or the triple slash (“///”) for a comment. I use Ethe- reum Remix for development of smart contracts in Solidity, which provides a Web-based IDE for development, testing and deployment.
Azure Blockchain vNext
Let’s look at what the future looks like in the Microsoft vision for blockchain technology. Coming soon, the Microsoft Confidential Consortium (Coco) Framework is an open source system that enables high-scale, confidential blockchain networks that meet all key enterprise requirements for confidentiality, governance and performance, and at the same time provide a means to accelerate production enterprise adoption of blockchain technology.
Coco (bit.ly/2Ior8YA) brings together the power of existing block- chain protocols, trusted execution environments, distributed systems and cryptography to enable enterprise-ready blockchain networks that deliver:
dApp dApp dApp dApp Ethereum Quorum
dApp dApp dApp Corda
dApp dApp ...
Coco Framework
TEE (Intel SGX, Windows VSM, ...)
Figure 9 High-Level Overview of the Coco Framework msdnmagazine.com
Hyperledger Sawtooth


































































































   41   42   43   44   45