Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Blockchain By Example
Blockchain By Example

Blockchain By Example: A developer's guide to creating decentralized applications using Bitcoin, Ethereum, and Hyperledger

Arrow left icon
Profile Icon Badr Profile Icon Horrocks Profile Icon Xun (Brian) Wu
Arrow right icon
$27.98 $39.99
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (2 Ratings)
eBook Nov 2018 528 pages 1st Edition
eBook
$27.98 $39.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Badr Profile Icon Horrocks Profile Icon Xun (Brian) Wu
Arrow right icon
$27.98 $39.99
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (2 Ratings)
eBook Nov 2018 528 pages 1st Edition
eBook
$27.98 $39.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$27.98 $39.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Blockchain By Example

Building a Bitcoin Payment System

The previous chapter was an excellent starting point for understanding the blockchain and learning about bitcoin. In fact, we covered many basic concepts and elementary operations, such as signing, sending raw transactions, and storing data in the blockchain. In this chapter, we'll continue to explore the blockchain, firstly by building a customer-friendly payment system based on the Bitcoin payment protocol, and secondly, by building our first smart contract in the bitcoin system.

The end goal of this chapter is to help you acquire the necessary technical background to understand bitcoin's mechanics and build your first bitcoin applications using very common languages such as JavaScript and Java. If you're an experienced programmer, most likely you are familiar with one of these technologies; if not, I recommend you spend time...

What is Bitcoin?

As outlined in the previous chapter, Bitcoin is a peer-to-peer electronic cash system based on blockchain technology. Technically speaking, Bitcoin is a protocol maintaining the blockchain data structure and ensuring consensus between different network parties (senders, recipients, miners, and so on). This protocol defines the ruleset for validating transactions, Bitcoin mining, and avoiding counterfeiting or double spending.

Bitcoin is referenced as a cryptocurrency because it uses cryptography to control the creation and transfer of money. Specifically, it uses digital signatures (based on ECDSA public key encryption) to process and verify the transactions, and cryptographic hash functions (SHA-256) to secure the blockchain (integrity, mining process, and so on).

This book's scope isn't about presenting the Bitcoin protocol in fine detail; instead...

Getting started with Bitcoin

To get started using Bitcoin, there are plenty of Bitcoin clients and different implementations of the Bitcoin protocol. As we saw in Chapter 1, Say Hello to Blockchain, the commonly used Bitcoin client is Bitcoin Core, which is maintained by the Bitcoin Core team representing the C++ implementation of the Bitcoin protocol and the continuity of the Satoshi client. I'll assume that you have already installed this client and have become familiar with it.

Setting up a Regtest environment

