Book Image

Hands-On Blockchain for Python Developers

By : Arjuna Sky Kok
Book Image

Hands-On Blockchain for Python Developers

By: Arjuna Sky Kok

Overview of this book

Blockchain is seen as the main technological solution that works as a public ledger for all cryptocurrency transactions. This book serves as a practical guide to developing a full-fledged decentralized application with Python to interact with the various building blocks of blockchain applications. Hands-On Blockchain for Python Developers starts by demonstrating how blockchain technology and cryptocurrency hashing works. You will understand the fundamentals and benefits of smart contracts such as censorship resistance and transaction accuracy. As you steadily progress, you'll go on to build smart contracts using Vyper, which has a similar syntax to Python. This experience will further help you unravel the other benefits of smart contracts, including reliable storage and backup, and efficiency. You'll also use web3.py to interact with smart contracts and leverage the power of both the web3.py and Populus framework to build decentralized applications that offer security and seamless integration with cryptocurrencies. As you explore later chapters, you'll learn how to create your own token on top of Ethereum and build a cryptocurrency wallet graphical user interface (GUI) that can handle Ethereum and Ethereum Request for Comments (ERC-20) tokens using the PySide2 library. This will enable users to seamlessly store, send, and receive digital money. Toward the end, you'll implement InterPlanetary File System (IPFS) technology in your decentralized application to provide a peer-to-peer filesystem that can store and expose media. By the end of this book, you'll be well-versed in blockchain programming and be able to build end-to-end decentralized applications on a range of domains using Python.
Table of Contents (19 chapters)
Free Chapter
1
Section 1: Blockchain and Smart Contracts
5
Section 2: Web3 and Populus
9
Section 3: Frontend Decentralized Applications
11
Section 4: Cryptocurrency and Wallets
14
Section 5: Decentralized Filesystem

What this book covers

Chapter 1, Introduction to Blockchain Programming, teaches the story of Bitcoin and what makes Bitcoin so valuable. You will learn the underlying technology that empowers Bitcoin, which is Blockchain technology. Also, you will learn why Ethereum was created in the first place.

Chapter 2, Smart Contract Fundamentals, shows the differences between traditional programs and smart contracts. You will see what flaws a traditional program has, and why a smart contract has the potential to overcome the flaws. You'll also see where smart contracts are being utilized nowadays.

Chapter 3, Implementing Smart Contracts Using Vyper, teaches you how to write a smart contract by using the Vyper programming language (which resembles Python). You will learn a number of important features of the Vyper programming language.

Chapter 4, Interacting with Smart Contracts Using Web3, shows you how to install the web3.py library, how to interact with a smart contract, and how to deploy a smart contract.

Chapter 5, Populus Development Framework, shows you how to use the Populus development framework and recognize its value to developers.

Chapter 6, Building a Practical Decentralized Application, teaches you how the web3.py library and Populus development framework are used to build a decentralized application.

Chapter 7, Frontend Decentralized Application, shows you how to build a Twitter-like decentralized application with a desktop frontend.

Chapter 8, Creating Token in Ethereum, teaches you how to create your own token. It is a hands-on learning guide on launching your own cryptocurrency.

Chapter 9, Cryptocurrency Wallet, shows you how to build an Ethereum wallet with a desktop frontend.

Chapter 10, InterPlanetary – A Brave New File System, is an introduction to the InterPlanetary File System, where people can store distributed files. In blockchain, storage is expensive. It is already prohibitive to store an image file (never mind a video file) on the blockchain. IPFS is a new technology designed to mitigate that problem. You will learn what IPFS is, and the state this technology is in at this very moment.

Chapter 11, Using ipfsapi to Interact with IPFS, teaches you how to use the Python library to connect to an IPFS node.

Chapter 12, Implementing a Decentralized Applications Using IPFS, shows you how to implement a decentralized video-sharing application that utilizes IPFS technology.