𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Hands-On Blockchain for Python Developers: Gain blockchain programming skills to build decentralized applications using Python

✍ Scribed by Arjuna Sky Kok


Publisher
Packt Publishing
Year
2019
Tongue
English
Leaves
436
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Implement real-world decentralized applications using Python, Vyper, Populus, and Ethereum

Key Features

  • Stay up-to-date with everything you need to know about the blockchain ecosystem
  • Implement smart contracts, wallets, and decentralized applications(DApps) using Python libraries
  • Get deeper insights into storing content in a distributed storage platform

Book Description

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.

What you will learn

  • Understand blockchain technology and what makes it an immutable database
  • Use the features of web3.py API to interact with the smart contract
  • Create your own cryptocurrency and token in Ethereum using Vyper
  • Use IPFS features to store content on the decentralized storage platform
  • Implement a Twitter-like decentralized application with a desktop frontend
  • Build decentralized applications in the shape of console, web, and desktop applications

Who this book is for

If you are a Python developer who wants to enter the world of blockchain, Hands-On Blockchain for Python Developers is for you. The book will be your go-to guide to becoming well-versed with the blockchain ecosystem and building your own decentralized applications using Python and library support.

Table of Contents

  1. Introduction to Blockchain Programming
  2. Smart Contract Fundamentals
  3. Implementing Smart Contract Using Vyper
  4. Interacting With Smart Contract Using Web3
  5. Populus Development Framework
  6. Building a Practical Decentralized Application
  7. Front-end Decentralized Application
  8. Creating Token in Ethereum
  9. Cryptocurrency Wallet
  10. Inter Planetary: A Brave New File System
  11. Using Py-ipfs-api to Connect to Decentralized File System
  12. Implementing Decentralized Application Using IPFS

✦ Table of Contents


Cover
Title Page
Copyright and Credits
About Packt
Foreword
Contributors
Table of Contents
Preface
Section 1: Blockchain and Smart Contracts
Chapter 1: Introduction to Blockchain Programming
TheΒ rise of cryptocurrency and blockchain
Blockchain technology
Signing data in blockchain
From linked list to blockchain
Cryptography
Symmetric and asymmetric cryptography
The hashing function
Proof of work
Consensus
Coding on the blockchain
Other types of blockchain programmers
Summary
References
Chapter 2: Smart Contract Fundamentals
Installing an Ethereum development environment
Installing Node.js
Installing Truffle and Solidity
Installing Ganache
Writing a smart contract
Deploying a smart contract to Ethereum blockchain
Interacting with smart contracts
Sending ether to smart contracts
Why smart contracts?
Summary
Further reading
Chapter 3: Implementing Smart Contracts Using Vyper
Motivations behind Vyper
Installing Vyper
Creating a smart contract with Vyper
Deploying a smart contract to Ganache
Interacting with smart contracts
Going deeper into Vyper
Data types
Withdrawing ethers
Other data types
Useful built-in functions
Events
Interacting with other smart contracts
Compiling code programmatically
Other tricks
Summary
Section 2: Web3 and Populus
Chapter 4: Interacting with Smart Contracts Using Web3
Introduction to decentralized applications
Installing web3
Geth
Geth console
Understanding the web3.py library
Gas and gas price
Nonce
Creating a transaction on Rinkeby
Interacting with smart contracts using web3.py
Launching a smart contract with Geth
Launching a smart contract with web3
Playing with a smart contract
Summary
Chapter 5: Populus Development Framework
Setting up Populus
Adding support for Vyper
Smart contract unit test
Using arguments in the constructor
Deploying a smart contract with Populus
Summary
Chapter 6: Building a Practical Decentralized Application
Developing a simple voting application
Deploying a smart contract that has arguments in its constructor
Developing a commercial voting application
Developing a token-based voting application
Summary
Further reading
Section 3: Frontend Decentralized Applications
Chapter 7: Frontend Decentralized Application
Setting up the Qt GUI library
Choosing a GUI library
Installing Qt for Python
Crash course on Qt for Python
Layout
Other widgets
Callback
Threading
Writing the smart contract for the Twitter–like application
Test
Fixtures
Building the GUI frontend for the Twitter–like application
Summary
Section 4: Cryptocurrency and Wallets
Chapter 8: Creating Token in Ethereum
Token smart contract
Mist
ERC20
Selling a token
Stable coin
Summary
Further reading
Chapter 9: Cryptocurrency Wallet
Advanced features of the PySide2 library
Testing application
Advanced features of Qt for Python or PySide2
Building a cryptocurrency wallet
Blockchain class
Thread classes
Identicon and Icons
Building widgets
Account widget
Sending a transaction widget
Token widget
Test
Considerations when building a cryptocurrency wallet
Security
User experience
Summary
Section 5: Decentralized Filesystem
Chapter 10: InterPlanetary - A Brave New File System
The motivation behind IPFS
Merkle DAG
Merkle tree
Directive Acrylic Graphs (DAGs)
Content addressing
The Merkle DAG data structure
Peer-to-peer networking
The notion of closeness of data and nodes
XOR distance
Buckets
Summary
Chapter 11: Using ipfsapi to Interact with IPFS
Installing the IPFS software and its library
Content hashing
Protobuf
Multihash
Base58
Combining protobuf, multihash, and base58
The ipfsapi API
IPNS
Pinning
Pubsub
Mutable File System
Other APIs
Summary
Further reading
Chapter 12: Implementing a Decentralized Application Using IPFS
Architecture of the decentralized video-sharing application
Architecture of a video-sharing smart contract
Architecture of a video-sharing web application
Writing the video-sharing smart contract
Launching a privateΒ Ethereum blockchain
Creating a bootstrap script
Building the video-sharing web application
Views
Models
Templates
Urls
Demo
Note
Summary
Further reading
Other Books You May Enjoy
Index


