# Calculating the Shared Secret

The shared secret SS facilitates secure communication between Bob and Alice:

1. An ephemeral key pair is created for the transaction.
2. Using Elliptic Curve Diffie-Hellman (ECDH), the shared secret SS is calculated as:

S=ePrivK⋅vpk

Where:

* ePrivK represents the ephemeral private key generated for the transaction.
* vpk is the recipient’s viewing public key.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.0x0.ai/0x0-ecosystem/arcane-privacy-wallet/calculating-the-shared-secret.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
