https://docs.google.com/presentation/d/1CkDXqZk6Zq4Kv-Zl4Fc95QZmIXMTUyuMwI_C0Uk6yTo/edit?usp=sharing
Cerberus is an on-chain solution to improve web3 IRL experience.
IRL Blockchain events have an important role in the crypto space, and right now they are in a very early stage, usually lacking of on-chain tangible experience.
In the upcoming years, mobile web3 phones will probably be our straight path to that experience. Because of that, we must start building for them.
Cerberus has been designed to improve the user experience on events, being a perfect way to bring web3 in a more tangible way.
Also, this project is aiming to normalize the use of crypto in the society, being a good way to feel crypto more tangible than ever.
At the entrance of the event there will be an IP Camera transmitting video to our local computer through WiFi.
These frames will be analyzed using Deep Learning , aiming to detect QR codes from wallets and decoding them to obtain the wallet PublicKey.
Once obtained the wallet, our backend will immediately whitelist this PublicKey on our Whitelisting Contract in Solana Blockchain.
This Whitelisting Contract is an on-chain program, designed to store wallets using PDAs. Also, a counter will be integrated in another program to know the number of wallets stored.
Everything with Smart Contracts.
Once the wallet is whitelisted, we will have the option to instantly send NFTs to this user, so he/she could be able to redeem these NFTs inside the event.
https://www.youtube.com/watch?v=tE3eFMNeNOg
You will have to install 3 main things: Python Dependencies, Typescript dependencies and Anchor + Solana.
cd QR-python-API-darknet
pip3 install opencv-python pyzbar pandas tempfile json numpy
cd server-FastApi
pip3 install fastapi
cd backend-smart-contract
npm i
To install Solana and Anchor follow this URL : https://book.anchor-lang.com/getting_started/installation.html
Ok, this is a tricky part because the path to follow depends on the OS of your computer that you will use to run the Python. In my case I am using macOS in the computer + iPadOS in the IP Camera, and for that reason I am using a 3rd Party called EpocCam Pro, that you could find in the Apple Store.
You will need Solana and Anchor installed. Also, make sure you have more than 10.5 SOL in the wallet or it will fail.
In order to get the 10 SOL just run solana airdrop 2 ~/.config/solana/id.json
5 times until you get them.
Having completed that, please execute this to build and deploy the anchor program:
anchor build
anchor deploy
After you have installed all the dependencies, you are ready to run all the process.
You will be running the entire process in 3 shells: Python AI QR Scan + Python server + Typescript Backend.
Considering that you already have EpocCam Pro/"Your IP App" ready, you only will need to execute in the shell:
cd QR-python-API-darknet && python3 main.py
cd server-FastApi && uvicorn main:app --reload
Before running the backend, please make sure the "../keypair.json" and "../keypair_whitelist.json" are actually the Keypairs you want to store the info.
I created a Javascript script to generate them in case you want to get new ones. Just running:node createKeypair.js
inside the backend folder.
Completed the Keypair step, you are ready to run the backend!
Running the backend:
anchor run backend
Backend Showcase:
For testing the Smart Contracts I have used multiple cases, with different parameters and situations when calling the functions.
In the project you will find 3 tests inside the test directory. You will be able to run all them with anchor run test
.
anchor run whitelist
anchor run counter
anchor run minter
Created by 0xCleon