SlideShare une entreprise Scribd logo
1  sur  35
The Blockchain and JavaScript
Portia Burton
@pkafei
Node.js Interactive
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
Background about Blockchain and Bitcoin
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. 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
We will focus on the Blockchain
Can an average developer build
blockchain applications?
Yes, We Can!
But first, some more background
Many Different Types of
Cryptocurrencies
Ethereum
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)
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.
Smart Contracts
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
Ethereum Chains
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
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 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
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
In Conclusion
Combine Mist and Ethereum
Download Mist
https://github.com/ethereum/mist
Download Democracy Contract:
https://www.ethereum.org/dao
Blockchain Technology Growing Pains
Forces different parties (or contractors) to be savy about code
Still very new platform and technology
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
Smart Contract Bloopers
https://ethereum.karalabe.com/talks/2016-hackethon.html#1
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 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
Thank You!
References
1. 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/

Contenu connexe

Tendances

Bitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & BlockchainBitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & BlockchainJitendra Chittoda
 
Ethereum Blockchain explained
Ethereum Blockchain explainedEthereum Blockchain explained
Ethereum Blockchain explainedEthWorks
 
An Introduction to Bitcoin, Blockchain and Cryptocurrency
An Introduction to Bitcoin, Blockchain and CryptocurrencyAn Introduction to Bitcoin, Blockchain and Cryptocurrency
An Introduction to Bitcoin, Blockchain and CryptocurrencyAmarpreet Singh
 
Lapine blockchain introduction 10/04/2018
Lapine blockchain introduction 10/04/2018Lapine blockchain introduction 10/04/2018
Lapine blockchain introduction 10/04/2018Chuck Bair
 
Blockchain Technology and Cryptocurrency
Blockchain Technology and CryptocurrencyBlockchain Technology and Cryptocurrency
Blockchain Technology and CryptocurrencyAdityaSingh1213
 
Blockchain and Bitcoin
Blockchain and BitcoinBlockchain and Bitcoin
Blockchain and BitcoinHugo Rodrigues
 
Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20Truong Nguyen
 
Understanding blockchain
Understanding blockchainUnderstanding blockchain
Understanding blockchainPriyab Satoshi
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to EthereumTerek Judi
 
Ethereum Mining How To
Ethereum Mining How ToEthereum Mining How To
Ethereum Mining How ToNugroho Gito
 
Introduction to Bitcoin and ECDSA
Introduction to Bitcoin and ECDSAIntroduction to Bitcoin and ECDSA
Introduction to Bitcoin and ECDSANikesh Mistry
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshellDaniel Chan
 
Web3 Security: The Blockchain is Your SIEM
Web3 Security: The Blockchain is Your SIEMWeb3 Security: The Blockchain is Your SIEM
Web3 Security: The Blockchain is Your SIEMTal Be'ery
 
Namecoin Primecoin Potcoin
Namecoin Primecoin Potcoin Namecoin Primecoin Potcoin
Namecoin Primecoin Potcoin PiotrMatuszak3
 
Intro to smart contract on blockchain en
Intro to smart contract on blockchain enIntro to smart contract on blockchain en
Intro to smart contract on blockchain enNicholas Lin
 

Tendances (20)

INTRO TO BLOCKCHAINS AND CRYPTOCURRENCY
INTRO TO BLOCKCHAINS AND CRYPTOCURRENCYINTRO TO BLOCKCHAINS AND CRYPTOCURRENCY
INTRO TO BLOCKCHAINS AND CRYPTOCURRENCY
 
Bitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & BlockchainBitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & Blockchain
 
Ethereum Blockchain explained
Ethereum Blockchain explainedEthereum Blockchain explained
Ethereum Blockchain explained
 
Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum) Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum)
 
An Introduction to Bitcoin, Blockchain and Cryptocurrency
An Introduction to Bitcoin, Blockchain and CryptocurrencyAn Introduction to Bitcoin, Blockchain and Cryptocurrency
An Introduction to Bitcoin, Blockchain and Cryptocurrency
 
Lapine blockchain introduction 10/04/2018
Lapine blockchain introduction 10/04/2018Lapine blockchain introduction 10/04/2018
Lapine blockchain introduction 10/04/2018
 
Blockchain Technology and Cryptocurrency
Blockchain Technology and CryptocurrencyBlockchain Technology and Cryptocurrency
Blockchain Technology and Cryptocurrency
 
Blockchain and Bitcoin
Blockchain and BitcoinBlockchain and Bitcoin
Blockchain and Bitcoin
 
Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20
 
Understanding blockchain
Understanding blockchainUnderstanding blockchain
Understanding blockchain
 
Ethereum Intro
Ethereum IntroEthereum Intro
Ethereum Intro
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to Ethereum
 
Ethereum Mining How To
Ethereum Mining How ToEthereum Mining How To
Ethereum Mining How To
 
Introduction to Bitcoin and ECDSA
Introduction to Bitcoin and ECDSAIntroduction to Bitcoin and ECDSA
Introduction to Bitcoin and ECDSA
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshell
 
Blockchain Corporate Style
Blockchain Corporate StyleBlockchain Corporate Style
Blockchain Corporate Style
 
Web3 Security: The Blockchain is Your SIEM
Web3 Security: The Blockchain is Your SIEMWeb3 Security: The Blockchain is Your SIEM
Web3 Security: The Blockchain is Your SIEM
 
Namecoin Primecoin Potcoin
Namecoin Primecoin Potcoin Namecoin Primecoin Potcoin
Namecoin Primecoin Potcoin
 
