project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

Habitrac

Habit-Building Game Where Friends Can Hold Each Other Accountable Using Smart Contract Deployed In Polygon zkEVM And XMTP Token-Gated Chat. Users Stake Joining Bets In ETH And Earn Real Prizes Directly Deposited Into Appropriate Blockchain Wallets

Habitrac

Created At

ETHGlobal Paris

Winner of

🏊 zkBob — Pool Prize

Project Description

Habitrac is an innovative project that aims to revolutionize habit-building by merging blockchain technology, smart contracts, and secure messaging protocols. It is a Habit-Building Game designed to empower friends, families, or couples to hold each other accountable to their goals in a fun and rewarding way. By utilizing the power of Polygon zkEVM, the project ensures high scalability and cost-effectiveness. We meant for Habitrac to utilize XMTP's token-gated E2EE messaging protocol technology, which ensures secure and private communication among users, however we are having some trouble integrating it, so that will be saved in the backlog for future use.

Habitrac offers a unique approach to habit-building, as it combines the principles of accountability, rewards, and social interaction. Users begin by connecting their MetaMask wallets, which link their blockchain addresses and facilitate seamless transactions on the platform. The integration of MetaMask SDK ensures a user-friendly and secure login process.

Upon logging in, users can create and invite friends, family members, or partners to join their habit-building journey. With XMTP, Habitrac leverages the decentralized and secure XMTP token-gated E2EE messaging protocol technology to provide a private and trustworthy space for users to interact and encourage one another. This ensures that users can freely share their progress, experiences, and challenges without compromising their privacy. Without XMTP, all chats and media upload would have to be done through the Wordpress user interface or separate platforms, and proofs would currently have to be manually verified through human click of a button by the players on the Wordpress website confirming photos proofs of action have been received and accepted.

The core of Habitrac's gamified approach lies in the "Bluff!" game, where users stake a certain amount of tokens as a joining bet in ETH. Each participant sets daily or weekly habits and commits to completing them regularly. The smart contract deployed in Polygon zkEVM automatically tracks and records users' habit completion based on real-time data.

In the spirit of friendly competition, users can call their friends out if they fail to complete their designated habits. This social aspect further strengthens accountability and encourages active participation.

Notably, Habitrac introduces a real reward system as an incentive for participants. Upon completing their habits consistently and successfully calling out their friends on non-completion, users can claim real prizes. These rewards are directly deposited into the winners' blockchain wallets through an automated process executed by smart contracts, ensuring transparency and efficiency.

The project aims to infiltrate the day-to-day lives of the mass public by targeting small but impactful habit-building use cases such as exercising, staying hydrated, or reading regularly. By making habit-building a social and rewarding experience, Habitrac seeks to inspire positive behavioral changes and empower individuals to achieve their personal goals effectively.

Future Direction:

Habitrac is committed to continuous improvement and innovation. In its future direction, the project envisions integrating smart tools and AI to verify habit completions without human judgment or involvement. Leveraging advanced technologies, Habitrac aims to autonomously track users' progress and interactions, enhancing the platform's efficiency and user experience.

Additionally, Habitrac seeks to expand its application to encompass a broader range of habit-building scenarios and cater to diverse user needs. By remaining at the forefront of blockchain technology and smart contract developments, Habitrac aims to set new standards in habit-building platforms, leading the way towards a more accountable, incentivized, and interconnected community of individuals striving to improve themselves through positive daily habits.

In our prototype, we demonstrate the following example use case: Daily Dog Walking, Rain or Shine.

In this probable real-life scenario, two friends share a common goal - to walk their dogs every day, ensuring their furry companions' maximum happiness. To hold each other accountable and make the habit more engaging, they decide to utilize Habitrac, a habit-building smart contract platform.

Using the browser-based frontend interface, they create a customized agreement for a 21-day habit-building challenge. To join the game, each friend stakes 0.0123 ETH (approximately 21 EUR) into the prize pool, committing themselves to the daily dog-walking goal.

Every day, Habitrac sends them timely reminders to upload photo proof of their dog walks (this feature is planned for future implementation). They agree that the photo proof must be uploaded by 11:00 PM and should clearly demonstrate that they are outside their houses with their dogs at the time the photo was taken. The app timestamps the photos immediately upon capturing.

Notably, the photos are not sent out immediately; instead, they are held by the app until 11:00 PM. If a player fails to upload a photo by the deadline, the app sends out a blank image as a "Bluff!" to signal the potential absence of a genuine dog walk.

Between 11:01 PM to 1:00 AM, the two friends have the opportunity to challenge each other's proof by calling "Bluff!" To do so, the challenging friend must deposit 0.00060 ETH (approximately 1 EUR) as a commitment to question the authenticity of the photo.

If one friend correctly calls "Bluff!" on the other and provides evidence of a fake photo, the friend who failed to complete the day's dog walk loses their stake of 0.00060 ETH to the friend who called them out. However, if the challenged photo is genuine, the challenging friend forfeits their deposited amount as a penalty.

