Page 27 - MSDN Magazine, March 2018
P. 27

(such as a bank or government) to validate each transaction. Furthermore, it disintermediates transactions, making it possible to transfer digital currency internationally using a global network with no middleman involvement, such as a broker or agency. Due to its reliance on modern cryptography, the data contained in the blockchain is tamper-proof and pseudonymous. And because a given blockchain is replicated on every node that comprises its peer-to-peer network, there’s no single point of failure, making the technology available and reliable.
Since Bitcoin’s launch, blockchain technologies continue to mature rapidly. Their implementation details vary dramatically, making the study of blockchains dynamic, vast and complex. Indeed, the term “blockchain” no longer applies only to Bitcoin in particular or to cryptocurrencies in general. Blockchains are being refined and perfected so they work faster and smarter. In fact, some blockchain technologies allow scripting to support smart contracts, which permits custom rules to be applied to transactions. In this way, blockchains have morphed into a new kind of programma- ble, hacker-proof storage technology, which is one reason why IT professionals, businesses, financial institutions, and others are clamoring to harness their true potential.
If you’ve been sitting on the blockchain sidelines, it’s time to catch up. In this introductory article, it isn’t possible to cover the finer technical details of any particular blockchain technology— each has its own rules, features and customizations—but the ideas I discuss here will help orient you to the core technical underpin- nings on which many modern blockchain technologies are based.
How Blockchains Work
The Bitcoin blockchain is the world’s first practical exam- ple of blockchain technology. And because of that distinction, “blockchain” is often misunderstood as being synonymous with Bitcoin. However, modern blockchain technology offerings track digital assets other than a digital currency, and those blockchains work quite differently from the way Bitcoin’s blockchain works. Additionally, the Bitcoin blockchain popularized the notion that a blockchain is a data structure that virtualizes a bank ledger by tracking credits and debits while offering a creative, cryptographic solution that effectively bars the double-spending of crypto- currency units. For this reason, the terms “digital ledger” and “double spend” became associated with cryptocurrency blockchains. Yet these terms, respectively, broadly apply to tracking ownership and enforcing a single transfer of digital assets. When you see these terms, don’t assume they refer solely to cryptocurrency-oriented blockchain technologies.
At its essence, a blockchain is a tamper-proof data structure that tracks something of value or interest as it passes from owner to owner. That “something” can be any kind of digital asset—such as a digital coin, a Word document or the serial number of a Microsoft Surface tablet. In fact, any item that can be associated with a unique digital fingerprint can be tracked on a blockchain. Blockchains solve the so-called “double-spend” problem by requiring that ownership of a digital asset be transferred rather than copied or shared. But what makes a blockchain technology interesting is that it establishes a pro- tocol, enforces transaction rules, and is able to let the nodes on its
distributed network of computers self-police the entire operation. And it accomplishes this remarkable feat with no central server or trust authority, speedily and globally (that is, internationally). This promise excites those who see it as a way to eliminate middlemen and reduce or waive transaction fees, making commerce more efficient for businesses and consumers alike.
Blockchain Core Components
The Bitcoin blockchain network is public—anyone can participate anywhereintheworld.Yetnewerblockchainofferings,suchasthe Microsoft Azure-hosted blockchain, can be configured as public, private or permissioned networks. Blockchains are considered to be decentralized, but that term requires clarification: As Vitalik Buterin explains (bit.ly/2tEUYyT), “decentralized blockchains” means they’re “politically decentralized (no one controls them) and architecturally decentralized (no infrastructural central point of failure) but they are logically centralized (there is one commonly agreed state and the system behaves like a single computer).” Decentralization offers fault tolerance, attack resistance and col- lusion resistance (the meaning of this will become clear when I discuss proof-of-work later).
At its essence, a blockchain is an effectively tamper-proof data structure that tracks something of value or interest as it passes from owner to owner.
Understanding how to engineer a public blockchain requires knowledge of cryptographic hashes, public key cryptography (PKC), binary hash chains (Merkle trees, in particular), and con- sensus algorithms. I’ll briefly review these concepts, and then I’ll show that a blockchain is a hash chain that contains a hash chain of transactions. Once you grasp this nested-hash-chain concept, you’ll understand blockchain technology’s fundamental design.
Cryptographic Hashes While there are many one-way crypto- graphic hash algorithm variants, a popular choice is to leverage SHA-256 (bit.ly/29kkpft), a one-way hash function that accepts a message of up to (264-1)/8 bytes and returns a 32-byte hash value (64 hexadecimal characters) in the decimal range of 0 to roughly 1.16 x 1077. To put that number’s magnitude in perspective, a drop of water has about 5 x 1012 atoms; the observable universe is estimated to have in the range of 1078 to 1082 atoms. Tweaking any character in the message and re-computing the SHA-256 hash value gener- ates an entirely new hash value. (To experiment, visit onlinemd5.com and set the file or text checksum type to SHA-256.)
Given the same input, the SHA-256 algorithm always pro- duces the same fixed-length output. With respect to blockchain technologies, the value of using SHA-256 cryptographic hashes
msdnmagazine.com
March 2018 21


































































































   25   26   27   28   29