πŸ“œ SIMILAR VOLUMES


Hands-on Blockchain for Python developer
✍ Kok, Arjuna Sky πŸ“‚ Library πŸ“… 2019 πŸ› Packt Publishing 🌐 English

Implement real-world decentralized applications using Python, Vyper, Populus, and Ethereum Key Features Stay up-to-date with everything you need to know about the blockchain ecosystem Implement smart contracts, wallets, and decentralized applications(DApps) using Python libraries Get deeper insights

Hands-on Blockchain for Python developer
✍ Kok, Arjuna Sky πŸ“‚ Library πŸ“… 2019 πŸ› Packt Publishing 🌐 English

Implement real-world decentralized applications using Python, Vyper, Populus, and Ethereum Key Features Stay up-to-date with everything you need to know about the blockchain ecosystem Implement smart contracts, wallets, and decentralized applications(DApps) using Python libraries Get deeper insights

Hands-On Blockchain for Python Developer
✍ Arjuna Sky Kok πŸ“‚ Library πŸ“… 2024 πŸ› Packt Publishing Pvt Ltd 🌐 Estonian

Write popular DeFi and NFT smart contracts with Vyper, a Pythonic programming language, and integrate blockchain with real-world applications using Python Key Features Use the world's easiest programming language to build web3 applications Write common smart contracts like decentralized exchang

Hands-On Blockchain for Python Developer
✍ Arjuna Sky Kok πŸ“‚ Library πŸ“… 2024 πŸ› Packt Publishing 🌐 English

<p><span>Write popular DeFi and NFT smart contracts with Vyper, a Pythonic programming language, and integrate blockchain with real-world applications using Python</span></p><p><span>Key Features: </span></p><p><span>- Use the world's easiest programming language to build web3 applications</span></p

Python Programming Handbook for Blockcha
✍ Mackay , Hazel πŸ“‚ Library πŸ“… 2024 πŸ› Independently Published 🌐 English

Welcome to the Blockchain Revolution with Python! The world is on the cusp of a technological transformation. Blockchain technology, with its promise of decentralization, security, and transparency, is poised to disrupt countless industries. At the forefront of this revolution lies Python, a powe