Project Name: ZkTickets - An event ticketing protocol using ZKP
Project Track: Web3
Team Name: StrawberryChocolateFudge
Team Member(s): StrawberryChocolateFudge
Github Link : GitHub - StrawberryChocolateFudge/ZkTickets: A Crypto Note based event ticketing platform
Dorahacks Project Link: COMING SOON
Project Goal: The goal was to create an event ticketing solution built with ZKP that mimics the use of platforms like Resident Advisor.
Project Info:
I uploaded an image that explains how ZK Tickets work.
Project Website: https://btt.zktickets.xyz/
Project Test Instructions:
INSTRUCTIONS:
- Open up the website https://btt.zktickets.xyz/
- Click the create events button
- Here you can fill out a form to create and event
The name is the name of the event, 50 characters max
The price is per ticket in BTT
The available tickets is how many will be sold
The handler is an optional contract address that implements an interface like this:
interface ExternalTicketHandler { function ticketAction(address sender, address ticketOwer) external; }
This allows you to add an external contract to call when the tickets are scanned. The msg.sender and the address of the ticket owner is available. So a dev can add extra logic.
-
Click Create Event and confirm this transaction.
When it’s done you are redirected to a new page. -
Here you can see the URL contains an index, like this
https://btt.zktickets.xyz/tickets?i=1
You can share this on your website like: Purchase ZKTicket
On this page the user can interact with the event to purchase tickets or handle them.
-
Click on Purchase tickets. Here you can see the price, how many is left and the address of the event creator who will receive your payment.
-
Click purchase ticket and confirm the transaction. The download of the PDF should start.
The PDF contains the secret for your ticket and if the transaction succeeded the ticket is valid. -
To invalidate tickets or to verify them, reload the page and click on Handle tickets
-
Here you can paste the ticket code which is on the bottom of the PDF or you can hit the button validate ticket and that will open up the QR code scanner.
-
If the Ticket is valid, you will see the button to invalidate it. You can click on it and sign a transaction or go back.
When you invalidate the ticket, is when the ExternalHandler is invoked. So you can chose to perform a custom action this time.
SOME IMPORTANT CHANGES
A Native Mobile App Development now. The performance of mobile browsers is not good for real life ticket scanning applications! The mobile wallet will contain a non-custodial wallet and QR code scanner to handle tickets.
Project Details:
The project was born out of interest to create a ticketing solution like Resident Advisor without a backend that supports decentralized hosting.
I develop crypto note based technologies and this fits the use-case.
I purchased some tickets for an event a few days before I started development and all it was is payment and I received a QR code that was scanned at the entrance of the venue. This seemed quite an interesting challenge to implement as a decentralized crypto note protocol so I decided to do it.
ZKTickets is built using Circom, Solidity, Hardhat, Parcel and Vanilla Typescript, HTML and CSS.
I created the zero-knowledge circuits using the circom languge, it’s arithmetic circuit logic that allows me to create the zero knowledge proofs. The user generates a secret and a nullifier and they are both hashed using Poseidon Hash. The hash of the secret+ nullifier is called a commitment, and the hash of the nullifier by itself is called the nullifierHash. These are the hashes that will be dispatched in the transactions to the blockchain so the secret itself is never revealed to anyone.
The Solidity code handles the tracking of ticket validity, the verification and the sale. The tickets are sold for BTT. When tickets are invalidated the contract can call an external solidity contract that allows somebody to extend the protocol.
Hardhat was used for the development and testing and finally Parcel was used to build the front ends.
I used vanilla TS,HTML, CSS to reduce vulnerabilities that stem from using frameworks like React and it makes development feel fun and fresh.
UPDATE:
The A Native Mobile app is under development ticket handling.
Smart Contract links: COMING SOON
Project Milestones:
Create Circom circuits
develop smart contracts
test smart contracts
develop front end for event creation
front end for purchasing tickets
generating zkp and rendering it as pdf
Qr code scanner page, Optimized for brave browser on mobile
Testnet deployments
Front end deployments
Ticket handler mobile app in development
Hackathon submission
Mainnet deployment
New Features: Ticket Transfer/Resale/Refund will be built into the next version of the smart contract