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 to interact with smart contracts and leverage the power of both the 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
Section 1: Blockchain and Smart Contracts
Section 2: Web3 and Populus
Section 3: Frontend Decentralized Applications
Section 4: Cryptocurrency and Wallets
Section 5: Decentralized Filesystem

Selling a token

Now that we have a token, it's time to sell the coins. We want to sell our custom token for ethers. A crowdsourcing token is very easy do create on the Ethereum platform compared to the Bitcoin platform. You already know how to create a method in a smart contract to accept ethers. You also know how to increase the token balance of some accounts. To sell tokens, you must combine those two things. That's all.

This is the core of the Initial Coin Offering (ICO). The currency of Ethereum is valuable. Although the price of ether fluctuates, 1 ether is valued at around USD 100. People would pay real money for some ethers, but not our custom token. To make our custom token worthy, we have to make it useful first, or at least make it appear useful. But to do that, we need capital. So why not sell some of our tokens (say 60%) to early adopters? They can then...