Successfully reported this slideshow.
Your SlideShare is downloading. ×

Blockchain - Introduction and Authoring Smart Contracts

Ad

1
Vikas Grover
vgrover1515@gmail.com
Offline Slack Channel : www.tinyurl.com/letsdoblockchain
www.meetup.com/Blockchain-Re...

Ad

2
vgrover1515@gmail.com
Offline Slack Channel : www.tinyurl.com/letsdoblockchain
Agenda
● Introduction
● Smart Contracts
●...

Ad

3
vgrover1515@gmail.com
Offline Slack Channel : www.tinyurl.com/letsdoblockchain
Introduction
Blockchain creates a permane...

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Upcoming SlideShare
Understanding blockchain
Understanding blockchain
Loading in …3
×

Check these out next

1 of 23 Ad
1 of 23 Ad

More Related Content

Similar to Blockchain - Introduction and Authoring Smart Contracts (20)

Blockchain - Introduction and Authoring Smart Contracts

  1. 1. 1 Vikas Grover vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain www.meetup.com/Blockchain-Revolution Blockchain & Authoring Smart Contracts
  2. 2. 2 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Agenda ● Introduction ● Smart Contracts ● Test RPC and Geth ● Truffle ● Dapp
  3. 3. 3 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Introduction Blockchain creates a permanent, digitized chain of transactions, grouped in blocks, allowing virtually anything of value to be tracked and traded, without requiring a central point of control Blockchain is a peer-to-peer distributed ledger technology for a new generation of transactional applications.
  4. 4. 4 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain What is in Block Header, Transaction Count, Block Content Transaction Input Output
  5. 5. 5 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Public, Private, Consortium/Hybrid First thing First – Do you even need a Blockchain? ● Database with Shared Access ● Who Controls the Functionality? ● Public or Private Transactions? ● Determining Consensus?
  6. 6. 6 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Public, Private, Hybrid ● Public Blockchain: Fully Public, Secured by Cryptocurrencies (Proof of work, Proof of Stake etc), Its for Anyone – Read, Send Transactions, Participate in Consensus Process ● Private Blockchain: Controlled Access, Write permissions are kept centralized to one organization, Read permissions may be public or not (or some part may be public) ● Consortium/Hybrid Blockchain: Pre-selected set of nodes for eg: 15 financial institutions
  7. 7. 7 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Public, Private, Hybrid Public Blockchain ● Freedom ● Neutrality ● Openness Private Blockchain ● Known Validator (51% risk goes away) ● Cheaper Transactions ● Privacy No way that there is going to be One way to do Blockchain
  8. 8. 8 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Bitcoin – Digitally Signed
  9. 9. 9 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Ethereum ● Founder of Ethereum - Vitalik Buterin (22 year old) won the 2014 World Technology Award for invention of Blockchain. ● Ethereum to build programming tools to make Blockchain power any/everything. ● Ethereum is Dynamic and Programmable. You can implement the way you want. For eg: Using Java Script you can implement almost anything.
  10. 10. 10 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain What is Better with Ethereum
  11. 11. 11 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Smart Contract Smart contracts are computer protocols that facilitate, verify, or enforce the negotiation or performance of a contract, or that make a contractual clause unnecessary. Smart contracts usually also have a user interface and often emulate the logic of contractual clauses. Trust the Bank Trust the Code
  12. 12. 12 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Smart Contract – Online Browser
  13. 13. 13 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Smart Contract – Mist
  14. 14. 14 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Different Needs Different Clients ● When Developing ● Ethereum JS TestRPC ● When Deploying: ● Geth ● Webthree ● Others
  15. 15. 17 TRUFFLE
  16. 16. 18 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Truffle What is Truffle ● Development Environment ● Testing Framework ● Asset Pipeline
  17. 17. 19 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Truffle What do you get with Truffle ● Built-in smart contract compilation, linking, deployment and binary management. ● Automated contract testing with Mocha and Chai. ● Configurable build pipeline with support for custom build processes. ● Scriptable deployment & migrations framework ● Network management for deploying to many public & private networks. ● Interactive console for direct contract communication ● Instant rebuilding of assets during development. ● External script runner that executes scripts within a Truffle environment. ● Support for JavaScript, SASS, ES6 and JSX built-in.
  18. 18. 21 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Getting Started with Truffle ● Getting Started ● Install Truffle ● Commands ● mkdir myproject ● cd myproject ● truffle init ● app ● contracts ● migrations ● test ● truffle.js ● truffle compile
  19. 19. 22 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Testing with Truffle ● Automated Testing ● Mocha ● Assertion ● Chai ● All test files should be located in the ./tests directory. Truffle will only run test files with the following file extensions: .js, .es, .es6, and .jsx. All other files are ignored.
  20. 20. 23 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Interacting with SmartContract ● Use Web3 ● Little Difficult though ● Use Ether Pudding ● Chai ● All test files should be located in the ./tests directory. Truffle will only run test files with the following file extensions: .js, .es, .es6, and .jsx. All other files are ignored.
  21. 21. 24 Dapp
  22. 22. 25 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Dapp ● Frontend and Backend ● Reactive Programming – callback functions ● Web3.js ● version ● api ● node/getNode ● network/getNetwork ● ethereum/getEthereum ● whisper/getWhisper ● isConnected() ● setProvider(provider) ● CurrentProvider ● Etc etc etc
  23. 23. 26 vgrover1515@gmail.com Offline Slack Channel : www.tinyurl.com/letsdoblockchain Thanks

×