Build a decentralized Vue 3 application using GUN.js that supports the following features:
-
Passkey Authentication (WebAuthn):
- Use WebAuthn (passkeys) for secure user login and registration.
- Derive a deterministic cryptographic key from the WebAuthn credential (e.g. credential ID) using
Gun.SEA.work(). - Use the derived key to authenticate GUN users or generate SEA keypairs.
-
Encrypted Chat:
- Create encrypted, real-time peer-to-peer chat using GUN.js and SEA.
- Encrypt messages per user or per room using SEA keys or a shared group key.
- Display messages decrypted on the client, showing sender DID-style identifiers (
did:vuegun:{pub}).
-
Persisted SEA Keypair:
- Encrypt and store the user's SEA keypair in
localStorage, encrypted with the key derived from the passkey. - Decrypt and reuse this keypair upon successful passkey login to maintain user identity.
- Encrypt and store the user's SEA keypair in
-
End-to-End Encrypted Group Chat:
- Generate and manage a symmetric group key per chat room.
- Share this group key securely by encrypting it with each member’s public key (
epub) using SEA’s shared secret. - Encrypt and decrypt chat messages using the group key.
-
Modular Composition:
- Organize the app using Vue composables:
useAuth.js(for passkey auth and SEA key management) anduseChat.js(for encrypted chat and group logic). - Create a reusable component like
EncryptedChat.vuefor the UI.
- Organize the app using Vue composables:
-
Add a decentralized identity registry (DID system) using GUN.
-
Add room-level permissions and invitations using encrypted key sharing.