> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shakesco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ethereum Privacy

> Enable private on-chain transfers by generating one-time receiving addresses that cannot be publicly linked to a recipient.

<span style={{display:"none"}}>For the complete documentation index, see [llms.txt](/llms.txt).</span>

## Why Privacy Matters in Crypto

Cash still dominates everyday transactions. The reason? **Privacy and finality**.

Blockchain nailed finality. Once a transaction is confirmed, it's permanent. But privacy? That's where things get tricky. When Bob knows Alice's wallet address, he can track every payment she makes. Everything is public, transparent, and traceable.

<CardGroup cols={2}>
  <Card title="The Good" icon="shield-check">
    Public transactions let us track malicious activity and investigate hacks
  </Card>

  <Card title="The Bad" icon="eye">
    Businesses can't operate on-chain when competitors can monitor their
    financial moves
  </Card>
</CardGroup>

**Stealth addresses** solve this privacy puzzle while keeping blockchain's transparency intact.

***

## How Stealth Addresses Work

<Info>
  **Math notation guide:**

  <ul>
    <li>Lowercase letters (p, r, s) = private keys</li>
    <li>Uppercase letters (P, R, S) = public keys</li>
    <li>`·` symbol = scalar multiplication on elliptic curves</li>
  </ul>
</Info>

### The Basic Concept

Imagine Charles wants to send Alice some funds without anyone linking the transaction to her known address.

<Steps>
  <Step title="Charles generates a random number">
    He creates a random private key **`r`** (called an ephemeral key)
  </Step>

  <Step title="He computes a one-time address">
    Charles multiplies Alice's public key **`P`** by his random number: **`P ·
          r`** = **`P'`** (a brand new public key) He sends funds to the address derived
    from **`P'`**
  </Step>

  <Step title="Alice can spend the funds">
    Thanks to elliptic curve math, Alice computes the private key for this new
    address: **`p · r`** = **`s`** (the private key for **`P'`**) Now Alice
    controls this address, but Bob has no idea she received anything from
    Charles
  </Step>
</Steps>

### The Enhanced Approach (EIP-5564)

The basic method has a problem: Alice needs to use her private key to scan for incoming payments. That's risky.

Following the [EIP-5564 standard](https://eips.ethereum.org/EIPS/eip-5564), Shakesco implements a safer approach using **view and spending key pairs**.

<Accordion title="How view and spending keys work">
  **Alice's Setup:**

  * Generates two key pairs:
    * **View keys**: `p_view` (private) and `P_view` (public)
    * **Spending keys**: `p_spend` (private) and `P_spend` (public)
  * Makes both public keys available (`P_view` and `P_spend`)

  **Charles sends funds:**

  1. Generates random number **`r`**
  2. Computes stealth address from **`P_spend · r`**
  3. Encrypts **`r`** using [ECDH](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman) with:
     * Alice's **`P_view`** (public view key)
     * His ephemeral private key
  4. Sends funds to stealth address
  5. Publishes encrypted **`r`** and ephemeral public key on-chain

  **Alice scans for payments:**

  1. Uses her **`p_view`** (private view key) with Charles's ephemeral public key to decrypt **`r`**
  2. Computes potential private key: **`p_spend · r`**
  3. Derives address from this private key
  4. If address matches the stealth address → she owns the funds! 🎉
</Accordion>

<Warning>
  Alice never exposes her spending private key during scanning. She only uses
  her view key to detect payments, making the process much safer.
</Warning>

***

## The Privacy Advantage

With stealth addresses:

* ✅ Every payment goes to a unique, unlinkable address
* ✅ Only the sender and receiver know who's involved
* ✅ Third parties can't track transaction patterns
* ✅ Businesses can operate with financial privacy
* ✅ Blockchain transparency remains for fraud detection

***

## Learn More

<CardGroup cols={2}>
  <Card title="EIP-5564 Standard" icon="file-lines" href="https://eips.ethereum.org/EIPS/eip-5564">
    Read the official Ethereum Improvement Proposal for stealth addresses
  </Card>

  <Card title="Umbra Protocol" icon="shield-halved" href="https://app.umbra.cash/faq#how-does-it-work-technical">
    Explore how Umbra implements stealth payments in production
  </Card>
</CardGroup>

***

<Tip>
  Ready to implement stealth payments? Check out our [integration
  guide](/stealth-payments/integrate) to get started.
</Tip>
