/vipfs-protocol

Blockchain Cypher for Video Uploader to IPFS

Primary LanguageTypeScriptMIT LicenseMIT

VIPFS-Protocol

GitHub stars npm GitHub issues License

A robust TypeScript library for fragmenting, encrypting and uploading large video files to IPFS, using Ethereum-derived keys for security. Generates a JSON index to ensure video can be safely reassembled and decrypted later.


๐Ÿš€ Features

  • ๐Ÿ” Fragmentation and encryption of videos with Ethereum-derived keys
  • ๐Ÿงฉ IPFS upload and index generation for decentralized storage
  • โ™ป๏ธ Retry and resiliency system for reliable uploads
  • โšก TypeScript-first, fully type-safe API
  • ๐Ÿงช Modular design with unit tests for each step

๐Ÿ“ฆ Installation

npm install vipfs

or

yarn add vipfs-protocol

๐Ÿงช Usage

import {
  // helpers
  // hooks
  // services
  VideoEncryptionManager,
} from 'vipfs-protocol'

const manager = new VideoEncryptionManager(myEthereumWallet)
const indexJson = await manager.encryptAndUpload('/path/to/video.mp4')
// Later, to reassemble the video:
const videoBuffer = await manager.downloadAndDecrypt(indexJson)

๐Ÿ“˜ For our website, visit Github ๐Ÿ“˜ For full documentation, visit Github


๐Ÿ› ๏ธ Development

Setup

npm install

Run dev server

npm run dev

Full build & lint cycle

npm run ci

or

yarn ci

โš ๏ธ Reminder: Clean up unused CSS classes in public/output.css after changes. Tailwind can generate many unused classes.


๐Ÿ“œ NPM Scripts

Script Description
dev Starts the development server
css Builds the CSS
css:dev Builds CSS in watch/dev mode
test Runs tests with coverage
lint Runs ESLint
lint:fix Fixes lint errors
format Formats code using Prettier
build Builds for production
preview Previews the production build locally
ci Runs tests, lint, and formatting
clean Cleans dist, node_modules, package-lock.json, etc.

๐Ÿงฉ Components / Modules

Each module has dedicated tests to ensure reliability and to simplify future extensions.

  • VideoFragmenter โ€“ Splits video files into fixed-size binary chunks
  • FragmentEncryptor โ€“ Encrypts/decrypts each chunk using Ethereum wallet-derived keys
  • IPFSUploader โ€“ Uploads/downloads each encrypted chunk to/from IPFS
  • IndexManager โ€“ Generates and updates the JSON index file with fragment metadata
  • EthereumWallet โ€“ Derives secure keys from an Ethereum wallet for encryption

๐Ÿ‘ฅ Contributing

We welcome contributions! Please read our contributing guide and follow the code style defined in .eslintrc.

Coverage

Coverage is generated in .coverage/index.html, and you can view it in your browser. To generate coverage, run:

yarn test

This is an example of the coverage report:

Coverage


๐Ÿ“„ License

MIT


๐Ÿ“ฌ Contact Us

For questions, feedback, or business inquiries:

โœ‰๏ธ Email: netzuleando@gmail.com
๐ŸŒ Website: Github


๐Ÿ‘จโ€๐Ÿ’ป Authors

Made with โค๏ธ by the @Netzulo