Skills Learned:
- Transacting w/Smart Contracts
- OOP in the Solidity IDE
- Balancing efficiency and Gas cost
Created a computationally-infeasible hash puzzle wager system. The difficulty of the puzzle and the reward amount decrease by a factor of two every hour.
The smart contract is a wager-backed puzzle where a user can win by computing hash function outputs with leading zeroes. The difficulty, indicated by the contract owner, is the number of leading zeroes required for a user to win the wager.
A winning hash (for a difficulty of 4) is computed as such:
0x00004fg3108gsln... = SHA256(input)