A decentralized escrow smart contract system built on Stellar Soroban, enabling secure token-based payments with OTP-verified delivery confirmation. Designed for trust-minimized commerce, hackathons, and real-world Web3 payments.
DAFE implements a secure escrow workflow where:
- A buyer locks funds into a Soroban smart contract
- A merchant delivers goods/services
- The buyer confirms delivery using a one-time password (OTP)
- Funds are released automatically only after successful verification
No intermediaries. No manual disputes. Pure on-chain logic.
Traditional escrow systems:
- Rely on centralized authorities
- Are slow, opaque, and trust-heavy
This system:
- Is fully on-chain
- Uses cryptographic OTP verification
- Leverages Soroban smart contracts + Freighter wallet
- Works seamlessly on Stellar Testnet
sequenceDiagram
participant Buyer as Buyer (Freighter)
participant SC as Soroban Escrow Contract
participant Merchant as Merchant
Buyer->>SC: init_escrow(OTP_HASH, amount)
Note over SC: Funds Locked
Merchant->>Buyer: Goods Delivered (Off-chain)
Buyer->>SC: confirm_delivery(OTP)
Note over SC: Verify OTP + Auth
SC->>Merchant: Release Funds
- OTP is never stored in plaintext
- Only the SHA-256 hash is stored on-chain
- Raw OTP is hashed inside the contract during confirmation
- Only the buyer can confirm delivery
- Enforced using
require_auth()in Soroban
- No admin keys
- No off-chain verification
- Contract logic is final
- Rust
- Soroban SDK
- Stellar Testnet
- React (Vite)
- @stellar/stellar-sdk
- Freighter Wallet API
- Tailwind CSS (Cyberpunk/Neon UI)
βββ contract/
β βββ src/
β β βββ lib.rs # Soroban smart contract logic
β β βββ escrow.rs # Escrow data model
β β βββ errors.rs # Custom error handling
β
βββ frontend/
β βββ src/
β β βββ stellar/
β β β βββ contract.js # Contract interaction layer
β β β βββ wallet.js # Freighter wallet integration
β β βββ pages/
β β β βββ StorePage.jsx
β β β βββ PaymentPage.jsx
β β βββ components/
β
βββ README.md
- Buyer enters card details & system generates OTP
- System hashes OTP (SHA-256)
- Funds are locked in the Soroban escrow contract
- Merchant delivers goods/services off-chain
- Buyer enters the OTP in the dashboard
- Contract hashes the input OTP
- Hashes are compared on-chain
- If OTP matches β funds transferred to merchant
- Otherwise β transaction fails safely
The DAFE landing page introducing the decentralized finance and secure escrow features.

The checkout process where users connect their Freighter wallet and enter payment details for tokenization.

The Freighter wallet integration in action, asking for user authorization to lock funds into the Soroban escrow contract.

- Network: Stellar Testnet
- Wallet: Freighter
- RPC:
https://soroban-testnet.stellar.org
- Connect buyer wallet using Freighter.
- Select items in the Store and proceed to Checkout.
- Use the "Card" payment method to simulate tokenization.
- "Sign & Lock" funds into the escrow contract.
- Enter the generated OTP in the "Confirm Delivery" section.
- Verify the success message and fund release.
- π Refund Timeout: Automatic refund if merchant doesn't deliver within a time limit.
- π§ββοΈ Dispute DAO: Community-governed dispute resolution.
- π± Mobile UI: Native mobile experience for on-the-go payments.
- π ZK-OTP: Zero-knowledge proofs for even more private verification.
MIT License - Free to use, fork, and build upon.
- Stellar & Soroban team for the robust SDKs.
- Freighter Wallet for the seamless integration.
- Hackathon community for the inspiration...