SafeSend
Stablecoin payments that protect you — automatic refunds when fraud is attested.
Problem Statement
Bringing PayPal-like consumer protection to on-chain stablecoin payments using fraud oracles and transparent smart contracts.The ProblemTraditional payment systems on Web2 offer robust buyer protection and fraud detection, but can often come with high fees (ex: 2-3% per transaction) and centralized control. Meanwhile, Web3 payments offer low costs and transparency but lack consumer protection—once you send crypto, it's gone. Users are left choosing between safety and cost-efficiency.SafeSendis a decentralized escrow platform built on Ethereum that combines the security of traditional payment processors with the low-cost transparency of blockchain technology. By using PYUSD (PayPal's regulated stablecoin) and a modular fraud oracle architecture, SafeSend enables:Prototype built for the EthOnline 2025 hackathon.Demo url:h(deployed on testnet)
Solution
SafeSend is built around three key partner technologies: PYUSD, Hardhat, and Blockscout.PYUSD– PayPal's regulated stablecoin serves as the payment rail for all SafeSend escrow transactions. Because it's fully ERC-20 compatible and backed by real-world reserves, it provides the reliability and consumer confidence needed for escrow-based payments.PYUSD Integration in SafeSend:Escrow Currency– All SafeSendContract deposits, releases, and refunds use PYUSD via ERC-20 transferFrom/transfer functions with 6 decimal precisionFraud Detection Amounts– SimpleFraudOracle validates transaction amounts in PYUSD units (default 5000 PYUSD max) to prevent suspicious large transfersAutomatic Network Selection– SafeSend automatically uses Sepolia PYUSD (0xCaC...bB9) for testnet and Mainnet PYUSD (0x6c3...0e8) based on deploymentHardhat– Used for contract development, deployment, and verification. Hardhat's comprehensive tooling environment made it possible to build a production-ready escrow system with modular oracle architecture.Hardhat Integration in SafeSend:Oracle-Linked Deployment– Hardhat Ignition's SafeSendWithOracle module automatically deploys SimpleFraudOracle then passes its address to SafeSendContract's constructorFraud Scenario Testing– Test suite validates blacklist checks, amount limits, same-address detection, and escrow state transitions using Hardhat's testing frameworkProduction Deployment–yarn deploy:with-oraclescript uses Hardhat to deploy both contracts to Sepolia/Mainnet and outputs addresses for frontend .env configurationBlockscout– Integrated as both a transparency layer and developer tool using the official Blockscout SDK (@blockscout/app-sdk). Every SafeSend action (deposit, fraud attestation, refund, release) emits an event visible through Blockscout's explorer and SDK, making the entire fraud arbitration process publicly auditable.Blockscout SDK Integration in SafeSend:Transaction Monitoring– useBlockscout hook wraps SDK to show toast notifications for every deposit/release/refund/markFraud transaction with real-time pending→success status updatesContract Transparency– My Escrows page and Escrow Details page include dedicated buttons that open Blockscout popups showing SafeSendContract transaction history filtered by escrow eventsOracle Verification– Fraud oracle addresses are clickable links to Blockscout (eth-sepolia.blockscout.com) allowing users to verify SimpleFraudOracle contract code and flagging decisions🛡️ Enterprise-Grade Fraud Protection at Blockchain CostsReal-time fraud detection during every transactionAutomatic buyer refunds when fraud is detectedNo payment processing fees—just gas costs🔄 Evolving Security Without Contract RedeploymentFraud detection algorithm lives in a separate, upgradeable oracle contractNew fraud patterns can be detected by simply updating the oracleSafeSendContract remains immutable while security evolvesOracle maintained by specialized fraud detection authorities💰 Cost-Effective Fraud PreventionOne-time oracle consultation per escrow (~$0.50-2 in gas)Compare to: 2-3% fee on a $1,000 transaction = $20-30Significant cost reduction while maintaining security⚖️ Transparent Trust ModelOracle address publicly viewable and verifiableAll fraud decisions logged on-chain with reasonsUsers choose which oracle-enabled contracts to trustNo black-box algorithms or arbitrary account freezesHow It WorksSafeSend uses aoracle patternwhere the payment escrow contract (SafeSendContract) consults an external fraud detection oracle (ex: SimpleFraudOracle) through a standardized interface (IFraudOracle). This architectural separation enables:Immutable Payment Logic- Core escrow contract never needs updatesEvolving Fraud Detection- Oracle can be upgraded as new threats emergeSpecialized Expertise- Fraud detection maintained by security specialistsUser Choice- Different oracles for different risk tolerancesCost Efficiency- Single oracle call replaces expensive off-chain verificationThe oracle evaluates transactions against blacklists, amount limits, behavioral patterns, and manual flags—returning a simple pass/fail decision. Flagged transactions are automatically refunded, protecting buyers without manual dispute resolution.Example contract transactions:hSafeSend is designed for independent deployment—each service provider deploys their own SafeSendContract instance with their choice of fraud oracle. The public, auditable contract code ensures transparency while the separate oracle design allows upgrading fraud detection without redeploying the payment contract.SafeSend combines on-chain logic, stablecoin security, and oracle-based fraud detection to create a protection system for consumer payments.G
Hackathon
ETHOnline 2025
2025
Prizes
- 🏆
🏆 ETHOnline 2025 Finalist
ETHGlobal
Contributors
- cbonoz
31 contributions