This application allows users to:
- Upload a PDF file
- Encrypt it using AES-256-CBC
- Store the encrypted file on Arweave via Bundlr
- Mint an NFT on the Polygon blockchain with metadata pointing to the Arweave-hosted file
- Encryption: AES-256-CBC with random IV per file
- Decentralized Storage: Bundlr SDK for Arweave uploads
- Blockchain & NFT: ERC721 contract on Polygon (Mumbai testnet or Mainnet)
- Backend: Node.js + Express.js
- Frontend: React with Tailwind CSS
- Node.js and npm installed
- A wallet with MATIC (for Mumbai testnet or Mainnet)
- RPC URL for Polygon network
- Clone the repository
- Install dependencies:
npm install
- Create a
.env
file based on.env.example
:# Blockchain PRIVATE_KEY=your_wallet_private_key_here POLYGON_MUMBAI_RPC_URL=https://rpc-mumbai.maticvigil.com # Bundlr BUNDLR_NODE=https://node1.bundlr.network BUNDLR_CURRENCY=matic # Server PORT=3001
-
Compile the smart contract:
npm run compile
-
Deploy the smart contract:
npm run deploy:contract
-
Start the backend server:
npm run start:backend
-
In a separate terminal, start the frontend:
npm run dev
- Open the application in your browser
- Upload a PDF file
- The file will be encrypted and uploaded to Arweave
- Enter a recipient address and optional metadata
- Mint the NFT
- The NFT will contain metadata with the Arweave link and encryption key
- The encryption key is stored in the NFT metadata
- Only the NFT owner should have access to this key
- The backend wallet private key should be kept secure
MIT