Skip to content

RishiSD/W3TransferHacathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

W3Transfer

Screenshot 2024-06-04 at 16 11 12

W3Transfer is a decentralised file sharing platform built on Polkadot powered by the Apillion platform. Its like WeTransfer but better since the files that are shared are stored encrypted and decentralised, such that they can only be decrypted by signature of the receiver.

Demo Url: Demo Url: https://youtu.be/mhfPuB-Id7s

Technologies Used

Apillion Services: Authentication, NFTs, Computing, Hosting

Frontend: React, Tailwind CSS, viem, wagmi

Backend: Expressjs, @apillon/sdk, viem, resend

Architecture Diagram

w3transfer

Note: All rights to the logos are owned by the respective companies.

Aplication Details

Pre-requisites: A new NFT Collection was created on Apillion dashboard, a new computing contract for Schrödingers NFT was also created where the NFT collection was linked.

The first point of contact for the user is the frontend which is a react application that is hosted using Apillion hosting solution on IPFS via CRUST.

The frontend establishes an OAuth connection with the backend using Apillion Authentication. The backend is hosted on render and backend endpoints are secured with OAuth/JWT token which is saved in the browser frontend as cookie after successful login.

image

After successful login the send button is enabled and the email of the logged in user is displayed. The user then uploads the file and fills the form with the email id of the receiver, a message that should be sent in the email and the Ethereum wallet address of the receiver.

On clicking send the frontend calls the backend /transfer endpoint which uses apillion sdk to interact with the computing schrödingers NFT contract on PHALA network. This api call would basically encrypt the file and save the encrypted file on IPFS via CRUST, mint an NFT to the receiver address, assigns the CID from IPFS to the minted NFT id on the Schrödingers contract and send an email to the receiver with the details.

image

Clicking 'Get the file' button in the email will redirect the receiver to the download page. Here the receiver needs to connect Ethereum user wallet address mentioned in the email. Once connected the download button will be enabled clicking on which will ask the user to sign a message. Once the message is verified the user is prompted to save the decrypted file. If the user connects with a different wallet address then an error message will be displayed.

image

Deployed Frontend

Url: https://k2k4r8n19nwsdbjhf7ja91g05w8q9u2ih01u36qm3tp13kf9a8qntnch.ipns.nectarnode.io/

Note: First load during login might be slow due to cold start of the backend. :)

Run in local

Create a new NFT Collection in Apillion Dashboard. Create a new computing contract for Schrödingers NFT and connect it with the NFT collection created previously. Create an API key in the dashboard to be used in the backend .env.

Clone the project

git clone https://github.com/RishiSD/W3TransferHacathon.git

To run the backend

cd backend
npm install
# rename .env.sample to .env and update the env variable values
np run dev

To run the frontend

cd frontend
npm install
npm run dev

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages