๐”– Scriptorium
โœฆ   LIBER   โœฆ

๐Ÿ“

Hands-On Blockchain for Python Developers: Empowering Python developers in the world of blockchain, 2nd Edition

โœ Scribed by Arjuna Sky Kok


Publisher
Packt Publishing Pvt Ltd
Year
2024
Tongue
Estonian
Leaves
436
Edition
2
Category
Library

โฌ‡  Acquire This Volume

No coin nor oath required. For personal study only.

โœฆ Synopsis


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 exchanges, NFT marketplaces, and lending applications
Unlock deeper levels of insights with technologies relating to blockchain, such as IPFS and Layer 2

Book Description
We are living in the age of decentralized fi nance and NFTs. People swap tokens on Uniswap, borrow assets from Aave, send payments with stablecoins, trade art NFTs on OpenSea, and more. To build applications of this kind, you need to know how to write smart contracts.

This comprehensive guide will help you explore all the features of Vyper, a programming language designed to write smart contracts. Youโ€™ll also explore the web3.py library. As you progress, youโ€™ll learn how to connect to smart contracts, read values, and create transactions. To make sure your foundational knowledge is strong enough, the book guides you through Ape Framework, which can help you create decentralized exchanges, NFT marketplaces, voting applications, and more. Each project provides invaluable insights and hands-on experience, equipping you with the skills you need to build real-world blockchain solutions.

By the end of this book, youโ€™ll be well versed with writing common Web3 applications such as a decentralized exchange, an NFT marketplace, a voting application, and more.

What you will learn
Understand blockchain and smart contracts
Learn how to write smart contracts with Vyper
Explore how to use the web3.py library and Ape Framework
Discover related technologies such as Layer 2 and IPFS
Gain a step-by-step guide to writing an automated market maker (AMM) decentralized exchange (DEX) smart contract
Build innovative, interactive, and token-gated Web3 NFT applications

Who this book is for
This blockchain book is for developers interested in understanding blockchain and smart contracts. It is suitable for both technology enthusiasts looking to explore blockchain technology and programmers who aspire to become smart contract engineers. Basic knowledge of GNU/Linux and Python programming is mandatory to get started with this book.

โœฆ Table of Contents