Ethereum
EthereumEthereum
Ethereum
 
Intro to smart contract on blockchain en
Intro to smart contract on blockchain enIntro to smart contract on blockchain en
Intro to smart contract on blockchain en
 

Similaire à The Blockchain and JavaScript

Python, Blockchain, and Byte-Size Change
Python, Blockchain, and Byte-Size ChangePython, Blockchain, and Byte-Size Change
Python, Blockchain, and Byte-Size ChangePortia Burton
 
Blockchain data structures and fundamental
Blockchain data structures and fundamentalBlockchain data structures and fundamental
Blockchain data structures and fundamentalCodium Club
 
Becoming a blockchain professional
Becoming a blockchain professionalBecoming a blockchain professional
Becoming a blockchain professionalPortia Burton
 
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdf
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdfTrading-CryptoCurrency-Advanced-Trading-Strategies.pdf
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdfShreeharshaHegde7
 
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdf
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdfTrading-CryptoCurrency-Advanced-Trading-Strategies.pdf
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdfLeokas123
 
BlockChain for the Banker
BlockChain for the BankerBlockChain for the Banker
BlockChain for the BankerBohdan Szymanik
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block ChainSanatPandoh
 
Blockchain. A Guide For Beginners
Blockchain. A Guide For BeginnersBlockchain. A Guide For Beginners
Blockchain. A Guide For BeginnersElifTech
 
Upfront Ventures blockchain and crypto deck
Upfront Ventures blockchain and crypto deckUpfront Ventures blockchain and crypto deck
Upfront Ventures blockchain and crypto deckMark Suster
 
BCHGraz - Meetup #8 - Intro & Ethereum
 BCHGraz - Meetup #8 - Intro & Ethereum BCHGraz - Meetup #8 - Intro & Ethereum
BCHGraz - Meetup #8 - Intro & EthereumBlockchainHub Graz
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain PresentationZied GUESMI
 
Bitcoin story of programable currency
Bitcoin story of programable currencyBitcoin story of programable currency
Bitcoin story of programable currencyHossam Soffar
 
Blockchain Technology Explained
Blockchain Technology ExplainedBlockchain Technology Explained
Blockchain Technology ExplainedMdSaifulIslam289
 
Crypto currency - a digital asset
Crypto currency - a digital asset Crypto currency - a digital asset
Crypto currency - a digital asset mayil vealan
 

Similaire à The Blockchain and JavaScript (20)

Python, Blockchain, and Byte-Size Change
Python, Blockchain, and Byte-Size ChangePython, Blockchain, and Byte-Size Change
Python, Blockchain, and Byte-Size Change
 
Blockchain data structures and fundamental
Blockchain data structures and fundamentalBlockchain data structures and fundamental
Blockchain data structures and fundamental
 
Becoming a blockchain professional
Becoming a blockchain professionalBecoming a blockchain professional
Becoming a blockchain professional
 
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdf
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdfTrading-CryptoCurrency-Advanced-Trading-Strategies.pdf
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdf
 
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdf
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdfTrading-CryptoCurrency-Advanced-Trading-Strategies.pdf
Trading-CryptoCurrency-Advanced-Trading-Strategies.pdf
 
Blockchain
BlockchainBlockchain
Blockchain
 
BlockChain for the Banker
BlockChain for the BankerBlockChain for the Banker
BlockChain for the Banker
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
 
Blockchain. A Guide For Beginners
Blockchain. A Guide For BeginnersBlockchain. A Guide For Beginners
Blockchain. A Guide For Beginners
 
Upfront Ventures blockchain and crypto deck
Upfront Ventures blockchain and crypto deckUpfront Ventures blockchain and crypto deck
Upfront Ventures blockchain and crypto deck
 
Blockchain
BlockchainBlockchain
Blockchain
 
BCHGraz - Meetup #8 - Intro & Ethereum
 BCHGraz - Meetup #8 - Intro & Ethereum BCHGraz - Meetup #8 - Intro & Ethereum
BCHGraz - Meetup #8 - Intro & Ethereum
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain Presentation
 
Bitcoin story of programable currency
Bitcoin story of programable currencyBitcoin story of programable currency
Bitcoin story of programable currency
 
Blockchain Technology Explained
Blockchain Technology ExplainedBlockchain Technology Explained
Blockchain Technology Explained
 
All aboard the blockchain!
All aboard the blockchain!All aboard the blockchain!
All aboard the blockchain!
 
Block chain technology
Block chain technologyBlock chain technology
Block chain technology
 
Block chain technology
Block chain technology Block chain technology
Block chain technology
 
Crypto currency - a digital asset
Crypto currency - a digital asset Crypto currency - a digital asset
Crypto currency - a digital asset
 
blockchain-161025100639.pptx
blockchain-161025100639.pptxblockchain-161025100639.pptx
blockchain-161025100639.pptx
 

Dernier

英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 

Dernier (20)

英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 

The Blockchain and JavaScript

  • 1. The Blockchain and JavaScript Portia Burton @pkafei Node.js Interactive
  • 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
  • 7. We will focus on the Blockchain
  • 8. Can an average developer build blockchain applications?
  • 10. But first, some more background
  • 11. Many Different Types of Cryptocurrencies
  • 12.
  • 14.
  • 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
  • 22.
  • 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
  • 28. Combine Mist and Ethereum Download Mist https://github.com/ethereum/mist Download Democracy Contract: https://www.ethereum.org/dao
  • 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
  • 35. References 1. 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/