This services enable storing mailing list & contacts on filecoin where community can vote to decide who can contact them and the file is encrypted and only shared to operator (who is sending the message) after DAO approval.
A more complete background on motivation and architecture can be found here
This includes
- server which can be execute by creator / operator
- smart contracts for governance by voting
Smart contract is modified with reference to https://github.com/filecoin-project/fevm-data-dao-kit
- GET http://localhost:3000/api/add?id=a&email=a@a.com&name=a
- GET http://localhost:3000/api/add?id=b&email=b@b.com&name=b
As lighthouse is a perpertual storage with cost charged upfront by size and file deletion is not possible, and data set could be incremental natually, e.g. new members, update of emails. We do a event sourcing approach, to be flexible about dataset and avoid duplications of data
There is immerjs and RFC-6902 for that so we wont reinvent the wheel
The node could compute the diff patches and store the related operaitons in different files which work as an append list, e.g.
contacts-1.json
contacts-2.json
(Pruning of such dataset is in theory possible, while not current focus)
We do not assume every contact is by default a member of the DAO. The way Governance Token distributed is decoupled and totally subject to community's decisions. Contact manipulation is separated from the contract.
Could be
- dedicated owner (whitelisted by wallet adderss),
- (create isWhiteListed method at contract and apply in access control)
- or holding over particular token threshold
- (use balanceOf method in access control)
- We could also reward operator for computation at the proposal
- originally generated via nextjs edge template
env-cmd yarn hardhat run scripts/propose.js
name: Using Crypto in Edge Middleware and Edge Functions slug: edge-functions-crypto description: Learn to utilize the crypto Web APIs at the edge. framework: Next.js useCase:
- Edge Functions
- Edge Middleware
- Documentation css: Tailwind deployUrl: https://vercel.com/new/clone?repository-url=https://github.com/vercel/examples/tree/main/edge-middleware/crypto&project-name=crypto&repository-name=crypto demoUrl: https://edge-functions-crypto.vercel.app relatedTemplates:
- ab-testing-simple
In this example, you'll see how you can utilize the crypto
Web APIs with Edge Middleware and Edge Functions.
Working example: crypto.vercel.sh
Includes:
crypto.randomUUID
crypto.getRandomValues
- Encryption with
crypto.subtle
- Decryption with
crypto.subtle
https://edge-functions-crypto.vercel.app
You can choose from one of the following two methods to use this repository:
Deploy the example using Vercel:
Execute create-next-app
with pnpm to bootstrap the example:
pnpm create next-app --example https://github.com/vercel/examples/tree/main/edge-middleware/crypto crypto
Next, run Next.js in development mode:
pnpm dev
Deploy it to the cloud with Vercel (Documentation).