The game continues until the 21-day contract duration is complete or until one person's balance reaches zero, whichever happens first. At the end of the challenge, the final balance resulting from the game is available for claiming, and the rewards are directly deposited into the players' respective wallets.

With the innovative features of Habitrac, the two friends make their daily dog-walking routine fun, accountable, and rewarding. By leveraging blockchain smart contracts, photo verification, and a "Bluff!" system, Habitrac transforms a simple habit into an exciting and incentivized journey, fostering trust, camaraderie, and the well-being of their beloved pets.

Accountability is a fundamental pillar of a thriving society, both within small personal circles and on a larger scale through social applications. At its core, accountability represents the responsibility and commitment individuals have to uphold their promises, actions, and behaviors. It forms the backbone of trust, integrity, and progress, fostering a culture of reliability and transparency.

In personal circles, accountability ensures that individuals honor their commitments to friends, family, and colleagues. It strengthens relationships, as people can rely on one another to follow through with their words and actions. This level of accountability promotes teamwork, support, and a sense of community, leading to personal growth and collective success.

On a larger scale, social applications and platforms have recognized the significance of accountability in driving positive behaviors and achieving common goals. In this context, blockchain technology, decentralized networks, and smart contracts have emerged as transformative tools to execute accountability in a transparent, secure, and efficient manner.

Blockchain technology enables immutable record-keeping, providing an auditable trail of actions and commitments. Smart contracts, deployed on decentralized platforms like Polygon zkEVM and XMTP, offer programmable agreements that automatically execute when predetermined conditions are met. This combination creates an environment of self-governance, where participants can hold each other accountable without relying on centralized authorities.

The benefits of having a way to execute accountability through smart contracts, decentralization, and blockchain technology are numerous. It eradicates the need for intermediaries, reduces the potential for fraud and manipulation, and fosters a culture of transparency and fairness. Participants can trust that their contributions and accomplishments will be accurately recorded and rewarded, as real prizes are directly deposited into their appropriate blockchain wallets.

In Personal Circles, many scenarios can happen on a day-to-day basis involving Accountability, and a decentralized, blockchain/smart contract tool such as our habit-building game can significantly enhance accountability in personal circles.

Personal Fitness Journey:

Two friends decide to embark on a fitness journey together. They hold each other accountable by regularly checking in on their progress, encouraging each other during workouts, and sharing healthy meal plans. This mutual accountability not only helps them stay on track with their fitness goals but also strengthens their friendship.

The habit-building game such as ours on a decentralized platform aims to allow friends to set and track their fitness goals using smart contracts. Each participant commits to specific daily or weekly habits related to exercise, diet, or other fitness activities. The smart contract records their progress transparently on the blockchain, and all participants can view each other's achievements.

The Benefits: a. Transparency: All participants can see each other's progress, fostering a sense of transparency and motivation to stay on track. b. Automation: Smart contracts automatically update the participants' achievements based on their daily or weekly activities, eliminating the need for manual tracking. c. Incentives: The game can offer rewards or tokens for consistently meeting fitness goals, encouraging participants to stay accountable.

Study Buddies:

In college, a group of friends forms a study group to help each other succeed academically. They set up study sessions, review each other's assignments, and offer constructive feedback. This accountability network boosts their motivation to excel in their studies and fosters a supportive learning environment.

The habit-building game can be adapted for study goals, where friends set study routines, assignment deadlines, and exam preparation targets. They can share study resources, collaborate on projects, and provide feedback through the platform.

The Benefits: a. Collaboration: The platform facilitates seamless collaboration among study buddies, improving accountability through shared responsibilities. b. Notifications: The game can send reminders and notifications to ensure friends stay on track with their study schedules. c. Productivity Metrics: Smart contracts can generate productivity metrics to help participants monitor their study progress and identify areas for improvement.

Saving for a Shared Goal:

A couple plans to save money for their dream vacation. They open a joint savings account and agree to contribute a fixed amount each month. Regularly discussing their progress and adhering to their financial commitments helps them achieve their goal of going on the dream trip together.

The habit-building game can be designed to encourage disciplined saving for a shared goal, such as a vacation or an expensive purchase. Each friend commits to regular savings contributions, and the smart contract securely holds the funds until the target amount is reached.

The Benefits: a. Secure Saving: The decentralized platform ensures that the saved funds are safely held in the smart contract until the goal is achieved, preventing any mismanagement or misuse. b. Progress Tracking: Participants can monitor their savings progress and the collective progress towards the shared goal. c. Transparent Payouts: When the target amount is reached, the smart contract automatically releases the funds for the planned vacation or purchase, eliminating any potential disputes.

In summary, a decentralized, blockchain/smart contract-based habit-building game can greatly bolster accountability in personal circles by providing transparency, automation, collaboration, and incentive mechanisms. This gamified approach can transform mundane tasks into engaging challenges, motivating friends to stay accountable to their goals and strengthen their personal bonds in the process.

