A decentralized escrow service built on Ethereum that enables trustless transactions between buyers and sellers. Funds are locked inside a smart contract and released automatically once predefined conditions are met.
This project demonstrates how blockchain can eliminate the need for centralized intermediaries in digital transactions.
EscrowChain is a decentralized application (dApp) designed to facilitate secure peer-to-peer transactions using Ethereum smart contracts.
Traditional escrow services require a trusted third party to hold funds during a transaction. EscrowChain replaces this intermediary with a transparent and automated smart contract.
The system ensures that:
- The buyer’s funds remain locked until the transaction is completed.
- The seller receives payment only after the buyer confirms delivery.
- Disputes can be handled through predefined contract rules.
This ensures trustless, transparent, and secure transactions.
Funds are securely locked inside a Solidity smart contract until conditions are satisfied.
No central authority or intermediary is required.
Buyers retain control over releasing funds until the product or service is delivered.
Sellers are guaranteed payment once delivery is confirmed.
All transaction states are visible on-chain.
Optional arbitration logic can be implemented for dispute resolution.
The application follows a modular Web3 architecture composed of three layers.
User Interface
│
▼
Frontend (React / Next.js)
│
▼
Web3 Interaction Layer (Ethers.js / Wagmi)
│
▼
Ethereum Smart Contract (Solidity)
│
▼
Ethereum Test Network (Sepolia / Local Hardhat)
The smart contract manages all escrow logic.
Responsibilities:
- Creating escrow agreements
- Locking buyer funds
- Tracking escrow states
- Releasing payments to sellers
- Handling refunds and disputes
Technology Stack:
- Solidity
- OpenZeppelin security libraries
- Hardhat development framework
Handles communication between the frontend and the smart contract.
Responsibilities:
- Wallet connection
- Transaction signing
- Smart contract interaction
- Event listening
Technology Stack:
- Ethers.js
- Wagmi
- MetaMask wallet integration
Provides the user interface for interacting with the escrow system.
Responsibilities:
- Creating escrow transactions
- Viewing escrow status
- Confirming delivery
- Handling dispute actions
Technology Stack:
- Next.js / React
- TailwindCSS
- Web3 wallet integration
The buyer creates a new escrow agreement specifying:
- Seller address
- Payment amount
- Transaction description
The smart contract initializes the escrow record.
The buyer deposits ETH into the smart contract.
Funds remain locked inside the contract.
Escrow state becomes:
FUNDED
The seller completes the work or delivers the product.
This step occurs off-chain.
The buyer confirms successful delivery.
The smart contract automatically releases funds to the seller.
Escrow state becomes:
COMPLETED
If the buyer is unsatisfied:
- The escrow enters the DISPUTED state.
- A predefined dispute resolution method is triggered.
Possible strategies:
- Admin arbitration
- DAO voting
- Automatic refund after timeout
The contract tracks escrow lifecycle using an enum.
AWAITING_PAYMENT
AWAITING_DELIVERY
COMPLETE
DISPUTED
REFUNDED
Each escrow agreement contains:
buyer address
seller address
transaction amount
current escrow state
timestamp
Creates a new escrow agreement.
Buyer sends ETH into the escrow contract.
Buyer confirms product/service delivery and releases funds to the seller.
Buyer raises a dispute.
Refunds funds to buyer if dispute is resolved in their favor.
Returns escrow information.
EscrowChain/
│
├── contracts/
│ └── Escrow.sol
│
├── scripts/
│ └── deploy.js
│
├── frontend/
│ ├── components/
│ ├── pages/
│ ├── hooks/
│ └── styles/
│
├── test/
│ └── Escrow.test.js
│
├── hardhat.config.js
├── package.json
├── .env
└── README.md
| Layer | Technology |
|---|---|
| Smart Contract | Solidity |
| Development Framework | Hardhat |
| Blockchain Network | Ethereum |
| Web3 Library | Ethers.js |
| Wallet Integration | MetaMask |
| Frontend Framework | Next.js / React |
| Styling | TailwindCSS |
git clone https://github.com/yourusername/escrowchain.git
cd escrowchain
npm install
npx hardhat compile
npx hardhat node
npx hardhat run scripts/deploy.js --network localhost
cd frontend
npm install
npm run dev
Run smart contract tests:
npx hardhat test
Tests include:
- escrow creation
- fund deposits
- successful payment release
- refund scenarios
Smart contracts include protection against:
- reentrancy attacks
- unauthorized access
- double withdrawals
- incorrect state transitions
Security patterns used:
- Checks-Effects-Interactions
- Access modifiers
- Safe ETH transfer patterns
Potential enhancements for production deployment:
- Multi-party arbitration system
- Milestone based payments
- NFT escrow support
- DAO governed dispute resolution
- Layer 2 scaling support
- Cross-chain escrow functionality
MIT License
Developed as a capstone project for the AI Powered Blockchain Builder Course.