Summary
The metadata_hash field was recently added to the Escrow entity for IPFS agreement hashes (PR #185), but there is no general-purpose IPFS service for uploading and retrieving files. The dispute evidence workflow and agreement storage both need this.
Requirements
- Build an
IpfsService that abstracts IPFS operations
- Support uploading files (images, PDFs, text) to IPFS via Pinata or web3.storage API
- Return the CID (Content Identifier) for each uploaded file
- Store CID references in the database linked to the relevant entity (dispute evidence, escrow agreement)
- Add a retrieval endpoint:
GET /ipfs/:cid that proxies or redirects to the IPFS gateway
- Add an upload endpoint:
POST /escrows/:id/evidence for dispute evidence
- Validate file types (allow: jpg, png, pdf, txt, doc) and enforce size limits (10MB per file)
- Pin uploaded files to ensure persistence
Acceptance Criteria
Context
Rollout Phase
Phase 3 — Real-time & Disputes
Points: 150 (Medium)
Summary
The
metadata_hashfield was recently added to the Escrow entity for IPFS agreement hashes (PR #185), but there is no general-purpose IPFS service for uploading and retrieving files. The dispute evidence workflow and agreement storage both need this.Requirements
IpfsServicethat abstracts IPFS operationsGET /ipfs/:cidthat proxies or redirects to the IPFS gatewayPOST /escrows/:id/evidencefor dispute evidenceAcceptance Criteria
Context
apps/backend/src/modules/escrow/entities/escrow.entity.ts(metadata_hash column)apps/backend/src/modules/escrow/entities/dispute.entity.tsRollout Phase
Phase 3 — Real-time & Disputes
Points: 150 (Medium)