2. What is Blockchain
Blockchain is a distributed database that is decentralized, immutable and transparent.
Data is stored in a growing list of records, called blocks, that are linked using
cryptography.
4. Do you want Blockchain with that?
Gartner 2019 Hype Cycle for
Blockchain Business Shows
Blockchain Will Have a
Transformational Impact across
Industries in Five to 10 Years
https://www.gartner.com/en/newsroom/press-
releases/2019-09-12-gartner-2019-hype-cycl
e-for-blockchain-business-shows
9. Ethereum
Launched in 2015, Ethereum is the world’s leading programmable blockchain.
Like other blockchains, Ethereum has a native cryptocurrency called Ether (ETH).
ETH is digital money (like Bitcoin).
But unlike other blockchains, Ethereum can do much more. Ethereum is
programmable, which means that developers can use it to build new kinds of
applications.
https://www.ethereum.org/beginners/
11. Ethereum Smart Contracts
Any program that runs on the Ethereum Virtual Machine (EVM) is commonly
referred to as a “smart contract”. The most popular languages for writing smart
contracts on Ethereum are Solidity and Vyper
https://www.ethereum.org/developers/#getting-started
13. Popular Consensus Mechanisms
● Proof of Work (PoW) (used by Bitcoin, Ethereum 1.0)
● Proof of Stake (PoS) (Ethereum 2.0)
● Simplified Byzantine Fault Tolerance
● Practical Byzantine Fault Tolerance
● Proof of Elapsed Time (PoET)
● Proof of Burn
● Proof of Capacity
● Proof of Authority (PoA) (Hyperledger, Quorum, Azure Blockchain Service)
● Directed Acyclic Graphs (DAGs)
https://www.himss.org/library/consensus-blockchain
14. What is Blockchain used for?
- Decentralized Currency
- Decentralized Identity
- Registries (e.g. DNS)
- Document and Transaction proof
- Contracts
- Supply Chain Tracking
- Waiting for you to come up with a new application!
17. The Document Storage Example
● Goal: Use Blockchain to save proof of a document
● Implementation:
○ Store a document elsewhere (e.g. Azure Blob Storage)
○ Calculate the hash of the document
○ Save the Hash in the blockchain
○ Provide methods to save and verify a hash
20. Smart Contract Code - 2
function stringToBytes32(string memory source) private pure returns (bytes32 result) {
bytes memory tempEmptyStringTest = bytes(source);
if (tempEmptyStringTest.length ==0) {
return 0x0;
}
assembly {
result := mload(add(source, 32))
}
}
21. Setup and Testing
● Create a Consortium
○ https://docs.microsoft.com/en-us/azure/blockchain/service/create-member
● Setup VS Code to interact with Azure Blockchain Consortium
○ https://docs.microsoft.com/en-us/azure/blockchain/service/connect-vscode
● Setup Metamask to interact with Azure Blockchain Service
○ https://docs.microsoft.com/en-us/azure/blockchain/service/connect-metamask
● Compile and Deploy the contract to Azure
● Test using Remix or MEW
22. Azure Blockchain Development Kit
https://marketplace.visualstudio.com/items?itemName=AzBlockchain.azure-blockchain
23. VS Code - Command Palette
https://marketplace.visualstudio.com/items?itemName=AzBlockchain.azure-blockchain
27. More tutorials
● Tutorial: Use Visual Studio Code to create, build, and deploy smart contracts
○ https://docs.microsoft.com/en-us/azure/blockchain/service/send-transaction
● Use the Ethereum Blockchain connector with Azure Logic Apps
○ https://docs.microsoft.com/en-us/azure/blockchain/service/ethereum-logic-app
● Common scenarios connecting Blockchain using Logic Apps
○ https://channel9.msdn.com/Shows/Blocktalk/Doing-more-with-Logic-Apps?term=logic%20apps%20blockchain&lang-en=
true
● Write Blockchain-Powered Azure Functions in Java leveraging Azure Key Vault
○ https://github.com/Azure-Samples/bc-community-samples/tree/master/akv-functions-java