Inspiration
In India, many informal chit fund groups operate entirely on mutual trust. Members contribute regularly, and one person receives the pooled amount each round. But what happens if someone collects their payout and stops contributing? Who protects the remaining members, tracks missed payments, or holds participants accountable?
These questions inspired TrustCircle—a smarter, collateral-backed alternative to traditional chit funds, with an AI treasurer and PayPal-powered payments.
We wanted to preserve the community spirit of collective saving while reducing dependence on personal promises. TrustCircle supports trust with collateral, transparent transactions, and consistently enforced rules.
What it does
TrustCircle helps people create and participate in savings circles with clear commitments and visible financial activity.
- Customizable circles: Creators choose the monthly payout, number of members, and collateral required from each participant.
- Collateral-backed participation: Members fund their collateral before the circle activates. Available collateral can cover missed contributions.
- An AI treasurer: The agent uses tools to carry out permitted actions and records its decisions. After two payment defaults, the member is barred and the circle pauses for reconciliation, preserving remaining balances.
- Fair payout requests: Once contributions are confirmed, a request window opens. Members can offer a discount to receive that round’s payout. The highest discount wins, and the discount is split equally among the other members.
- One payout per member: Previous winners cannot claim again within the same circle.
- Public and private circles: Public circles use trust-score requirements, while private circles support invitation links.
- Transparent transactions: Members can inspect payment statuses, collateral balances, payouts, and Treasurer activity.
- Experience before joining: An interactive demo lets visitors explore the flow without moving money.
The current payment integration uses PayPal sandbox accounts and sandbox funds.
How we built it
We built TrustCircle with Next.js 16 and TypeScript, keeping the frontend and backend API routes in one application. PostgreSQL stores accounts, memberships, payment records, and an auditable ledger.
We integrated the PayPal Agent Toolkit with the OpenAI SDK for tool-based payment workflows. PayPal Orders handles checkout and capture, while the PayPal Payouts API supports distributions from the Treasurer’s account to members.
The AI treasurer is designed as an agent rather than a chatbot. Its instructions guide decisions, and its tools allow it to perform specific actions. Backend checks independently enforce ownership, payment amounts, eligibility, and default rules.
We implemented verified PayPal webhooks and payment-status reconciliation so the application can track transactions even when a user closes checkout or a response is delayed.
For the interface, we combined AG Grid, a dark visual theme, motion, and financial summaries to make detailed records easier to explore.
Challenges we ran into
Moving from simulation to PayPal integration: Account-country restrictions, currency settings, credentials, and webhook configuration all affected the payment flow. We had to distinguish application errors from payment-provider restrictions.
Handling asynchronous payments: A checkout return does not guarantee a completed payment. We needed to represent pending states accurately and credit funds only after verified capture.
Preventing duplicate processing: Requests can be retried, and webhooks can arrive repeatedly. Reusable payment intents and duplicate-processing protection were essential to avoid recording the same money twice.
Balancing AI autonomy with safeguards: We wanted the Treasurer to act automatically while keeping financial rules predictable. This required narrowly scoped tools, backend validation, and recorded actions.
Deploying reliably: Database TLS, environment configuration, and separating simulated records from PayPal-backed data introduced challenges beyond building the interface.
Accomplishments that we're proud of
- Turning a familiar community savings model into a working, collateral-backed application.
- Integrating PayPal sandbox checkout, capture, webhooks, and payout workflows instead of relying entirely on simulated transactions.
- Building an AI treasurer that can use tools within enforced boundaries.
- Implementing payout eligibility and discount-sharing rules that make allocation transparent.
- Creating an auditable record of contributions, collateral deductions, and payouts.
- Providing an interactive demo so people can understand the product before participating.
- Testing ownership checks, duplicate-payment protection, default handling, and payment lifecycle behavior.
Most of all, we are proud of connecting the user experience with the underlying financial rules: members can see both what happened and why.
What we learned
Webhooks are part of the payment system, not an optional extra. We learned to verify signatures, handle repeated events, and reconcile provider status with our own records.
An AI agent needs more than a prompt. Useful autonomy comes from combining instructions, tools, persistent state, and independent validation. The agent cannot bypass PayPal buyer approval or override financial safeguards.
Financial state needs precise definitions. Collateral held, contributions allocated, and payouts awaiting confirmation represent different things. Clear ledger entries help prevent misleading balances.
Failure paths deserve as much attention as successful payments. Delays, interrupted checkout, missed contributions, and network retries all affect how much confidence users can place in the system.
Good design makes complex rules understandable. Clear statuses, accessible transaction tables, and timely explanations are essential when people are making financial commitments.
What's next for TrustCircle
More accessible participation
Add regional-language support, clearer onboarding, and guided explanations of collateral, bidding, and payout rules so more people can participate confidently.
Smarter reminders and early intervention
Let the Treasurer send timely contribution reminders and flag approaching deadlines before a member defaults. Members should understand the consequences and have an opportunity to act.
Better reconciliation and dispute handling
Build a dedicated workflow for reviewing payment discrepancies, resolving disputes, and settling paused circles, with an audit trail and appropriate human oversight.
More flexible collateral options
Explore transparent collateral requirements based on payout timing and demonstrated payment history, while checking that the remaining group is adequately protected.
Explainable trust scores
Show members which payment behaviors affect their score, how they can improve it, and how to challenge incorrect records.
Stronger account security
Add account recovery, email verification, and additional authentication options to make access safer and easier to manage.
A carefully validated path to real-money use
Expand failure testing, obtain independent security reviews, and evaluate the legal, operational, and payment-provider requirements before moving beyond sandbox funds.
Our vision is to make community saving more transparent and resilient—combining the human value of saving together with collateral-backed commitments and an accountable AI treasurer.
Built With
- agent
- ai
- nextjs
- paypal
- postgresql
- render
- typescript
