project screenshot 1
project screenshot 2
project screenshot 3

Cosmoway

An fully on-chain file access control protocol on FVM and toolkits

Cosmoway

Created At

FVM Space Warp

Project Description

Cosmoway protocol makes file sharers can delegate the power of authorizing to some parties, and chooses a condition contract for authorizing. Those parties will authorize a user who passes the check in the condition contract. For example, a content creator may share a file with its members, it will deploy a condition contract that checks if an address is a member (such as if it owns an NFT of a collection). Then, the creator encrypts the file with a key that is divided into many shares, which are encrypted with the nodes' key, and uploads the file to IPFS and encrypted shares to Cosmoway Protocol. Later, the creator tells members an id in Cosmoway Protocol, members will send a request through Cosmoway Protocol and be processed by those nodes, those nodes will encrypt the share with members' key and send via Cosmoway Protocol. Finally, members will obtain key shares, decrypt, and recover the file decrypt key to decrypt.

How it's Made

This project contains 3 parts, smart contract, Javascript SDK, and node. The key sharing and recovering were made with @lighthouse-web3/kavach, and the encryption was implemented on our own, we used the ElGamal scheme for further development because the protocol may want to check if the encryption is correct. The smart contract used Foundry and OpenZeppelin. The Javascript SDK used TypeScript, Ethers, and Web3.storage. The node used Ndoe.js and Ethers. App developers can use this protocol with SDK for file sharers and consumers to share the files. The SDK handles things like encrypting, uploading, accessing contracts, downloading, etc. For now, the app developers will need to prepare nodes by themselves, and the node is an implementation.

background image mobile

Join the mailing list

Get the latest news and updates