Inspiration

The inspiration for SplitMate came from the universal awkwardness of group expenses. Every dinner, trip, or shared subscription ends with the same pain point: the manual reconciliation of IOUs and the need for one person to act as a central banker. We realized that existing solutions, like Venmo or Splitwise, still rely on centralized trust and manual transfers.

We were inspired by the core promise of DeFi: trustless finance. Why should social finance be any different? SplitMate was born to eliminate the "I owe you" entirely, replacing it with guaranteed, atomic settlement powered by a smart contract. We aimed to build the first solution for shared finances that truly lives up to the ethos of Web3: Settle up, trustlessly.

What it does

SplitMate is a decentralized application (DApp) for collective bill splitting. It uses a trustless escrow model on the blockchain to guarantee full payment to the merchant.

Bill Creation: The creator defines the bill amount and participants, then initializes the escrow contract.

Guaranteed Payment: Participants (including the creator) pay their precise, pre-calculated share into the contract.

Atomic Settlement: Once all funds are collected, the contract executes a single transaction to transfer the total amount to the merchant and clears all outstanding debt simultaneously.

NFT Receipts: Every completed transaction is intended to mint a verifiable, non-transferable NFT receipt, creating an immutable record of reliable payment for each participant.

How we built it

SplitMate is architected as a Web3 front-end connecting to a custom Solidity smart contract:

Front-end: Built with a clean, responsive single-page application structure using HTML and Tailwind CSS.

Web3 Integration: We used the Web3.js library (v1.7.0) to handle wallet connection (MetaMask) and all interactions with the contract.

Core Logic: The business logic is encoded in the SplitMateV2 Smart Contract, deployed on the Sepolia Testnet (an EVM network). Key functions are createBill (which sets up the escrow and participant shares) and payShare (which allows any participant to send their exact share and triggers settlement when complete).

Currency Conversion: Since the contract operates in WEI (the smallest unit of Ether), a fixed hardcoded rate of 1 ETH = $3000 USD was used to convert the user's USD input into the precise WEI value required by the contract.

Challenges we ran into

The primary challenges revolved around bridging the gap between familiar Web2 UX and the strict constraints of the blockchain:

WEI Precision: The most difficult technical challenge was the accurate conversion of floating-point USD amounts from the form into precise WEI values required by the Solidity contract. A slight rounding error would cause the transaction to fail, requiring careful truncation and precise arithmetic in JavaScript to ensure the value sent EXACTLY matched the value required by the contract.

Wallet Address Validation: For this demo, we had to strictly enforce the use of raw 0x Ethereum addresses, which is not user-friendly. We had to temporarily disable planned features like the SplitMate ID (username.mate) and ENS resolution, highlighting the difficulty of maintaining a simple UX while ensuring strict security validation in a local environment.

The Escrow Design: Initially, we struggled with who should deposit the total amount. We solved this by creating a zero-value createBill transaction for the creator, and then making the creator's share mandatory—effectively forcing the creator to pay their share immediately after creation, thereby preventing them from having to fund the entire escrow.

Accomplishments that we're proud of

Atomic Settlement: Successfully implementing the core contract logic that ensures the bill remains locked in escrow until the final participant pays their share, after which the full amount is instantly and trustlessly sent to the merchant.

Intuitive UI: Designing a clean, dark-mode, Tailwind CSS UI with a custom glass effect that presents complex blockchain data (like Bill ID, Wallet Address, and Status) in an organized, appealing manner.

Dashboard Logic: Creating the front-end logic to query the contract and dynamically calculate the user's Net Balance ("Owed to You" vs. "You Owe") based on their participation in open bills.

What we learned

We gained significant practical experience in:

Advanced Web3.js State Management: How to use the library to call complex view functions like getParticipantShare(billId, address) to update the UI with per-user debt information.

Solidity Contract Security: The absolute necessity of rigorous input validation in Solidity, specifically concerning monetary value, and ensuring all parties are properly accounted for in the internal balance mapping.

The UX Cost of Decentralization: We learned how much effort is required on the front-end to abstract away the complexity of raw addresses, gas fees, and network requirements to deliver a user experience comparable to Web2 apps.

What's next for SplitMate

Our immediate focus is on enhancing the user experience and expanding utility:

SplitMate ID Integration: Full implementation of the username.mate ID system and ENS name resolution to replace raw 0x addresses, drastically improving UX.

Leaderboard & Credit Score: Leveraging the NFT receipts (proof of reliability) to populate the Leaderboard and establish a decentralised credit/reliability score for users.

Cross-Chain: Expanding the contract deployment to other low-cost EVM chains (e.g., Polygon, Optimism) to reduce gas fees and increase accessibility.

Merchant API: Developing an SDK/API to allow e-commerce and POS systems to integrate SplitMate for direct, collective checkout.

Built With

  • awesome
  • contractsethereum
  • css3
  • csssolidity/smart
  • evmmetamask
  • font
  • fontevm
  • html
  • javascript
  • machine
  • tailwind
  • v6.5.2)inter
  • virtual
  • web3.js
Share this project:

Updates