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
Feature Idea
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
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 usingSapphire.encrypt
In the contract you can do:
bytes32 nonce = bytes32(Sapphire.randomBytes(32,""));
bytes ciphertext = Sapphire.encrypt(key, nonce, abi.encode(...))
emit Event(nonce, ciphertext)
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.