PinataVault is a decentralized file storage application leveraging Ethereum and IPFS (via Pinata) for secure and immutable file uploads. With PinataVault, users can upload, share, and view files securely while ensuring data integrity through blockchain technology.
- Decentralized Storage: Files are uploaded to IPFS via Pinata.
- Secure Sharing: Users can share file access with other Ethereum addresses.
- Blockchain Integration: Ethereum smart contract ensures access control and file integrity.
- User-Friendly Interface: Intuitive React-based UI for uploading and managing files.
- Metamask Integration: Seamlessly connects with Ethereum wallets.
- Frontend: React.js, Axios
- Blockchain: Ethereum, Solidity
- File Storage: IPFS (via Pinata)
- Web3 Provider: Ethers.js
- Smart Contract:
Upload.sol
npm uninstall hardhat
npm install --save-dev [email protected] `
npx hardhat
npm install --save-dev "hardhat@^2.12.4" "@nomicfoundation/hardhat-toolbox@^2.0.0"
npm install create-react-app
npx create-react-app client
cd client
npm install --save-dev ajv@^7
npm start
2. Ensure the blockchain is running locally. Use the following command to deploy the smart contracts:
npx hardhat run --network localhost scripts/deploy.js
If the terminal running the blockchain is closed, the blockchain will be destroyed.
Pinata API Key
Ensure the API key is active and not exhausted.
Do not set the max_uses limit for the API key to avoid unexpected restrictions during uploads.
- Node.js installed on your system.
- Metamask browser extension.
- Pinata account with API key and secret.
-
Connect Your Wallet
Open the application and connect your Ethereum wallet using Metamask. -
Upload a File
- Use the "Choose Image" button to select an image from your system.
- Click "Upload File" to pin your file to IPFS via Pinata.
- Your file's IPFS hash will be stored securely in the blockchain.
-
Share File Access
- Click the "Share" button to open the sharing modal.
- Enter the Ethereum address you wish to share access with and click "Share."
- You can view all addresses with access in the dropdown menu.
-
View Files
- Enter your Ethereum address or any shared address in the "Enter Address" field.
- Click "Get Data" to view the images associated with the address.
Upload.sol provides:
- File Storage: Stores file hashes securely on IPFS using Pinata.
- Access Control: Allows file owners to share access with specific Ethereum addresses.
- Data Retrieval: Fetches stored file hashes based on user or shared permissions.
This project is licensed under the MIT License. Please see the LICENSE file for details.