Inspiration
There are always situations in web3 space where bots are a problem. Often with general NFT sales, but also when you want to buy a ticket, or in web3 gaming. For example as soon as an NFT sale starts, all items are sold. With this project, we would like to counter that.
What it does
Solve3 is a captcha service for smart contracts. It combines captchas and advertising campaigns to give the user an additional incentive and enables the placement of ads in web3 applications.
The user has to solve a captcha, which creates a proof. By using this proof, the user is able to execute the smart contract function and earns protocol token.
How we built it
On a high level, Solve3 consists of 3 components.
The JavaScript frontend module which loads the captcha data from the backend server and opens the captcha modal.
The backend server, which is written in JavaScript, using nodejs, express and websockets.
The frontend establishes a websocket connection to the backend server. A handshake is performed and then the user signs the handshake. Based on the signed message a captcha is created for the address of the signer.
The backend validates the solution of the captcha. If the solution is valid, the backend sends a proof to the frontend. Using this proof, the user is able to execute the function of the destination smart contract.
The destination smart contract must implement the Solve3Verify which interacts with the Solve3Verifier contract. Both contracts check the validity of the proof before the actual logic is executed and the earned protocol token are send to the user. The Solve3Verify vars can be adjusted. For example the time a proof is valid. The Solve3Verifier checks (for now) if a contract is added as beta tester and if the validator of the proof is an actual legit validator.
For now only the owner can add the advertisment campaigns to the Solve3Verify contract. By adding a new campaign, protocol tokens are send to the contract, which pay the user.
Challenges we ran into
Cors! :D
First we implemented the backend with REST and the captcha as a popup.
The problem with REST was that it is theoretically possible for bots to send an "infinite" number of requests. With websockets we are able to limit the requests to 1-2 active websocket connections per ip and also build in delay times.
The popup approach worked on desktop, but on mobile there were problems with the different browsers. With the switch to a modal, these problems have been solved.
Our first attempt was some fancy ascii art captcha. But 48hrs before the hackathon ends, we had the idea of combining captchas and ad campaigns. So we had to rewrite everything. That was a real hackathon feeling.
Accomplishments that we're proud of
We built everything in a very short time and through several iterations it has become a good product. The first interviews show that there is a market for such a service and the first beta testers have already announced themselves.
And since we are not designers, we are very proud of the logo. It turned out really nice. :)
What we learned
Since we're smart contract devs, we have learned a lot about developing frontend and backend servers. We worked with websockets and for the first time ever.
What's next for Solve3
This is the point I am most looking forward to.
The feedback from others shows that Solve3 solves a real problem and that motivates us to develop it further. We already have some really good ideas on how to proceed.
First of all, we need a nice landing page, social media accounts, etc.. And since the final version was built during the past two days of the hackathon, we need to improve a few things.
To implement it much more easy, we want to create npm packages for the contract and the modal.
Of course we want to make it bullet proof, therefore we want to ask beta testers for their feedback and also look for "hackers" who try to hack the captcha.
Demo
See our demo presentation on youtube or You can try our demo at demo and earn some SLV token on mumbai by solving our captcha :)
The demo is deployed using spheron. Kudos to spheron team. The deployment was so simple, we will use it in future too :)
Built With
- express.js
- hardhat
- javascript
- react
- solidity
- spheron
- websockets




Log in or sign up for Devpost to join the conversation.