EncryptedStore

Contract for storing keyed encrypted messages via the EVM.

This contract uses topic hashes as keys and can store a single arbitrary encrypted message per topic at any given time. Technically, topic hashes and messages do not need to be encrypted, but because anyone can read stored messages, this contract is designed to store encrypted messages. Only one message per topic is stored at any given time.

getMessage(address user, bytes32 topicHash) → bytes external

Gets the current stored message corresponding to user and topicHash.

To decrypt messages (this requires access to the owner’s private keys), use the decryptMessage() function in common/Crypto.js.

Parameters:

  • user: address that stored this message.

  • topicHash: hash of the "subject" of the message.

storeMessage(bytes32 topicHash, bytes message) public

Stores a message categorized by a particular topicHash. This will overwrite the previous messages sent by this caller with this topicHash.

To construct an encrypted message, use the encryptMessage() in common/Crypto.js.

Parameters:

  • topicHash: hash of the "subject" or "topic" of the message.

  • message: the stored message.

removeMessage(bytes32 topicHash) public

Removes a stored message categorized by a particular topicHash.

Parameters:

  • topicHash: hash of the "subject" or "topic" of the message.

© UMA Project 2018-2019