ProofLock is a decentralized digital evidence storage system that enables users to securely upload, verify, and timestamp digital files on the blockchain. The project utilizes Polygon for immutable blockchain storage, Pinata for decentralized file storage via IPFS, React with DaisyUI for the frontend, Vite for fast builds, and Flask for secure authentication and authorization.
- Frontend: React, Vite, DaisyUI
- Backend: Flask (for authentication and authorization)
- Blockchain: Polygon (for decentralized, immutable evidence storage)
- IPFS: Pinata (for decentralized file storage)
- Authentication: JSON Web Tokens (JWT) with Flask
- Decentralized Evidence Storage: Uploads and timestamps digital evidence on the Polygon blockchain, ensuring immutability and transparency.
- IPFS File Storage: Leverages Pinata to store digital files on IPFS, storing only the hash on-chain to reduce costs.
- Secure Authentication: Flask backend manages user authentication using JWT for safe, authenticated API interactions.
- User Interface: Built using React with DaisyUI for a sleek and user-friendly design.
-
Clone the repository and navigate to the frontend directory:
git clone https://github.com/yourusername/prooflock.git cd prooflock/frontend
-
Install dependencies:
npm install
-
Environment Variables: Create a
.env
file in thefrontend
directory to configure environment variables like the contract address and API endpoints.VITE_APP_POLYGON_CONTRACT_ADDRESS=your_polygon_contract_address
VITE_APP_BACKEND_URL=http://localhost:5000/api
-
Run the frontend:
npm run dev
-
Access the frontend: Click on the address provided in the console.
-
Navigate to the backend directory:
cd ../backend
-
Create a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate
-
Install Flask and other dependencies:
pip install -r requirements.txt
-
Environment Variables: Set up a
.env
file in thebackend
directory for configuration:FLASK_SECRET_KEY=your_secret_key JWT_SECRET_KEY=your_jwt_secret_key
PINATA_API_KEY=your_pinata_api_key
PINATA_SECRET_API_KEY=your_pinata_secret_key
POLYGON_RPC_URL=https://polygon-mumbai.infura.io/v3/YOUR_INFURA_PROJECT_ID
CONTRACT_ADDRESS=your_polygon_contract_address
-
Run the backend:
flask run
-
Access the backend API: The backend API will be available at
http://localhost:5000/api
.
-
Write a Smart Contract: Use Solidity to create the contract for storing evidence hashes on the blockchain.
-
Deploy the Contract:
- Use Remix IDE or Hardhat to deploy the smart contract to the Polygon Mumbai Testnet.
- MetaMask wallet is required to deploy and test transactions on Polygon.
-
Copy the Contract Address: Update the environment variables in both frontend and backend
.env
files with your deployed contract address.
-
Create a Pinata Account: Go to Pinata and create an account to get API keys.
-
Generate API Keys: In your Pinata account, generate an API Key and Secret Key for uploading files to IPFS.
-
Configure Backend: Add the API keys to the
.env
file in the backend:PINATA_API_KEY=your_pinata_api_key
PINATA_SECRET_API_KEY=your_pinata_secret_key
-
File Upload Functionality: In the backend, use Pinata’s API to upload files to IPFS. The response will contain the IPFS hash, which is stored on the blockchain through the smart contract.
-
User Registration/Login:
- Users must register and log in to access ProofLock’s services.
- JWT is used to authorize and authenticate users.
-
File Upload:
- After authentication, users can upload a file, which is then stored on IPFS using Pinata.
- The IPFS hash of the file is generated and sent to the smart contract on the Polygon blockchain.
- Users can also append new evidence to the existing evidence chain.
-
Evidence Verification:
- Users can query the blockchain to verify the existence and integrity of previously submitted evidence.
-
Viewing Evidence:
- Users can retrieve metadata of the evidence stored, such as timestamp and file hash, to ensure it hasn’t been altered.
- Users also have the ability to actually view the evidence and not only the metadata.
Contributions are welcome! Please fork the repository, create a new branch for your feature or bug fix, and submit a pull request.
For further questions or suggestions, feel free to reach out at [email protected] or [email protected].