Upload
portia-burton
View
3.545
Download
1
Embed Size (px)
Citation preview
Who am I?My name is Portia Burton
I am a full-stack developer at the Atlantic magazine
Became interested in blockchains earlier this year
Not a cryptographic expert
What is a Blockchain?
A blockchain is a cross between a decentralized data store and bittorrent. It is similar to a database but there isn’t a database administrator.
What is Bitcoin?Type of Cryptocurrency
Creation based on paper by Satoshi Nakamoto titled “Bitcoin: Peer-to-Peer Electronic Cash System”
Peer-to-peer which means transactions happen without a third party. Alice can send money directly to Bob
Bitcoin vs. BlockchainBitcoin is part of a blockchain
Blockchain is a digital ledger of transactions
Each transaction is cryptographically signed
Blockchains are trustless
The bitcoin blockchain is open to everyone
Introduction to EthereumEthereum is a programmable blockchain, every new blockchain
spawned from Ethereum has the same properties as Ethereum
Ethereum Virtual Machine is the low level machine language
Is Turing complete, unlike bitcoin which does not have looping capabilities
It also is aware of multiple states, unlike bitcoin which is only aware of two states (spent and unspent)
Different Consensus MechanismsProof of Work: Uses the Etash algorithm. The Etash algorithm is based on Bitcoin’s the Dagger-Hashimoto algorithm. ⛏⛓
Proof of Stake: Proof of Stake is another way of validating. It calculates the weight of the node, being proportional to its computational resources. It’s less resource intensive than Proof of Work.
What is a Smart Contract?Stored on the blockchain and
executed by code
Many smart contracts are written in Solidity (syntax is similar to JavaScript)
Powered by gas which can be computationally mined or purchased in an exchange
People and machines can interact with it
Transaction: Signed data package that stores a message to be sent from an externally owned account
GAS: the name for the execution fee that senders of transactions need to pay for operations on Ethereum blockchain
VALUE (field): The amount of wei to transfer from sender to the recipient
STARTGAS (value): Representing the maximum number of computational steps the transaction execution is allowed to take
GASPRICE (value): Representing the fee the sender is willing to pay for gas
Applications of Ethereum Blockchain of Smart Contracts
Self-executing legal contracts
Create “American Idol” where people can vote using generated tokens
Company boards can be ran virtually
Dropbox business model create and sell encrypted storage space
Predicting financial futures based on an oracle
Different BlockchainsPublic blockchain: It is the official Ethereum chain that everyone can read and interact with
Testnet blockchain: The official test chain of Ethereum. Good way to test contracts without wasting real ether
Private blockchain: This is a blockchain that you can create yourself. This blockchain can be freely accessed by others, or you can add addresses by invite only
How to build a custom blockchain?1.Create a Genesis file
2.Init your blockchain locally on the command line*
3.Start your chain again, this time with parameters (not in the documentation)
*Be sure to run “init” each time
Genesis FileNonce: a random or pseudo-random number that can only be used once
gasLimit: is the highest amount you are willing to pay for a computation
Alloc: how much money that you allocate to your blockchain
{
"nonce": "0x0000000000000042", "timestamp":
"0x0",
"parentHash":
"0x0000000000000000000000000000000000000000000000000000
000000000000",
"extraData": "0x0", "gasLimit": "0x8000000",
"difficulty": "0x400",
"mixhash":
"0x0000000000000000000000000000000000000000000000000000
000000000000",
"coinbase":
"0x3333333333333333333333333333333333333333",
"alloc": { }
}
CustomGenesis.json
Private Blockchain ParametersUse these parameters in the cli when creating a custom blockchain
Nodiscover: Other people will not discover your blockchain
RPC: JS interface for your node
Networkid: Create a custom networkid inter
geth --identity "Testing" --rpc --rpcport "8080" --rpccorsdomain "*" --datadir "C:\chains\TestChain1" --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --networkid 1999 console
Combine Mist and EthereumDownload Mist
https://github.com/ethereum/mist
Download Democracy Contract:
https://www.ethereum.org/dao
Blockchain Technology Growing PainsForces different parties (or contractors) to be savy about code
Still very new platform and technology
Solidity Contract BugsTransaction-Ordering Bug (TOD): Smart contract assumes a particular state of a contract that doesn’t exist
Timestamp Dependence Bug: Asynchronous network is disconnected from a synchronized global clock. Some contracts assume that network is on global contract
Unchecked Send: Most common exploit. Attacker elicits unexpected behavior from the contract by calling if from a carefully constructed call-stack
Enough About Me: How can you get started today?Solidity Tutorial: https://solidity.readthedocs.io/en/develop/
Bootstrap Meteor App: https://github.com/SilentCicero/meteor-dapp-boilerplate
Example Dapps: http://ethereum.stackexchange.com/questions/2940/where-can-i-find-some-solidity-smart-contract-source-code-examples
Command Line Interface of Interacting with the Ethereum Network: https://www.ethereum.org/cli
Meteor: https://www.meteor.com/
Different Ethereum FrameworksThese frameworks provide developers the tools need to create, test, and deploy smart contracts using Ethereum
Truffle: https://github.com/ConsenSys/truffle
The Dao: https://github.com/slockit/DAO
Embark: https://github.com/iurimatias/embark-framework
References1.http://ethdocs.org/en/latest/mining.html#what-is-mining
2.http://ethdocs.org/en/latest/frequently-asked-questions/frequently-asked-questions.html#what-s-the-difference-between-account-and-wallet-contract
3.http://www.coindesk.com/making-sense-smart-contracts/
4.https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options
5.http://www.ethdocs.org/en/latest/contracts-and-transactions/account-types-gas-and-transactions.html
6.https://blog.ethereum.org/2016/07/12/build-server-less-applications-mist/