Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Create data encryption/decryption standard plus supporting APIs for wallets to implement #1367

Closed
ozyman42 opened this issue Jun 28, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@ozyman42
Copy link

ozyman42 commented Jun 28, 2023

Motivation

Many potential applications might prefer to encrypt end user data via a public key the user controls rather than encrypting via a user's password (i.e. lastpass), as passwords are a poor UX compared to a web 3 wallet. Metamask currently is the only web 3 wallet I'm aware of which offers the ability to decrypt via private key. Ideally Solana wallets should support this, and ideally all the wallets would use the same algorithm for obtaining a public encryption key and the same asymmetric encryption algo too. In the linked EIP you see a proposal for wallets to offer an RPC for encryption via secp256k1 + ECIES.

Example use case

Let's say I'm making a decentralized health information exchange. Each medical record of mine is stored on-chain (if it was not stored on chain it would not be decentralized). I sign in via my wallet. Then, either after some visit to a doctor's office or when I'm ready to publish my wearable device's biometric data, I get a request from my web3 wallet to encrypt the data with a public key, then another request to store said data in a Solana account (or Arweave or Filecoin or Shadow Drive etc etc). When I view a web dapp later, I should be able to view all my data, so the wallet sends me a request to decrypt my data using my private key. In the future I may want to give access of this encrypted data to another user, which is why my account should somehow be able to generate unique encryption/decryption keypairs for different datasets. Perhaps this simply means I reencrypt the decrypted data with the recipient's public key. An example is let's say I sell my wearable device data and DNA sequencing data to an AI health tech company. In that case I should probably be uploading some copy of that data encrypted with a keypair unique to my relationship with that company.

Details

Relevant discussion in Ethereum: https://ethereum-magicians.org/t/eip-5630-encryption-and-decryption/10761/128
Metamask SDK:

Open related issue in Backpack coral-xyz/backpack#4241
Open related issue in Solana Mobile Seed Vault solana-mobile/seed-vault-sdk#144

@ozyman42 ozyman42 added the enhancement New feature or request label Jun 28, 2023
@ozyman42 ozyman42 changed the title Create data encryption/encryption standard plus supporting APIs for wallets to implement Create data encryption/decryption standard plus supporting APIs for wallets to implement Jun 28, 2023
@jordaaash
Copy link
Contributor

Thanks! There's some work in progress to enable this. This repo isn't where that work is/will happen though, so could I ask you to close this issue and open it @ solana-labs/wallet-standard instead? I can follow up there.

@ozyman42
Copy link
Author

Closing in favor of anza-xyz/wallet-standard#25 as suggested by @jordansexton

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants