Introduction to Blockchain with an Ethereuem Hands-on
-
Upload
johann-romefort -
Category
Technology
-
view
27 -
download
1
Transcript of Introduction to Blockchain with an Ethereuem Hands-on
Introduction to Blockchain with an Ethereum Hands-on
June 2016
01by Johann Romefort
About Johann• Tech Evangelist @Stylight
• 15+ years in tech
• In Germany for 2 years
• 7 years in San Francisco doing startups
• Organizer of many meetups
2
Agenda - Introduction
3
• What is blockchain, what is Ethereum, and what about Bitcoin?
• Basic concepts of Ethereum:
• Ether
• Wallet
• Transactions, Blocks, Smart Contracts, ĐApps and The Ethereum Virtual Machine.
Agenda - Hands-on
4
• Local, Test and Production blockchains. Let's browse them, and find transactions.
• How to get the first Ether in your wallet.
• Get a local Ethereum node running and make your first transaction.
• Write, compile and deploy a Smart Contract with Truffle.
• Invoke your Smart Contract and see your transactions.
• - Where is this going? A quick intro to the DAO and potential future use cases of the technology.
What do you need?
5
• Terminal
• Code Editor
What is blockchain?
6
• Blockchain is the technology behind bitcoin .
• Bitcoin was created in 2008 by Satoshi Nakamoto
• Ethereum is a blockchain 2.0 - it retains the same principles but add some new ones (like Smart Contracts)
Blockchain principles
7
The Blockchain is a distributed public ledger. An ordered and timestamped record of transactions. This system is used to protect against double spending and modification of previous transaction records.
What is a “Hash”?
8
A hash function is a type of mathematical function which turns data into a fingerprint of that data called a hash:
SHA-256 of “Hello from Microsoft”:
a11a19a7a180e0d0f5173fd89a77ff67fde082f59f75d157ca1aa3395411e30b
SHA-256 of “Hello from Microsoft!”:
d9b8515817907bdebfa29d4b7591f7336035ecf3bed3bedda93e2a9a10a0f896
Properties of good Hashing functions
9
• Impossible to deduce the data from the hash
• Slight change to data modify the hash in a very unpredictable way
What is a “Block”?
10
• Bundles transactions
• Containers previous block hash
• Blocks are linked through their hashes
• You can’t change the data in one block in the chain without changing the subsequent chain
• Unless you mine it all over again
A few words about Mining
11
• Mining is computationally expensive (on purpose)
• Mining a block means guessing a hash that matches particular criteria
• Miners can’t change the transaction data, but only something called a “nonce”
• finding the right nonce that makes the hash of the block match a particular criteria is called the “proof of work”
What can I do with a distributed immutable ledger?
12
• Cryptocurrencies
• Property titles
• Notarised acts
• Digital certificates
• And more
A gentle introduction to Ethereum
What’s Ethereum?
14
• Initially conceptualised in 2013 by Vitalik Buterin
• Development was crowdfunded and launched in July 2015
• “A Next-Generation Cryptocurrency and Decentralized Application Platform”
• Does not rely on the bitcoin blockchain
• Ether (ETH) is the “fuel” to operate the platform.
What’s the Ethereum Wallet?
15
• Entry point in the Ethereum platform
• Holds your accounts
• Let you send/receive ETH
• Let you create / invoke Smart Contracts
What’s a Transaction?
16
• In Ethereum’s world it’s an operation that writes data on the blockchain
• You have to pay a fee for each transactions you make
• the simplest transaction is sending ETH from one account to another
• More complicated transaction involve Smart Contracts
What’s a Smart Contract?
17
• It’s code running on the Ethereum Virtual Machine
• A Smart Contract can hold Ether, write data to the blockchain and be invoked from another Smart Contract.
• It’s written using one of the supported language, most likely Solidity
Hands-on!
June 2016
01
Browsing the blockchain
19
• A few web interface available
• Ether.camp is great : https://live.ether.camp/
• Different chains for different purposes:
• Homestead: “production”
• Morden: Staging
• Local testrpc : https://github.com/ethereumjs/testrpc
Writing a Smart Contract
20
• Language: Solidity (JS-like)
• Supports inheritance
• Compiled with Solc
• Can use tooling to compile and deploy
Installing Geth
21
• https://github.com/ethereum/go-ethereum/releases
• Launching Geth:
$ geth --rpc \ --rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcapi "eth,web3" \ --unlock 0 \ console
Truffle - A development framework for Ethereum
22
• https://github.com/ConsenSys/truffle
• Built-in contract compilation, linking, deployment
• Interactive console for managing deployed contracts
Play around with Truffle
23
• List of commands
• Initialise a project
• Compile a contract
• Deploy a contract
• Make a call
• Make a transaction
• Build a front-end
A few words on the DAO and recent events…
Microsoft & Blockchain?
25
• Project Bletchey: Blockchain As A Service (BaaS)
• https://azure.microsoft.com/en-us/blog/bletchley-blockchain/
Questions?