Vigyata.AI
Is this your channel?

Day 6 of Blockchain | Adding Testing and Automatic Verifications to a Decentralized Application

818 views· 27 likes· 14:44· Jan 6, 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 6 specifically, we'll make our Rock, Paper, Scissors application more secure by adding automatic verifications. 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

In Day 6 of my blockchain series, I take our Rock, Paper, Scissors dApp and make it way more secure by adding testing and automatic verifications in Reach. Because we’ve been changing a lot, I start from a fresh version and rewrite the program as a full review. Along the way, I clean up the logic by using enums for hands (Rock/Paper/Scissors) and outcomes, which makes the code easier to read than juggling raw numbers. I also pull the “who won?” logic into a dedicated `winner` function so it’s testable and reusable. Then I get into the fun part: proving things about the program. I add assertions as test cases (like specific Rock vs Scissors scenarios), and I also use `forall` to express stronger guarantees—like “no matter what the inputs are, `winner` always returns a valid outcome,” and “if both hands match, it’s always a draw.” Reach can verify these insanely fast using symbolic execution, so you’re not brute-forcing billions of values. Finally, I protect Alice’s hand using `makeCommitment` (commitment + salt), add `hasRandom` to the participant interface/front end, and use `unknowable` to ensure Bob can’t learn Alice’s hand or salt early. The result compiles cleanly, runs with basically the same front-end output, and removes exploitable gameplay bugs—though we still need to handle non-participation next.

Frequently Asked Questions

🎬 More from blondiebytes