Page 44 - MSDN Magazine, October 2019
P. 44
BLOCKCHAIN
Exploring Blockchain
Consensus
Erik Zhang and John deVadoss
Blockchain platforms have led to incredible advances in designing and developing decentralized applications and systems, and have been applied toward domains ranging from cryptocur- rencies to enterprise supply chains. While the applications are vast, they’re all based on a core set of design patterns that advance the state of the art in the theory and practice of distributed systems.
A blockchain is a monotonically increasing list of records (or blocks) that are linked together using cryptographic techniques. Blocks consist of valid transactions that are hashed and encoded into a Merkle tree, and each block contains a cryptographic hash of the previous block in the chain. This ensures the integrity of the blockchain and enables the relatively inexpensive verification and the independent audit of the transactions in each block and across the chain. A blockchain intrinsically is public and tamper-proof, meaning existing blocks cannot be altered in any manner.
Core to the blockchain is the model of the ledger, an unalterable, append-only log of the transactions that take place across various
entities. To maintain the integrity of the ledger, the various entities need a way to “agree” or to reach consensus on which set of incre- mental transactions (or blocks) are to be appended to the ledger.
The consensus problem is a well-known and fundamental computer science problem in the coordination and control of multi-entity systems. A simplistic approach is of course for all the entities to agree on a majority value. However, one or more faulty entities can skew the outcome, resulting in consensus that is unachievable or incorrect.
In this article, we explore the topic of consensus for blockchains, and share a practical, real-world implementation built on the .NET Core platform using C# that’s used by the NEO blockchain, the Binance Exchange and other organizations.
Let’s start by looking at blockchain platforms, which are pro- grammable blockchains that enable developers to envision and build truly decentralized applications. These can span all manner of markets, including financial markets, gaming, enterprise con- sortiums, sports, health care networks, sovereign identities, real estate and other asset markets and more. Blockchain platforms such as Ethereum and NEO serve as decentralized application platforms that provide the foundation for a new application model for developers.
At their core, blockchain platforms are distributed systems, build- ing on a foundation of theory and practice that spans decades of computer science research. While there are many recurring pat- terns and principles, Blockchain platforms have revolutionized
This article discusses:
• Distributed systems and the state machine approach
• Byzantine Fault Tolerance and the dBFT algorithm
• Building a blockchain implementation with .NET Core and C# Technologies discussed:
Blockchain, Blockchain Platforms, C#, .NET Core
40 msdn magazine