In larger scale social applications, enforceable Accountability can strongly benefit the World’s advancement, and tools built from blockchain/smart contract and decentralized technology can help.

For example, charity crowdfunding: in a decentralized crowdfunding platform, users contribute to various charitable causes. Smart contracts ensure that funds are securely held until the funding goal is met. Once the goal is reached, the funds are automatically released to the charity, fostering accountability and transparency in charitable giving.

Another large-scale example application is decentralized social networks: in a decentralized social media platform, users have control over their data and content. Since the platform operates on blockchain technology, actions like content sharing and interactions are recorded immutably, ensuring accountability for all users' activities and fostering a more trustworthy online community.

Applications in supply chain traceability: in a blockchain-based supply chain system, companies can track the journey of products from the source to the end consumer. Each step of the supply chain is recorded on the blockchain, allowing stakeholders and consumers to verify the authenticity and origin of products, promoting accountability and preventing fraud.

In voting systems: decentralized voting applications powered by blockchain technology ensure transparency and tamper-proof records. Using technology that can prove a voter belongs to a group of demographics and signalling without revealing their identity, voters may stay anonymous while statistical data can still be collected. Voters can also verify their votes were accurately counted, and the results are transparently displayed for all to see, promoting confidence in the electoral process.

These examples demonstrate how accountability is reinforced through smart contracts, decentralization, and blockchain technology in various scenarios, ensuring transparency, reliability, and trust in personal and larger scale social interactions.

In conclusion, accountability plays a pivotal role in both small personal circles and large-scale social applications. Understanding and pushing the front edge of smart contracts, decentralization, and blockchain technology elevates accountability to a new level, fostering a society where individuals can rely on one another, collaborate effectively, and work towards common goals with integrity and confidence.

How it's Made

Building our project, Habitrac, was an intricate process that involved integrating various technologies to create a seamless and engaging habit-building game. We faced several challenges along the way, but our team's perseverance and innovative solutions led to some noteworthy accomplishments that made our product coherent and compelling.

Here's a detailed account of how we built Habitrac and the challenges we encountered:

WordPress Development: We started by creating a browser-based frontend user interface using WordPress. To enable smart contract interactions within WordPress, we wrote custom JavaScript code to call functions on the backend smart contract.

MetaMask Integration: To provide users with a seamless login experience, we used Web3.js to integrate MetaMask, a widely used Ethereum wallet, into our platform. MetaMask allows users to securely log in using their wallet addresses, authorizing specific app functions using their private keys.

Leveraging MetaMask SDK: We recognized the potential of MetaMask SDK, given its large user base and efficient authentication capabilities. The seamless linking of user wallets to our incentive-based game design was essential to creating a compelling user experience.

Designing the Game Flow: We meticulously designed the game flow, ensuring it encompassed all necessary components. This included functionalities like starting new games, accepting game invitations, uploading proof, automating bluff uploads, challenging proof, making daily action calls, handling recurring tasks, and resolving habits by determining completed challenges and calculating entitled funds.

Backend Smart Contracts: We used Solidity and Foundry to develop the backend smart contracts. These contracts were deployed on the Polygon zkEVM blockchain, which provided the required scalability and cost-effectiveness.

Handling Challenges with MetaMask: We encountered some challenges related to MetaMask's behavior, particularly on the Brave browser. It occasionally displayed an "install extension" popup, even when the extension was already installed, which impacted the user experience.

WordPress Plugin Development: To address certain limitations in WordPress, we developed our own WordPress plugin. This allowed us to collaborate effectively with our frontend developers and facilitate the integration of Web3.js, jQuery, and MetaMask SDK within the platform.

Handling Large Media: Verifying and maintaining the privacy of large media files, such as photos, proved to be challenging. While we explored XMTP as a potential solution, we encountered difficulties in its implementation. As a workaround, we temporarily uploaded media to WordPress, but we remain open to future decentralized storage options like Filecoin and IPFS.

Button Linking and User Experience: Linking various buttons and components in the platform required meticulous attention to detail, making it a time-consuming process. However, it was crucial to ensure a seamless and intuitive user experience.

Overall, Habitrac's development involved using an array of technologies, including MetaMask SDK, Web3.js, ethers.js, and jQuery, to build a WordPress plugin that seamlessly linked the frontend user interface with the backend smart contract on Polygon zkEVM. This amalgamation of technologies allowed for efficient smart contract calls and ensured that users could visualize the data retrieved from the blockchain.

Despite the challenges faced, our team's dedication and ingenuity enabled us to create a game-changing habit-building platform that empowers users to achieve their goals through accountability and rewards. We are excited about Habitrac's potential for scalability, social proof validation, and future advancements through decentralized development.

background image mobile

Join the mailing list

Get the latest news and updates