O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introduction to Blockchain and Ethereum

Book Description

Build distributed applications that resolve data ownership issues when working with transactions between multiple parties

Key Features

  • Explore a perfect balance between theories and hands-on activities
  • Discover popular Blockchain use cases such as Bitcoin
  • Create your first smart contract in Solidity for Ethereum

Book Description

Blockchain applications provide a single-shared ledger to eliminate trust issues involving multiple stakeholders. With the help of Introduction to Blockchain and Ethereum, you'll learn how to create distributed Blockchain applications which do not depend on a central server or datacenter. The course begins by explaining Bitcoin, Altcoins, and Ethereum, followed by taking you through distributed programming using the Solidity language on the Ethereum Blockchain. By the end of this course, you'll be able to write, compile, and deploy your own smart contracts to the Ethereum Blockchain.

What you will learn

  • Grasp Blockchain concepts such as private and public keys, addresses, wallets, and hashes
  • Send and analyze transactions in the Ethereum Rinkeby test network
  • Compile and deploy your own ERC20-compliant smart contracts and tokens
  • Test your smart contracts using MyEtherWallet
  • Create a distributed web interface for your contract
  • Combine Solidity and JavaScript to create your very own decentralized application

Who this book is for

Introduction to Blockchain and Ethereum is ideal for you if you want to get to grips with Blockchain technology and develop your own distributed applications with smart contracts written in Solidity. Prior exposure to an object-oriented programming language such as JavaScript is needed, as you'll cover the basics before getting straight to work.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Preface
    1. About the Book
      1. About the Author
      2. Objectives
      3. Audience
      4. Approach
      5. Minimum Hardware Requirements
      6. Software Requirements
      7. Installing the Code Bundle
      8. Additional Resources
      9. Conventions
  2. Ethereum Blockchain
    1. Introduction
    2. Introducing the Ethereum Blockchain
      1. The Blockchain Data Structure
      2. Public Key Cryptography
      3. Distributed Ledgers
      4. Consensus Mechanism
      5. Introducing Cryptocurrencies
      6. Introducing Networks and Smart Contracts
    3. Cryptology and Keys
      1. Traditional Codes and Cryptography
      2. New Cryptography
    4. Opening an Ethereum Account
      1. Account Numbers and their Associated Private Keys
      2. Wallets
      3. Exercise 1: Creating a Wallet and Safeguarding its Information
      4. Private Keys and Public Keys
      5. Using your Wallet
      6. Exercise 2: Getting the Toy Ether from the Rinkeby Test Network
    5. The Ethereum Network, Nodes, and Mining
      1. The Ethereum Network
      2. Nodes
      3. Mining
    6. Transactions and Blocks
      1. Transactions and Calls
      2. Calls
      3. Exercise 3: Calling the Ethereum Network
      4. Transactions, Transaction Hashes, and Gas
      5. Blocks and Block Hashes
      6. Confirmations
    7. Sending and Checking Transactions
      1. Sending Transactions
      2. Exercise 4: Sending and Receiving Transactions
      3. Receiving Transactions
      4. Checking Transactions
    8. Summary
  3. Learning Solidity
    1. Introduction
    2. The Solidity Language
    3. Your First Smart Contract
      1. Activity 1: Creating an Ethereum Token
      2. Exercise 5: Using Remix to Compile Our Token
    4. Basic Solidity
      1. Solidity Data Types
      2. Global and Local Variables
      3. Collections
      4. Mappings
      5. Exercise 6: Creating Our Own Collection
    5. Testing Solidity
      1. Exercise 7: Deploying and Testing a Smart Contract
    6. Summary
  4. Solidity Contracts
    1. Introduction
    2. Your First dApp
      1. Architecture of a dApp
      2. Ganache
      3. Exercise 8: Using MetaMask to connect to Ganache
      4. Voting Contract
      5. Compiling and Deploying Contracts
      6. A Simple Web Page
    3. Using an Oracle
      1. Interface
      2. Payment
      3. Calculating Payments
      4. Request Types
      5. Functions and Getters
    4. Summary