Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Blockchain for Python Developers

You're reading from   Hands-On Blockchain for Python Developers Empowering Python developers in the world of blockchain and smart contracts

Arrow left icon
Product type Paperback
Published in Jun 2024
Publisher Packt
ISBN-13 9781805121367
Length 436 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Arjuna Sky Kok Arjuna Sky Kok
Author Profile Icon Arjuna Sky Kok
Arjuna Sky Kok
Arrow right icon
View More author details
Toc

Table of Contents (27) Chapters Close

Preface 1. Part 1:Blockchain and Smart Contract FREE CHAPTER
2. Chapter 1: Introduction to Blockchain Programming 3. Chapter 2: Smart Contract Fundamentals 4. Chapter 3: Using Vyper to Implement a Smart Contract 5. Part 2: Web3 and Ape Framework
6. Chapter 4: Using Web3.py to Interact with Smart Contracts 7. Chapter 5: Ape Framework 8. Chapter 6: Building a Practical Decentralized Application 9. Part 3: Graphical User Interface Applications
10. Chapter 7: Front-End Decentralized Application 11. Chapter 8: Cryptocurrency Wallet 12. Part 4: Related Technologies
13. Chapter 9: InterPlanetary: A Brave New File System 14. Chapter 10: Implementing a Decentralized Application Using IPFS 15. Chapter 11: Exploring Layer 2 16. Part 5: Cryptocurrency and NFT
17. Chapter 12: Creating Tokens on Ethereum 18. Chapter 13: How to Create an NFT 19. Part 6: Writing Complex Smart Contracts
20. Chapter 14: Writing NFT Marketplace Smart Contracts 21. Chapter 15: Writing a Lending Vault Smart Contract 22. Chapter 16: Decentralized Exchange 23. Part 7: Building a Full-Stack Web3 Application
24. Chapter 17: Token-Gated Applications 25. Index 26. Other Books You May Enjoy

Consensus

As we can see, the hashing function makes history tampering hard, but not too hard. Even if we have a blockchain that consists of 1000 blocks, it would be trivial to alter the content of the first block and change the 999 parent hashes on the other blocks with recent computers. So, to ensure that bad people cannot alter history (or at least make it hard), we must distribute this append-only database to everyone who wants to keep it (let’s call them miners). Say there are 10 miners. In this case, you cannot just alter the blockchain in your copy because the other nine miners would scold you, saying something like Hey, our records say history A but your record says B. In this case, the majority wins.

However, consensus is not just a case of choosing which blockchain has been chosen by the majority. The problem starts when we want to add a new block to the blockchain.

Where do we start? How do we do it?

The answer is that we broadcast. When we broadcast the candidate...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime