Stable Rent

StableRent is a tool for property owners and renters to use Stablecoin digital assets.

Stable Rent

Created At

ETHOnline 2025

Project Description

StableRent is a tool for property owners and renters to use Stablecoin digital assets. Property owners can screen tenants by checking account balances of assets and accept Paypal's PYUSD, while renters can automatically send rent payments using stablecoins.

TLDR: Recurring direct peer-to-peer crypto payments

The Problem We're Solving:

  • The US residential rental market is $291 BILLION dollars
  • Estimates for US-based crypto assets are around $90B
  • Crypto users want to pay rent in crypto, but finding landlords who take crypto is hard
  • Recurring peer-to-peer transactions (rent, allowance, savings accounts, etc.)
  • Many folks hear "crypto" and think scam, but Paypal is a reputable company that could ease adoption

Discussion in the Industry: https://www.linkedin.com/posts/shuhaib_crypto-rent-the-100-billion-shift-no-activity-7348397294506975232-thtY/

Our Solution: StableRent enables users to create recurring rental payments using PYUSD (PayPal's stablecoin) through the ERC-20 allowance pattern to auto-off-ramp into the landlord's PayPal account. Landlords can easily withdraw their PYUSD into their fiat Paypal account, without understanding too much of the crypto world, facilitating greater adoption. Money stays in the renter's wallet until payment is due, preserving financial sovereignty. Backend automation monitors rent due dates and automatically triggers payments from Renter's PYUSD -> Landlord's PYUSD PayPal account when due. The crypto ACH. Truly "set and forget" recurring payments. An Envio-powered indexer tracks all payment events to provide a unified dashboard where renters manage their rent payments, view payment history, and receive balance warnings. Landlords can see payment history, as well as run financial qualification searches to check renter's assets. This project will leverage Hardhat's capability to fork mainnet ETH for development.

Target Audience: Crypto-native users who want to pay rent without off-ramping to traditional bank account.

Hackathon Relevance:

Why PayPal: This isn't just catering to PayPal's bounty, PYUSD is actually a good choice for this project:

  • Reputation of PayPal as good company will encourage adoption among crypto-skeptical users
  • PYUSD Stablecoin tied to the USD so landlord don't take on volatility risk
  • PayPal is an accepted payment source for many other services
  • PayPal provides an easy PYUSD to USD off-ramp built into the app for landlords who need USD

Why Envio:

  • Rapid multi-chain indexing of renter's addresses to get account balances (on-demand of landlord)
  • Tools for tracking subscriptions and on-chain events without centralized database tracking, or slow block parsing

Why Hardhat:

  • The forking of mainnet ETH is invaluable for testing indexing of account balances
  • The simulated blockchain is game-changer for rapid development without faucets or testnets
  • The ability to write past blockchain events was vital for debugging the Envio indexer

How it's Made

Architecture Overview:

StableRent is a full-stack Web3 application built on a multi-layer architecture that bridges blockchain automation with traditional web infrastructure. We've created what we call "crypto ACH" - truly set-and-forget recurring payments using PYUSD stablecoin. Technology Stack

Smart Contracts: Solidity 0.8.20 with OpenZeppelin security libraries (ReentrancyGuard, Ownable, IERC20). Hardhat for development with mainnet forking capabilities. TypeChain for TypeScript type-safety. Deployed on Sepolia testnet at 0x278dD89e80B01772affcC8cAEa6e45fFF8Ae3339.

Backend: Node.js with Express and TypeScript REST API. Prisma ORM with PostgreSQL for type-safe database queries. Hosted on Railway with integrated database. Custom automation service running on 6-hour cron schedule for payment processing. Webhooks for real-time blockchain event processing.

Frontend: React 18 with TypeScript, Wagmi v2 and Viem for Ethereum wallet interactions, TanStack Query for async state management, TailwindCSS for responsive design. Deployed on Vercel with automatic rebuilds.

Blockchain Indexing: Envio HyperIndex for real-time event indexing with custom GraphQL schema mapping all subscription lifecycle events. TypeScript event handlers processing 5 contract events: SubscriptionCreated, PaymentProcessed, PaymentFailed, SubscriptionCancelled, and OwnershipTransferred.

Core Technical Implementation The ERC-20 Allowance Pattern: Our smart contract uses the ERC-20 allowance pattern as the foundation. Users approve the contract once to spend PYUSD, but money stays in their wallet until payment is due. Anyone can trigger processPayment when a subscription is due, enabling permissionless automation. The contract uses transferFrom to pull exact payment amount plus processor fee. This provides financial sovereignty while enabling automated payments.

Hardhat Mainnet Forking: This was crucial for our hackathon MVP. PayPal's PYUSD contract is on mainnet, so we needed to test against the real contract without spending real money. Hardhat's forking feature let us test with the actual PYUSD token contract, verify our ERC-20 interactions, develop rapidly without faucet dependencies. Backdating events was crucial to testing the Envio indexer. We built a comprehensive test suite leveraging the hardhat coverage feature. We could iterate in minutes instead of hours.

Envio Real-Time Indexing: Instead of polling the blockchain or maintaining complex event listeners, Envio automatically indexes all our contract events in real-time and transforms them into structured GraphQL-queryable data. This provided zero infrastructure overhead, multi-chain readiness, sophisticated filtering and sorting, real-time updates within seconds, and reliable performance during rapid-fire testing. The alternative would have required custom event listeners with retry logic, database schema management, and blockchain reorganization handling. Backend Automation Service: Since Gelato automation wasn't viable for our hackathon timeline, we built a custom automation service that runs every 6 hours on Railway. It queries the database for subscriptions due within the next 6 hours, calls the smart contract's processPayment function for each, handles private key management securely through environment variables, and gracefully handles gas estimation and RPC failures.

Hybrid Data Model: Smart contracts can't store emails, profile pictures, or rich metadata, so we use a hybrid architecture. On-chain storage includes payment amounts, intervals, timestamps, wallet addresses, and subscription IDs. Off-chain PostgreSQL stores user profiles, email notifications, subscription notes and tags, and payment history metadata. Each subscription stores senderId and recipientId UUIDs in the contract, linking on-chain data to off-chain profiles. This lets landlords register with just email and password while renters use MetaMask for payments.

Particularly Hacky Solutions Worth Mentioning Stack Too Deep Battle: Our subscription struct has 17+ fields, but Solidity's stack limit is 16 local variables. We enabled viaIR in Hardhat config, which uses Yul intermediate representation for more optimized bytecode that bypasses stack limitations. Trade-off was slightly longer compilation times, but essential for our complex data structure.

Multi-Currency Support Without Multi-Currency: The contract stores currency ticker strings for sender, recipient, and processor fees but only processes PYUSD currently. This future-proofs the data structure for DEX swap integration where senders can pay in any token while receivers get PYUSD.

The Allowance Pattern Advantage: Most DeFi apps require users to lock funds in the contract. We don't. Users approve an allowance and the contract pulls payment only when due. We validate the allowance covers amount plus processor fee at subscription creation without transferring any funds. This gives users full control until payment is due, ability to revoke approval anytime, and a traditional bank-like "authorize recurring charges" UX that non-crypto users understand.

Launch Script Orchestration: With 4 codebases needing different environment variables and deployment sequences, we built a bash orchestration script that handles Node.js version checks, local Hardhat node startup, contract deployment with address capture, processor wallet generation, configuration injection across all services, and graceful shutdown of all processes. It's essentially a mini-orchestration layer in bash that gets the entire stack running with one command.

PayPal Integration Without PayPal API: We don't actually integrate with PayPal's API. PYUSD is simply an ERC-20 token on Ethereum that users can send to any address. Recipients with PayPal accounts can deposit PYUSD to PayPal and off-ramp to USD instantly. We market it as "PayPal integration" because PYUSD holders likely have PayPal accounts and the off-ramp is seamless, but it's technically just ERC-20 transfers with no complex OAuth flows needed.

background image mobile

Join the mailing list

Get the latest news and updates

Stable Rent | ETHGlobal