For learning or testing purposes, it's safer and cheaper to use Bitcoin's test network --testnet (for more information, refer to https://bitcoin.org/en/glossary/testnet) or regression test mode --regtest...

Building a payment gateway

If you have never developed bitcoin applications before, this section is the best place to start. We plan here to integrate bitcoin payments into an online e-commerce website. The idea is to create a payment option for the e-commerce customers to pay simply by clicking a direct bitcoin payment URL or scanning a QR code, which opens a payment form with payment details in the wallet, making the payment process very straightforward and easy. Moreover, such a payment option avoids customers filling in any forms or providing personal data.

Project description

This project generally represents how to implement the bitcoin payment protocol proposed in BIP 70 in order to build an online payment gateway....

Payment protocol using BitcoinJ

If you're a Java developer who would like to get started with building bitcoin applications, this part will be your best starting point. We will build a Java client that implements the payment protocol (BIP 70) using BitcoinJ, and interacts with our payment Node.js server.

Prerequisites

The first thing you should do to follow this guide is to set up your own Java development environment. This walkthrough assumes that the latest version of the following elements is installed and running on your platform of choice:

You can refer to their official documentation in order to download and install them properly.

...

Bitcoin smart contracts

In the previous chapter, we briefly introduced the smart contract concept as self-executing programs that define a set of clauses stored on the blockchain. Although bitcoin was the first blockchain to propose a scripting language (limited for security reasons) to control funds, the smart contract concept is usually associated with the Ethereum blockchain, which provides Turing-complete smart contract languages. However, to redress the balance, many projects were initiated, such as Rootstock, Counterparty, and Ivy, to enable building and running advanced smart contracts on bitcoin. Welcome to bitcoin 2.0.

What is Rootstock?

Rootstock is a project to bring smart contracts (Turing-complete smart contracts...

Summary

Congratulations! You are now qualified to write production applications using the most popular blockchain – bitcoin – whether as a payment system or as a platform for running advanced smart contracts.

In this walkthrough, we have consolidated our understanding of bitcoin and dissected in depth its underlying scripting mechanism. More importantly, we now know how to integrate bitcoin payments into applications and websites using the bitcore library. Lastly, we discovered how to use an RSK network for deploying and interacting with Solidity smart contracts in a bitcoin environment.

Stay tuned for the next chapter, where we will learn something very exciting: we will discover how to build our own cryptcurrency using bitcoin's code base. For sure, it will be a golden opportunity for you to deepen your understanding of bitcoin's protocol and the blockchain...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand the blockchain ecosystem and its terminologies
  • Implement smart contracts, wallets, and consensus protocols
  • Design and develop decentralized applications using Bitcoin, Ethereum, and Hyperledger

Description

The Blockchain is a revolution promising a new world without middlemen. Technically, it is an immutable and tamper-proof distributed ledger of all transactions across a peer-to-peer network. With this book, you will get to grips with the blockchain ecosystem to build real-world projects. This book will walk you through the process of building multiple blockchain projects with different complexity levels and hurdles. Each project will teach you just enough about the field's leading technologies, Bitcoin, Ethereum, Quorum, and Hyperledger in order to be productive from the outset. As you make your way through the chapters, you will cover the major challenges that are associated with blockchain ecosystems such as scalability, integration, and distributed file management. In the concluding chapters, you’ll learn to build blockchain projects for business, run your ICO, and even create your own cryptocurrency. Blockchain by Example also covers a range of projects such as Bitcoin payment systems, supply chains on Hyperledger, and developing a Tontine Bank Every is using Ethereum. By the end of this book, you will not only be able to tackle common issues in the blockchain ecosystem, but also design and build reliable and scalable distributed systems.

Who is this book for?

If you are keen on learning how to build your own blockchain decentralized applications from scratch, then this book is for you. It explains all the basic concepts required to develop intermediate projects and will teach you to implement the building blocks of a blockchain ecosystem.

What you will learn

  • Grasp decentralized technology fundamentals to master blockchain principles
  • Build blockchain projects on Bitcoin, Ethereum, and Hyperledger
  • Create your currency and a payment application using Bitcoin
  • Implement decentralized apps and supply chain systems using Hyperledger
  • Write smart contracts, run your ICO, and build a Tontine decentralized app using Ethereum
  • Implement distributed file management with blockchain
  • Integrate blockchain into existing systems in your organization

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 30, 2018
Length: 528 pages
Edition : 1st
Language : English
ISBN-13 : 9781788473910
Category :
Languages :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Nov 30, 2018
Length: 528 pages
Edition : 1st
Language : English
ISBN-13 : 9781788473910
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $75.95 $108.97 $33.02 saved
Blockchain for Enterprise
$38.99
Blockchain By Example
$48.99
Mastering Blockchain
$54.99
Total $75.95$108.97 $33.02 saved Stars icon

Table of Contents

12 Chapters
Say Hello to Blockchain Chevron down icon Chevron up icon
Building a Bitcoin Payment System Chevron down icon Chevron up icon
Building Your Own Cryptocurrency Chevron down icon Chevron up icon
Peer-to-Peer Auctions in Ethereum Chevron down icon Chevron up icon
Tontine Game with Truffle and Drizzle Chevron down icon Chevron up icon
Blockchain-Based Futures System Chevron down icon Chevron up icon
Blockchains in Business Chevron down icon Chevron up icon
Creating an ICO Chevron down icon Chevron up icon
Distributed Storage IPFS and Swarm Chevron down icon Chevron up icon
Supply Chain on Hyperledger Chevron down icon Chevron up icon
Letter of Credit (LC) Hyperledger Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(2 Ratings)
5 star 50%
4 star 0%
3 star 50%
2 star 0%
1 star 0%
Matt Zand Aug 11, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I read this book few times and it is great. It walks you through hands-on projects from beginner to advance level of Ethereum development. This book is great reference or resource book for all Ethereum developers and instructors. I highly recommend it.
Amazon Verified review Amazon
DIGI Mar 11, 2020
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Good to learn basics but this book is very outdated .
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.