oasisprotocol / sapphire-paratime

Oasis Sapphire - the confidential EVM-compatible ParaTime for the Oasis Network
https://oasisprotocol.org/sapphire
Apache License 2.0
37 stars 27 forks source link

Tutorial on how to encrypt events #275

Open CedarMist opened 8 months ago

CedarMist commented 8 months ago
SUMMARY

Information in events is public, however developers may want the contract to output information which is only readable by whoever submitted the transaction.

ISSUE TYPE
COMPONENT NAME

Documentation

ADDITIONAL INFORMATION

Currently the deoxysii-js and related DeoxysII packages can be used to decrypt data which was encrypted using Sapphire.encrypt

In the contract you can do:

If the transaction is encrypted the user can pass the encryption key to the contract, or the encryption key can be derived in some other way.