Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Decrypt message by Wallet ? #311

Open
wowok-ai opened this issue Sep 5, 2024 · 4 comments
Open

How to Decrypt message by Wallet ? #311

wowok-ai opened this issue Sep 5, 2024 · 4 comments

Comments

@wowok-ai
Copy link

wowok-ai commented Sep 5, 2024

I have a message that encrypt by Pubkey, And how to use Wallet to decrypt this message ?

Thx a lot.

@bruceeewong
Copy link
Contributor

Hi, there should be a wallet.verifySignedMessage function for you to decrypt msg by using the signature and public key of the connected account. check details in https://kit.suiet.app/docs/Hooks/useWallet

@bruceeewong
Copy link
Contributor

And may I ask why do you use public key instead of private key to encrypt msg?

@wowok-ai
Copy link
Author

If the message I send you is encrypted with your public key, only you can see it, ensuring the privacy of data transmission on the chain.

@bruceeewong
Copy link
Contributor

@wowok-ai That is an interesting use case though. So it would be the capability that the DApp requests a wallet to use the account's private key to decrypt the given msg. However, I just checked the Sui wallet standard and there is not such a similar method. I suppose you could submit a feature request to sui's repo https://github.com/MystenLabs/sui/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@bruceeewong @wowok-ai and others