© Kedar Iyer and Chris Dannen 2018
Kedar Iyer and Chris DannenBuilding Games with Ethereum Smart Contractshttps://doi.org/10.1007/978-1-4842-3492-1_9

9. Prize Puzzles

Kedar Iyer1  and Chris Dannen1
(1)
Brooklyn, New York, USA
 

Prize puzzles are a unique use case for smart contracts and a great example of blockchains unlocking new functionality. The idea behind a prize puzzle is for a benefactor to put up a bounty for answering a question, using a smart contract to verifiably lock up the reward so that only the correct answer can unlock the contract.

In this chapter, we will create two types of prize puzzles: a simple puzzle that unlocks immediately when the answer is provided and a commit-reveal style puzzle that permits multiple winners. We will then ...

Get Building Games with Ethereum Smart Contracts: Intermediate Projects for Solidity Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.