Rust for Blockchain Application Development Learn to Build Decentralized Applications on Popular Blockchain Technologies Using Rust
Save time, improve stability, and optimize program memory while building decentralized applications on a blockchain using the features and capabilities of Rust Key Features Implement peer-to-peer blockchain using features of the Rust programming language Use Rust to build dApps on popular blockchain...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham, England :
Packt Publishing
[2024]
|
Edición: | First edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009816680006719 |
Tabla de Contenidos:
- Cover
- Title Page
- Copyright and Credits
- Dedicated
- Contributors
- Table of Contents
- Preface
- Part 1: Blockchains and Rust
- Chapter 1: Blockchains with Rust
- Laying the foundation with the building blocks of blockchains
- Blocks
- Hashes
- Transactions
- Security
- Storage versus compute
- Exploring the backbone of blockchains
- Decentralization
- Peers, nodes, validators, and collators
- Consensus
- Mining
- Forking
- Permissioned versus permissionless
- Understanding decentralization
- Replication
- Governance
- Cryptocurrencies and gas fees
- Decentralized platforms
- Tokens versus coins and ICOs
- Smart contracts and NFTs
- DAOs
- Non-censorable apps
- Digital assets with real-world limits
- Scaling the blockchain
- The blockchain trilemma
- Sharding
- Interoperability
- Consensus for scale
- Parallel processing
- Layer 2s and side chains
- ZK rollups and optimistic rollups
- Introducing smart contracts
- The future of the adoption of blockchains
- Industries disrupted
- Sociocultural and economic changes
- Summary
- Chapter 2: Rust - Necessary Concepts for Building Blockchains
- Introducing Rust
- The benefit of being statically typed
- A dive into Rust's applicability as a systems programming language
- The reliability of Rust
- The Rust ownership memory management model
- Garbage collection
- Speed and performance
- Futures, error handling, and memory safety
- Rust's advantage for blockchains
- Blockchains that use Rust
- Foundry for Ethereum
- The Fe, Move, and ink! languages
- Interesting blockchain projects built with Rust
- Advantages of Rust-based languages compared to Solidity
- Learning basic Rust concepts
- Variables and constants
- Data types
- Tuples and arrays
- Numeric operations
- Stack
- Heap
- V-tables
- Slices
- Strings
- Enums.
- Exploring intermediate Rust concepts
- Control flow
- While loops
- Functions
- Match control flow
- Structs
- Vectors
- Delving deep into advanced Rust concepts
- Hashmaps
- Ownership and borrowing
- Crates, modules, and cargo
- Summary
- Part 2: Building the Blockchain
- Chapter 3: Building a Custom Blockchain
- Technical requirements
- Windows installation
- Mac installation
- Ubuntu installation
- VS Code
- rust-analyzer
- Cargo
- Planning our first blockchain project
- Structs
- Required functions
- Getting started with building the blockchain
- Block
- Creating the genesis block
- Using helper functions
- Exploring embedded databases
- Summary
- Chapter 4: Adding More Features to Our Custom Blockchain
- Technical requirements
- Connecting the blocks
- Libraries powering blockchain operations
- Blockchain functions
- Starting the node server
- The server
- Server struct and implemented methods
- Enums
- Helper functions
- The serve function
- The Node struct
- Summary
- Chapter 5: Finishing Up Our Custom Blockchain
- Technical requirements
- Adding memory pools
- Implementing a memory pool
- The BlockinTransit implementation
- Implementing transactions
- Understanding TXInput transactions
- Understanding TXOutput transactions
- Understanding the Transaction implementation
- Utilizing UTXOs and developing wallets
- Implementing UTXOSet
- Implementing wallets
- Wallets
- Setting up configurations and utilities
- The Config implementation
- Utility functions
- Understanding the lib.rs file
- Understanding the Main.rs file
- Using your custom blockchain
- Creating a new blockchain
- Creating a new wallet
- Checking the wallet balance
- Starting a node
- Sending currency
- Listing all wallet addresses
- Printing the blockchain
- Rebuilding the UTXO set
- Summary.
- Part 3: Building Apps
- Chapter 6: Using Foundry to Build on Ethereum
- Introducing Ethereum and Foundry
- Understanding Ethereum
- Why Rust and Foundry?
- Installing Foundry
- First steps with Foundry
- Exploring Foundry
- Working on an existing Foundry project
- Dependencies
- Project layout
- Overview of Forge
- Forge Standard Library overview
- Forge commands
- Understanding Foundry with Cast, Anvil, and Chisel
- Overview of Cast
- Overview of Anvil
- Overview of Chisel
- Cast, Anvil, and Chisel important commands
- Testing and deployment
- Writing tests
- Fork and fuzz testing
- Invariant and differential testing
- Deployment and verification
- Gas reports and snapshots
- A project using Foundry
- Getting started
- A basic NFT
- Testing the program
- Gas reports
- Summary
- Chapter 7: Exploring Solana by Building a dApp
- Introducing dApps
- What are dApps?
- Types of dApps
- Benefits of dApps
- Setting up the environment for Solana
- Installing Rust
- Introducing Solana
- Why Solana?
- Generating a local key pair
- Working with Solana frameworks and tools
- Introducing Anchor
- Creating a new Anchor project
- Building and deploying a dApp
- Building and deploying with Anchor
- Running a local ledger
- Updating the program ID
- Utilizing Anchor scripts
- Testing your dApp
- Creating accounts for our custom dApp
- Defining accounts for our custom dApp
- Implementation of message account structure
- Understanding account sizing and rent in Solana
- Sizing message accounts
- Implementation in code
- Creating our first instruction
- Introduction to instruction creation
- Establishing account constraints
- Implementing logic
- Safeguarding against invalid data
- Instruction versus transaction
- Creating tests for our instructions
- Creating a client for tests
- Sending a message.
- Summary
- Chapter 8: Exploring NEAR by Building a dApp
- Technical requirements
- Prerequisites
- Installation
- Introducing NEAR
- Why choose NEAR?
- Understanding the foundational elements of NEAR
- Learning about the advanced concepts of NEAR
- Transactions and gas
- Data flow
- Tokens and avoiding loss
- Storage options
- Validators and consensus
- NEAR SDK
- Getting started with the NEAR blockchain
- The Contract class
- State and data structures
- Transfers and actions
- Cross contract calls
- NEAR CLI deep dive
- Creating our first project with NEAR
- Understanding the structure and rules of the crossword game
- Setting up the development environment
- Creating a smart contract skeleton
- Testing and deployment
- Interacting with the contract
- Summary
- Part 4: Polkadot and Substrate
- Chapter 9: Exploring Polkadot, Kusama, and Substrate
- Introducing Polkadot
- Interoperability
- Relay chain
- Parathreads
- Bridges
- Accounts
- Transactions
- Tokens and assets
- NFTs
- Understanding the core concepts of PolkaDot
- XCM
- Shared security
- Pallets
- Staking
- Advanced staking concepts
- Main actors
- NPoS election algorithms
- Learning about Kusama
- Governance and on-chain upgrades
- Chaos and experimentation
- Introducing Substrate
- Substrate architecture
- Client and runtime
- Network types
- Node types
- Diving deep into Substrate
- Runtime interfaces
- Core primitives
- FRAME
- Building custom pallets
- Forkless and runtime upgrades
- Consensus
- Summary
- Chapter 10: Hands-On with Substrate
- Technical requirements
- Installing Substrate
- Building our own blockchain
- Starting a local node
- Installing a frontend template
- Starting the frontend template
- Transferring the funds
- Simulating a network
- Starting the first blockchain node
- Adding more nodes.
- Verifying block production
- Summary
- Part 5: The Future of Blockchains
- Chapter 11: Future of Rust for Blockchains
- What the future looks like for Rust blockchains
- Popular blockchains
- Upcoming blockchains
- Upcoming Rust Web3 projects
- The Rust community
- Jobs in the Web3 space
- Popular job roles
- How to find Web3 jobs
- Building a career
- Going beyond this book
- Summary
- Index
- Other Books You May Enjoy.