1

I would like to store a sensitive data on-chain. The only way to do it AFAIK is to encrypt it with the pubkey of the receiver, store the encrypted message on-chain. Then the receiver could decrypt it with his private key.

Is there a way to do this simply with the phantom wallet ? I don't really want to ask someone for his private key in an app.

1 Answer 1

1

The only way to do it AFAIK is to encrypt it with the pubkey of the receiver, store the encrypted message on-chain.

As one commenter already pointed out, signing is not the same as encrypting, and the technique you're referring to here simply does not work with ed25519 (Solana's chosen signing algorithm).

Phantom won't be able to help you here. You'll need to bolt on your service's encryption yourself.

If your data is not public (encrypted), a blockchain is not a great place for it.

If you want the Web3 integration, your problem is probably better solved using Web3 storage tools like shadow.storage. Consider how you can do content-based addressing and URLs stored on chain pointing to off-chain storage of encrypted content.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.