Skip to content

On chain DRM system using Zama's fhEVM

License

Notifications You must be signed in to change notification settings

zaccherinij/fhe-drm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fhe-drm

Watch the demo video Demo The frontend is deployed here: https://drm-pbkompasz-pbkompaszs-projects.vercel.app/

How it works

An asset is encrypted (using AES) and uploaded to decentralized storage, with a URI pointing to this asset. An NFT is then created for the asset, along with an encryption key and encrypted metadata. The NFT owner has access to the decryption key to view the original file.

This scenario expands with a collection contract containing NFTs, users, and roles. Each NFT in a collection can be restricted, accessible only by users with the required roles. This allows for additional features like creating temporary copies, links, and monitoring access. When a user has the required role, the decryption key is provided, enabling access to the content. However, this approach isn't ideal, as the decryption algorithm could be rewritten using FHE to run without exposing the key. Finally, only the decrypted file is made available.

In the current implementation, the encryption key is generated from a numeric seed. However, due to overflow issues, the entire 32-byte key cannot be stored inside the smart contract as 4 euint64.

Run locally

# Start node locally
cd fhevm-hardhat-template
pnpm i
pnpm fhevm:start

# Start frontend (separate terminal)
cd drm
npm i
npm run dev

When creating the first record, you will have to create a w3up account, see this

About

On chain DRM system using Zama's fhEVM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 84.5%
  • Solidity 12.1%
  • CSS 1.5%
  • Shell 0.6%
  • SCSS 0.5%
  • JavaScript 0.5%
  • HTML 0.3%