Build a complete decentralized storage solution using IPFS and Arweave for permanent, censorship-resistant data hosting with frontend integration.
## ROLE You are a decentralized infrastructure architect specializing in permanent storage solutions, content-addressed data systems, and Web3 frontend integration. You have built storage layers for NFT platforms, decentralized social networks, and on-chain governance systems. ## OBJECTIVE Design and implement a decentralized storage architecture for [APPLICATION NAME] that uses IPFS for high-availability content delivery and Arweave for permanent archival storage, with full integration into a [FRAMEWORK: React/Next.js/Vue] frontend. ## TASK Build the complete storage implementation covering these components: ### Storage Architecture Design - Define the data model: [DESCRIBE DATA TYPES: images, metadata, documents, user-generated content] - Determine storage tier strategy: hot data on IPFS with Pinata/Web3.Storage pinning, cold data archived to Arweave - Design content-addressing scheme using CIDs for deduplication and integrity verification - Plan the migration path from centralized storage ([CURRENT STORAGE: S3/GCS/Azure Blob]) to decentralized - Estimate storage costs for [MONTHLY DATA VOLUME] of data across both protocols ### IPFS Integration Layer - Set up IPFS node configuration: [LOCAL NODE / INFURA / PINATA / WEB3.STORAGE] - Implement file upload pipeline with chunking for files larger than [MAX FILE SIZE] - Build CID-based content retrieval with gateway fallback strategy - Configure pinning service integration for persistence guarantees - Implement directory structures using IPFS MFS (Mutable File System) for organized content - Add IPNS (InterPlanetary Name System) for mutable references to latest content versions - Set up garbage collection policies and pin management ### Arweave Permanent Storage - Integrate Arweave via [BUNDLR/IRYS / ARWEAVE.JS / ARKB] - Implement transaction creation and signing with [WALLET TYPE] - Build upload queue with retry logic and confirmation tracking - Handle large file uploads using Bundlr's chunked upload API - Tag transactions with [CUSTOM TAGS] for queryable retrieval via ArQL/GraphQL - Calculate and display storage costs in AR and USD before upload confirmation - Implement manifest-based uploads for preserving directory structures ### Frontend Integration - Build React hooks: useIPFSUpload, useArweaveUpload, useDecentralizedFetch - Implement progress tracking for uploads with cancellation support - Add IPFS gateway URL resolution with automatic fallback between gateways - Create a file browser component for navigating stored content - Handle image optimization and thumbnail generation before upload - Implement drag-and-drop upload interface with file type validation of [ACCEPTED FILE TYPES] ### On-Chain Anchoring - Store content CIDs on-chain in [SMART CONTRACT ADDRESS / NEW CONTRACT] - Link stored content to NFT metadata, governance proposals, or [SPECIFIC USE CASE] - Implement content verification by comparing on-chain CID with retrieved data hash Provide complete TypeScript implementation with error handling, retry logic, and comprehensive test coverage.
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[APPLICATION NAME][MONTHLY DATA VOLUME][MAX FILE SIZE][WALLET TYPE][CUSTOM TAGS][ACCEPTED FILE TYPES][SPECIFIC USE CASE]