Vigyata.AI
Is this your channel?

Day 5 of Blockchain | Preventing Hacks through Automatic Verifications

878 views· 36 likes· 8:08· Jan 5, 2022

🛍️ Products Mentioned (7)

So it turns out - blockchain is actually pretty cool. I’m super excited to be partnering with Reach and Algorand to create a YouTube series that tackles how to create decentralized applications with blockchain technology. In 10 Days of Blockchain, you’ll learn what a blockchain is, build a decentralized application, and deploy it to the Algorand blockchain. With Day 5 specifically, we'll learn how automatic verifications work and how they can make a given decentralized application more secure. Thank you for watching! ✅ NOTE: Reach documentation at the time of your viewing may be slightly different than when I recorded. When in doubt, follow the documentation, and if you have questions, connect with the Reach community in Discord. ⛓ Discord Community! Reach HQ: https://discord.gg/reachsh Got a question? Ask it here: https://discord.com/channels/628402598663290882/912484855789518848 ⛓ More about Reach! Website: http://reach.sh Links: https://reach.crd.co/ Documentation: https://docs.reach.sh Questions & Support: help@reach.sh ⛓ More about Algorand! Website: https://www.algorand.com/ My courses on LinkedIn Learning! https://www.linkedin.com/learning/instructors/kathryn-hodge Support me on Patreon! https://www.patreon.com/blondiebytes

About This Video

Welcome back to Day 5 of my blockchain series—this is the “security reality check” episode. Up to this point, we built a Rock Paper Scissors dApp where Alice and Bob wager on the outcome… but there’s a huge vulnerability: Bob can cheat and win every single time. I show exactly how that happens when Alice publishes her wager and her hand, because then Bob can read Alice’s hand and compute his own hand on the backend (instead of pulling it from the frontend) so it always beats hers. Then I use Reach’s automatic verification engine to mathematically prove the attack works. I add a require statement that models dishonest Bob (his hand equals Alice’s hand + 1 mod 3), and an assert that the outcome is always 0 (Bob wins). You’ll see the compiler check more theorems, because Reach is proving properties at compile time—not just running tests. Finally, I show why these verifications matter by intentionally breaking the payout logic and letting Reach catch a “balance must end at zero” theorem failure (aka “don’t trap funds in the contract”). I also demo a knowledge assertion (unknowable) to prove Bob shouldn’t know Alice’s hand—and the compile fails because, in our current design, he does. The big takeaway: treat assertions like unit tests—keep them around so security bugs don’t sneak back in.

Frequently Asked Questions

🎬 More from blondiebytes