This is a presentation is an introduction to the blockchain. It defines, what is the blockchain and shows how JavaScript developers can create blockchain applications.
2. 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
4. 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.
5. 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
6. Bitcoin vs. Blockchain
Bitcoin 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
15. Introduction to Ethereum
Ethereum 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)
16. Different Consensus Mechanisms
Proof 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.
18. 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
19. 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
20. 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
23. Different Blockchains
Public 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
24. 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
25. Genesis File
Nonce: 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
26. Private Blockchain Parameters
Use 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:chainsTestChain1" --
port "30303" --nodiscover --rpcapi "db,eth,net,web3"
--networkid 1999 console
29. Blockchain Technology Growing Pains
Forces different parties (or contractors) to be savy about code
Still very new platform and technology
30. Solidity Contract Bugs
Transaction-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
32. 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/
33. Different Ethereum Frameworks
These 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