Hands-On Bitcoin Programming with Python

Book description

Simplified Python programming for Bitcoin and blockchain

Key Features

  • Build Bitcoin applications in Python with the help of simple examples
  • Mine Bitcoins, program Bitcoin-enabled APIs and transaction graphs, and build trading bots
  • Analyze Bitcoin transactions and produce visualizations using Python data analysis tools

Book Description

Bitcoin is a cryptocurrency that's changing the face of online payments. Hands-On Bitcoin Programming with Python teaches you to build software applications for mining and creating Bitcoins using Python.

This book starts with the basics of both Bitcoin and blockchain and gives you an overview of these inherent concepts by showing you how to build Bitcoin-driven applications with Python. Packed with clear instructions and practical examples, you will learn to understand simple Python coding examples that work with this cryptocurrency.

By the end of the book, you'll be able to mine Bitcoins, accept Bitcoin payments on the app, and work with the basics of blockchain technology to create simply distributed ledgers.

What you will learn

  • Master the Bitcoin APIs in Python to manipulate Bitcoin from your Python apps
  • Build your own Bitcoin trading bots to buy Bitcoins at a lower price and sell them at a higher price
  • Write scripts to process Bitcoin payments through a website or app
  • Develop software for Bitcoin mining to create Bitcoin currency on your own computer hardware
  • Create your own keys, addresses, and wallets in Python code
  • Write software to analyze Bitcoin transactions and produce reports, graphs, and other visualizations

Who this book is for

Hands-On Bitcoin Programming with Python consists of examples that will teach you to build your own Bitcoin application. You will learn to write scripts, build software for mining, and create Bitcoins using Python. Anyone with prior Python experience, who wants to explore Python Bitcoin programming and start building Bitcoin-driven Python apps, will find this book useful.

Publisher resources

Download Example Code

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Bitcoin Programming with Python
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the author
    2. Packt is searching for authors like you
  5. Preface
    1. What this book covers
    2. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    3. Get in touch
      1. Reviews
  6. Getting Started with Bitcoin
    1. Introduction to bitcoin and blockchains
      1. What is bitcoin?
      2. Uses of bitcoin
      3. What is a blockchain?
      4. Attributes of bitcoin and blockchain
    2. Getting a bitcoin wallet
      1. The different forms of bitcoin wallet
    3. Getting and sending bitcoins
    4. Summary
  7. Programming Bitcoin and Blockchain with Python
    1. Programming bitcoin with Python
      1. Pi Bitcoin tools library
      2. How to generate private keys and public keys
    2. Creating a multisignature bitcoin address
    3. Blockchain API programming with Python
    4. Installing the Blockchain.info Python library
      1. Getting bitcoin exchange rates from Blockchain.info
      2. Statistics
      3. Block explorer methods
    5. Learning to mine bitcoin
    6. How to mine bitcoin
    7. Increasing difficulty in mining bitcoin
    8. Summary
  8. Earning Bitcoin Programmatically
    1. Accepting bitcoin on your website
      1. Introduction to BitPay
      2. How to generate a bitcoin payment button
      3. How to add a bitcoin payment button to your website
    2. Building and releasing bitcoin-enabled APIs
      1. 21.co marketplace
      2. 21.co SDK
    3. Selling microservices on the 21.co marketplace
    4. Building a bitcoin trading bot
    5. Triggering the bitcoin trade advice alert
    6. How to get a current bid and asking price for bitcoin
      1. The triggering of buy bitcoin
      2. The triggering of sell bitcoin
    7. Summary
  9. Bitcoin Data Analysis
    1. Manipulating and visualizing bitcoin price data
    2. Getting set up for data analysis
    3. Getting, reading in, and cleaning bitcoin price data
      1. DataFrame
      2. Data cleanup
      3. Setting the index to the Date column
    4. Exploring, manipulating, and visualizing the cleaned-up data
      1. Data visualization
    5. Exploring bitcoin transaction graphs
      1. Bitcoin and blockchain graphs
      2. Exploring, cleaning up, and analyzing data
      3. Visualizing data
    6. Collecting and analyzing Bitcoin Dice game data
      1. Getting data from the Games Web API
    7. Summary
  10. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Hands-On Bitcoin Programming with Python
  • Author(s): Harish Kumar Garg
  • Release date: August 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781789537000