Skip to content

Latest commit

Β 

History

58 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

License Contributors Last Commit Aptos Move Language IPFS Module

CipherChain - Decentralized File Sharing System

A blockchain-based decentralized file sharing system built on Aptos blockchain that allows users to securely upload, encrypt, and share files with granular access control.

Image 1
Home Page
Image 2
About Us Page
Image 3
Contact Us Page
Image 4
File Retrieval Page
Image 5
Petra Wallet Connection
Image 6
Request to store metadata on chain
Image 7
Retrieving File
Image 8
Transactions on Explorer
Image 9
View Functions on Explorer
Image 10
Entry Functions on Explorer
Image 11
Request to register user

Project Overview

This project implements a decentralized file sharing system where users can:

  • Upload files with client-side encryption
  • Store files on IPFS with Pinata
  • Manage file access through smart contracts
  • Share files with specific users
  • Download and decrypt shared files

Architecture Flow

The system follows these primary workflows:

  1. File Upload Flow:

File_Upload

  1. File Retrieval:

File_Retrieval

Technologies Used

Blockchain & Smart Contracts

  • Aptos Blockchain
  • Move Programming Language
  • Aptos SDK

Frontend

  • React.js with TypeScript
  • Petra Wallet Integration
  • crypto-js for encryption

Storage

  • IPFS (InterPlanetary File System)
  • Pinata IPFS Pinning Service

Development Tools

  • Vite
  • Node.js
  • npm

Features

  • πŸ” Client-side AES encryption
  • πŸ“ Decentralized file storage on IPFS
  • πŸ”— Blockchain-based access control
  • πŸ‘₯ User-to-user file sharing
  • 🎯 Granular access management
  • πŸ“± Responsive web interface

Transactions

-New users will be asked to register
-When you upload a file, you'll get a signature request to safely store metadata about file on-chain

Getting Started

  • Node.js (v14 or later)
  • npm
  • Aptos CLI
  • Petra Wallet Browser Extension

Installation

  1. Clone the repository
git clone https://github.com/PratyushChaudhary/dappthon.git
cd dappthon
  1. Install dependencies for both contracts and frontend
# Install Move dependencies
cd contracts
aptos init
# Install frontend dependencies
cd ../frontend
npm install
  1. Set up environment variables
VITE_PINATA_API_KEY =YOUR_PINATA_API_KEY
VITE_PINATA_SECRET_KEY =YOUR_PINATA_SECRET_KEY
VITE_EMAILJS_SERVICE_ID=YOUR_EMAILJS_SERVICE_ID
VITE_EMAILJS_TEMPLATE_ID=YOUR_EMAILJS_TEMPLATE_ID
VITE_EMAILJS_USER_ID=YOUR_EMAILJS_USER_ID
VITE_CONTRACT_ADDRESS=YOUR__CONTRACT_ADDRESS

Configuration

  • Update addresses under Move.toml with your deployed contract address (refer to .aptos/config.yaml).
  • Update the NETWORK in frontend/src/utils/constants.ts to your APTOS network (currrently set to testnet).
  • Configure your environment variables
  • Make sure your Petra wallet is connected to the correct network (testnet/mainnet)
  1. Deploy smart contracts
cd contracts
aptos move publish
  1. Start the frontend application
cd ../frontend
npm run dev

Smart Contract Structure

contracts/
β”œβ”€β”€ sources/
β”‚   β”œβ”€β”€ user.move         (User management)
β”‚   β”œβ”€β”€ file_upload.move  (File metadata storage)
β”‚   └── file_access.move  (Access control)

Frontend Structure

frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ contexts/
β”‚   β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ hooks/
β”‚   └── utils/

Usage

  1. Connect Wallet
  • Click "Connect Wallet" button
  • Approve connection in Petra wallet
  1. Upload File
  • Select file
  • Enter encryption password
  • Click "Upload & Encrypt"
  • Save the IPFS hash and password
  1. Share File
  • Enter recipient's address
  • Confirm transaction in wallet
  1. Download File
  • Enter IPFS hash
  • Provide decryption password
  • Click "Download & Decrypt"

Extended Use Cases

Our decentralized file sharing system has numerous potential applications across various sectors:

1. Government Certificate Authentication

  • Prevents certificate fraud through public verification
  • Stores certificates with location and recipient data
  • Enables mass verification through public ledger
  • Quick fraud detection and reporting
  • Creates transparent certificate ecosystem

2. Secure Cybercafe Operations

  • Time-bound file sharing capabilities
  • Automatic access revocation
  • Mandatory directory cleanup protocols
  • Prevents unauthorized data retention
  • Enhanced user privacy protection

3. Healthcare Record Management

  • Secure patient record sharing
  • Controlled access for healthcare providers
  • Complete audit trail of access
  • Patient-controlled data sharing
  • Compliance with healthcare regulations
  • Emergency access protocols

4. Educational Institution Management

  • Secure transcript and certificate distribution
  • Real-time verification system
  • Research paper sharing platform
  • Student record management
  • Cross-institution collaboration
  • Alumni document access

5. Legal Document Handling

  • Secure contract sharing
  • Version control with timestamps
  • Multi-party access control
  • Compliance audit trails
  • Court document management
  • Client-attorney privileged sharing

6. Corporate Data Management

  • Secure document sharing
  • Employee record management
  • Project documentation
  • Board meeting materials
  • Shareholder documents
  • Inter-department file sharing

7. Research Collaboration

  • Secure data sharing
  • Version control
  • Access management
  • Citation tracking
  • Research output protection
  • Cross-institution collaboration

8. Media and Entertainment

  • Digital rights management
  • Content distribution
  • Access control for premium content
  • Proof of ownership
  • Revenue sharing management

9. Real Estate

  • Property documentation
  • Title deed management
  • Rental agreements
  • Property inspection reports
  • Buyer-seller document exchange

10. Supply Chain Management

  • Certificate of origin
  • Quality inspection documents
  • Shipping documentation
  • Customs clearance
  • Product authenticity verification

Security Considerations

  • All files are encrypted client-side before uploading
  • Encryption keys never leave the user's browser
  • Smart contract handles access control
  • Wallet signatures required for all transactions

Acknowledgments

I would like to express my sincere gratitude to my teammate Aman Pandey for their valuable contributions to this project.

About

CipherChain

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages