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

encrypted get_state and set_state #57

Closed
guyz opened this issue Mar 1, 2020 · 0 comments
Closed

encrypted get_state and set_state #57

guyz opened this issue Mar 1, 2020 · 0 comments
Labels
dev Critical path development tasks

Comments

@guyz
Copy link
Contributor

guyz commented Mar 1, 2020

This should overlay the existing implementation of CosmWasm as much as possible. The complexity lies with actually navigating between doing this inside of the enclave, and actually storing/fetching data that lives outside of the enclave (in the untrusted part of the validator).
We can make the following simplifying assumptions for encrypted state:

  • keys are unencrypted - this allows searching in plaintext outside of the enclave. If someone wants to fully encrypt the state, they can have a single key that maps to a single encrypted dictionary
  • Decrypting the existing state value with the previous tx_hash. Note: the unencrypted latest tx_hash (or whatever nonce we decide on) needs to be serialized and included with the stored value.

In set_state, need to do the opposite:

  • Derive a new state encryption key using the master key and current tx_hash.
  • Encrypt the data and serialize it, alongside the tx_hash
  • Pass the unencrypted key in the key value store, alongside the encrypted bytes outside of the enclave for CosmWasm to store natively.
@guyz guyz added the dev Critical path development tasks label Mar 1, 2020
@assafmo assafmo closed this as completed Jun 7, 2020
liorbond added a commit that referenced this issue Jan 18, 2023
v1.6 upgrade handler test guidance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Critical path development tasks
Projects
None yet
Development

No branches or pull requests

2 participants