Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 1.46 KB

README.md

File metadata and controls

47 lines (33 loc) · 1.46 KB

Ping Pong

This is a minimal Quartz demo app to serve as a scaffold to learn and build off of.

It allows users to submit a message encrypted to the enclave's pubkey, and receive a response from the enclave encrypted to their own pubkey.

Step by Step

  1. Run
quartz --mock-sgx dev --unsafe-trust-latest --contract-manifest contracts/Cargo.toml
  1. Copy the contract address from the output and paste it onto line 46 of the send_message.rs script.
  2. Copy the pub key from the handshake and paste it onto line 18 of send_message.rs.

The pubkey in the Ping struct will be the user's pubkey, which you can leave untouched.

  1. Next, send this transaction to "Ping" the enclave.
cargo run --bin send_message
  1. Watch the logs from quartz dev. You should see the decrypted message printed.

Now let's find the enclave's response.

  1. Query the contract for its messages
neutrond query wasm contract-state smart $CONTRACT '{
  "get_all_messages": {}
}' -o json
  1. Copy the value from, what should be, the only entry in the map.

  2. Go to send_message.rs and paste the hex value onto line 67. Run decrypt_enclave_response to see the decrypted output.