Inspiration

In April of this year, I registered for a lottery to win tickets for a concert I liked on HK Ticketing. When the winners were announced, I discovered there were a lot of maliciously registered email addresses. There were also rumors that HK Ticketing had set up empty prize pools for specific regions, which made me feel unfairly treated.This experience inspired me to create a fair and transparent ticketing system that leverages blockchain technology to eliminate these issues.

What it does

ChainDraw is a decentralized concert ticketing platform that uses blockchain technology and NFTs to ensure fair and transparent ticket distribution. By leveraging Chainlink VRF for random and verifiable draws, ChainDraw guarantees that every participant has an equal chance of winning. To prevent multiple registrations and scalping, participants are required to pay an equivalent deposit during the subscription phase. This measure ensures that the cost of cheating outweighs the potential benefits, discouraging malicious activities.NFT-based tickets provide a unique, tamper-proof record for each ticket, and secondary market transactions are monitored to prevent price gouging and ensure fair access.Before the concert ends, tickets can only be transferred to the market contract for sale, and the selling price cannot exceed the original face value. This prevents price speculation and black market transactions. Once the concert ends, these restrictions will be lifted, allowing tickets to be freely transferred and sold without price limitations.

How we built it

We built ChainDraw using a combination of cutting-edge blockchain technologies and modern development frameworks.

Current Issues Description

Ticket Scalping and Black Market Trading: In Web2 systems, once tickets are sold, they are often resold at high prices on secondary markets, distorting the original fairness of the ticketing market.

Regional Discrimination Issues: Traditional ticketing platforms may set different winning probabilities or empty prize pools for specific regions. This lack of transparency causes some users to never have a chance to win, leading to accusations of unfairness.

Lack of Verifiability in the Lottery Process: In a Web2 environment, the lottery mechanism is often a black box operation, and users cannot verify the authenticity and fairness of the lottery.

Smart contract

The platform is based on Ethereum, with smart contracts written in Solidity to handle ticket issuance, distribution, and validation. We use Chainlink VRF to generate verifiable random numbers for the ticket lottery, ensuring transparency and fairness.

Implement "NFT Transfer Restrictions," "Sale Restrictions," "Lottery Transparency"

  • Rewrite the ERC721 _transfer function to implement transfer restrictions.
    • Concert ongoing: Users can only sell and buy tickets through the market contract, enabling Ticket transfers.
    • Concert ended: Users can freely transfer their NFT Tickets.
  • Utilize the Factory design pattern to build the lottery contract, ensuring a one-to-one relationship between concert ticket types and the lottery pool, enhancing lottery transparency.
    1. Every ticket lottery contract created by a user is managed through the factory contract, ensuring that unregistered contracts cannot be listed. This ensures the stability of the market contract and serves only validly registered users.
    2. Sale price control:
      • Concert ongoing: Sale price cannot exceed the original price (the deposit paid during the lottery).
      • Concert ended: No price limit on sales.
    3. User identity verification: NFTs are bound to user information to achieve "one person, one ticket," providing dual verification.
      • Dual verification: 1. Users prove they own the NFT for the event. 2. Users prove the identity information bound to the NFT is theirs.

Frontend

Our frontend is developed using React.js, some components such as wagmi,ethers,rainbow,siwe ,subgraph and graphql, allowing users to easily interact with the platform through a user-friendly interface.

Backend

In addition to the blockchain and frontend components, we implemented backend services using Go (Golang). These services handle data storage and queries, such as user metadata and transaction logs, providing a reliable and efficient infrastructure to support the platform's operations.The backend also listens to events from on-chain lottery and market contracts, collecting these events and storing them in a MySQL database to support subsequent business processes and workflows.

Challenges we ran into

From brainstorming and defining feature sets to technology selection, individual task assignments, and team collaboration to implement and integrate features, completing this project within a month in our spare time was a significant challenge.Integrating Chainlink VRF and ensuring seamless communication between the smart contracts, backend services, and the frontend was technically demanding.Additionally, ensuring the scalability and efficiency of the platform to handle large numbers of participants and transactions was a critical concern.

Accomplishments that we're proud of

We are proud to have developed a fully functional prototype of ChainDraw that successfully integrates blockchain technology, NFT-based tickets, and Chainlink VRF for fair and transparent ticket distribution.Through various internal tests, we successfully navigated the entire process.

What we learned

Throughout the development of ChainDraw, we reinforced much of our previously learned web3 knowledge, such as how Ethereum operates, advanced Solidity syntax, ERC-20 standards, and ERC-721 standards.We learned the importance of combining different technologies to solve complex problems. We gained valuable experience in blockchain development, smart contract programming, backend development with Go, and integrating decentralized services like Chainlink VRF. We also learned the significance of user experience and the need for a seamless and intuitive interface for participants. The feedback from our initial tests highlighted the importance of continuous improvement and iteration based on user input.

What's next for ChainDraw-Fair-Ticket

  1. To further enhance the system, we utilized Chainlink Automation to schedule and trigger the lottery draws automatically. This automation reduces human intervention, lowers operational costs, and increases system reliability.
  2. We aim to enhance the platform by incorporating additional features such as dynamic pricing models, loyalty rewards for frequent users, and enhanced analytics for event organizers.
  3. Our ultimate goal is to revolutionize the ticketing and lottery industries by making distribution processes fair, transparent, and secure for all types of events.

Built With

Share this project:

Updates