Hands-On Blockchain for Python Developers
Contributors
About the author
About the reviewers
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Share Your Thoughts
Download a free PDF copy of this book
Part 1:Blockchain and Smart Contract
1
Introduction to Blockchain Programming
Technical requirements
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
Blockchain as a technology that prevents cheating
Proof of stake
Coding on the blockchain
Other types of blockchain programmers
What does it mean to be a blockchain programmer?
The scope of this book
Summary
References
2
Smart Contract Fundamentals
Technical requirements
Smart contract
Secure from cheating
Censorship resistance
Practical applications
Summary
3
Using Vyper to Implement a Smart Contract
Technical requirements
Setting up Vyper
Data types
Boolean
Signed integer
Unsigned integer
Decimal
Address
Fixed-size byte array
Byte array
String
Enum
List
Dynamic arrays
Struct
Mapping
Functions
Mutability
Control structures
Environment variables
Event logging
Interface
Summary
Part 2: Web3 and Ape Framework
4
Using Web3.py to Interact with Smart Contracts
Technical requirements
Installing web3.py
Ganache
Geth
Deploying a smart contract
Interacting with smart contracts
Summary
5
Ape Framework
Technical requirements
Installing Ape Framework
Developing smart contracts
Compiling a smart contract
Deploying the smart contract
Testing smart contracts
Networks in blockchain
Summary
6
Building a Practical Decentralized Application
Technical requirements
Writing the voting smart contract
Writing the unit test of the voting smart contract
Adding delegation to the voting smart contract
The benefits of the decentralized nature of a voting smart contract
Ideas for improvements
Summary
Part 3: Graphical User Interface Applications
7
Front-End Decentralized Application
Technical requirements
Using the voting smart contract with scripts
Compiling the smart contract
Creating accounts
Setting up the Geth development blockchain
Deploying the smart contract onto blockchain
Creating and running the scripts
Installing the PySide library
Creating the voting GUI application
Connecting the GUI application with the smart contract
Summary
8
Cryptocurrency Wallet
Technical requirements
What is a wallet?
Mnemonic keys
Developing a cryptocurrency wallet
Wallet UX
Summary
Part 4: Related Technologies
9
InterPlanetary: A Brave New File System
Technical requirements
The motivation behind IPFS
Merkle DAG
Merkle tree
Directed Acrylic Graph
Content addressing
The Merkle DAG data structure
Peer-to-peer networking
The notion of proximity of data and nodes
XOR distance
Buckets
Summary
10
Implementing a Decentralized Application Using IPFS
Technical requirements
Installing the IPFS software and its library
Exploring the IPFS Python library
The architecture of the decentralized video-sharing application
The architecture of the video-sharing smart contract
The architecture of the video-sharing web application
Writing the video-sharing smart contract
Creating a Bootstrap script
Building the video-sharing web application
Views
Models
Templates
URLs
Demo
Summary
11
Exploring Layer 2
Technical requirements
Understanding L2
How L2 works
Optimistic rollups
Zk rollups
Looking at examples of L2
Polygon
Arbitrum
Optimism
Base
Starknet
zkSync
Deploying smart contracts to L2
Introducing the bridge technology
Bridging ETH
Bridging ERC-20 tokens
Native ERC-20 tokens
Messages
Sending messages from L1 to L2
Sending messages from L2 to L1
Sending messages across L2s
Sending messages across blockchains
Summary
Part 5: Cryptocurrency and NFT
12
Creating Tokens on Ethereum
Technical requirements
How to create a simple token smart contract
The ERC-20 token standard
Selling tokens
Security aspects
Summary
13
How to Create an NFT
Technical requirements
What is an NFT?
ERC-721 standard
Creating the NFT smart contract
Interfaces, events, and state variables
Implementing functions
Unit tests
Summary
Part 6: Writing Complex Smart Contracts
14
Writing NFT Marketplace Smart Contracts
Technical requirements
Understanding the NFT marketplace
Writing the NFT marketplace smart contract
Writing the tests
Enhancing the NFT marketplace
Supporting non-standard NFTs
Supporting ERC-20 tokens
Summary
15
Writing a Lending Vault Smart Contract
Technical requirements
Understanding vaults
The ERC-4626 standard
Lending application
Summary
16
Decentralized Exchange
Technical requirements
Exploring DEXs
Understanding AMM
Market makers
How AMM works
Writing a DEX smart contract
Unit tests
Summary
Part 7: Building a Full-Stack Web3 Application
17
Token-Gated Applications
Technical requirement
Understanding a token-gated application
Creating a signature
ERC-4361
Installing a wallet browser extension
Deploying a token smart contract
Writing a backend application
Writing a frontend application
Summary
Index
Why subscribe?
Other Books You May Enjoy
Packt is searching for authors like you
Share Your Thoughts
Download a free PDF copy of this book


๐Ÿ“œ SIMILAR VOLUMES


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

Hands-On Blockchain for Python Developer
โœ Arjuna Sky Kok ๐Ÿ“‚ Library ๐Ÿ“… 2019 ๐Ÿ› Packt Publishing ๐ŸŒ English

<p><b>Implement real-world decentralized applications using Python, Vyper, Populus, and Ethereum</b></p> <h4>Key Features</h4> <ul><li>Stay up-to-date with everything you need to know about the blockchain ecosystem </li> <li>Implement smart contracts, wallets, and decentralized applications(DApps) u

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 Development in 7 Day
โœ Button, Will ๐Ÿ“‚ Library ๐Ÿ“… 2019 ๐Ÿ› Packt Publishing ๐ŸŒ English

<p><b>Build an Ethereum gaming application from scratch in a span of seven days, by mastering smart contracts in Solidity</b><p><b>Key Features</b><li>Create a simple, functional decentralized application, on the Ethereum network<li>Learn fundamental blockchain programming concepts to become a block