A decentralized memory storage system that combines IPFS (InterPlanetary File System) with blockchain technology for permanent and immutable data storage.
- 📁 File Upload: Upload any type of file (text, images, documents, audio, video)
- 🌐 IPFS Storage: Files are stored on IPFS for decentralized access
- ⛓️ Blockchain Recording: File hashes and metadata are stored on Polygon blockchain
- 📊 Analytics: Visual analytics showing upload patterns and memory types
- 🔍 Memory Browser: View and access all previously stored memories
- 🎨 Modern UI: Choose between Streamlit (web) or Tkinter (desktop) interface
-
IPFS Node: You need to have IPFS running locally
# Install IPFS from https://ipfs.io/ ipfs daemon -
Environment Variables: Create a
.envfile with:PRIVATE_KEY=your_polygon_private_key PUBLIC_KEY=your_polygon_public_address WEB3_PROVIDER_URI=https://polygon-amoy.g.alchemy.com/v2/YOUR_API_KEY -
Contract Deployment: Deploy the smart contract first:
python deploy_contract.py
- Clone and Install Dependencies:
cd memchain pip install -r requirements.txt
python launch_gui.pyThis will give you options to choose between:
- Streamlit Interface (Modern web-based) - Recommended
- Tkinter Interface (Traditional desktop)
Features:
- 🎨 Modern, responsive web interface
- 📊 Interactive charts and analytics
- 📱 Works on mobile devices
- 🔄 Real-time updates
- 🌈 Beautiful visualizations
To run directly:
streamlit run gui_app.pyAccess: Open http://localhost:8501 in your browser
Features:
- 🖥️ Native desktop application
- 📦 No additional dependencies
- ⚡ Fast and lightweight
- 🔒 Works offline (except blockchain operations)
To run directly:
python tkinter_app.py-
Select File: Choose any file from your computer
-
Choose Memory Type: Categorize your memory (text, image, document, etc.)
-
Upload Process:
- File is uploaded to IPFS
- IPFS hash is generated
- Transaction is sent to Polygon blockchain
- Memory is permanently recorded
-
View Memories: Browse all stored memories with direct IPFS access links
- 📄 Text: .txt, .md, .json, etc.
- 🖼️ Images: .jpg, .png, .gif, etc.
- 📊 Documents: .pdf, .doc, .docx, etc.
- 🎵 Audio: .mp3, .wav, etc.
- 🎥 Video: .mp4, .avi, etc.
- 📁 Any file type up to 16MB
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Python │ │ IPFS │ │ Polygon │
│ GUI │───▶│ Storage │───▶│ Blockchain │
│ │ │ │ │ │
└─────────────┘ └─────────────┘ └─────────────┘
- Frontend: Streamlit/Tkinter GUI for user interaction
- Storage: IPFS for decentralized file storage
- Blockchain: Polygon Amoy testnet for metadata and hash storage
- Smart Contract: Solidity contract managing memory records
saveMemory(string ipfsHash, string memoryType): Store a new memorygetMemory(uint256 id): Retrieve memory detailsmemoryCount(): Get total number of memories stored
- Blockchain: Polygon Amoy Testnet
- Chain ID: 80002
- Explorer: https://amoy.polygonscan.com/
- Faucet: https://faucet.polygon.technology/
# Upload file to IPFS only
python upload_ipfs.py
# Save IPFS hash to blockchain
python save_memory.py
# Deploy smart contract
python deploy_contract.py# Launch GUI selector
python launch_gui.py
# Direct Streamlit launch
streamlit run gui_app.py
# Direct Tkinter launch
python tkinter_app.py-
IPFS Connection Error
Solution: Make sure IPFS daemon is running Command: ipfs daemon -
Blockchain Connection Error
Solution: Check your .env file and network settings -
Contract Not Found
Solution: Deploy the contract first Command: python deploy_contract.py
- Port Already in Use: Change port with
streamlit run gui_app.py --server.port 8502 - Browser Not Opening: Manually go to http://localhost:8501
- GUI Not Showing: Make sure you have tkinter installed (usually comes with Python)
- Threading Issues: Close and restart the application
memchain/
├── gui_app.py # Streamlit web interface
├── tkinter_app.py # Tkinter desktop interface
├── launch_gui.py # GUI launcher
├── upload_ipfs.py # IPFS upload utility
├── save_memory.py # Blockchain save utility
├── deploy_contract.py # Contract deployment
├── requirements.txt # Python dependencies
├── .env # Environment variables
└── contracts/
└── MemoryStore.sol # Smart contract
- Fork the repository
- Create a feature branch
- Make your changes
- Test with both GUI interfaces
- Submit a pull request
💡 Tip: Use the Streamlit interface for the best experience with rich visualizations and analytics!