> For the complete documentation index, see [llms.txt](https://docs.useshadowpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.useshadowpay.com/overview/how-shadowpay-works.md).

# How ShadowPay Works

ShadowPay pairs a non-custodial Solana wallet with Solana's Confidential Balances token extension. The result is an account where you keep your own keys, transactions settle on-chain in under a second, and the amounts moving through it are encrypted rather than broadcast to the world.

Addresses are never hidden. Amounts are.

***

## The transfer flow

```
You initiate a transfer in the app
        ↓
ShadowPay's Privacy Engine generates a ZK proof, client-side, on your device
        ↓
The encrypted amount and proof are submitted to Solana
  as a Confidential Balances token transfer
        ↓
Solana validates the proof and updates encrypted balances
        ↓
Sender and receiver addresses are public.
  The transfer amount is ciphertext to everyone else.
        ↓
Only the sender and receiver, holding their decryption keys, can read the amount
        ↓
Transaction appears in both parties' feeds within roughly 400ms
```

The proof that the encrypted amount is valid, meaning it doesn't overdraw the account and matches what was actually sent, is generated entirely on your device. Your unencrypted balance and transfer amounts never touch a ShadowPay server.

***

## What's verified on-chain

Every transfer produces a Solana transaction containing:

* Sender and receiver public keys
* An encrypted amount, using ElGamal encryption over Solana's Confidential Balances extension
* A zero-knowledge proof of transfer validity
* A timestamp and slot number

This is publicly queryable on any Solana block explorer. Anyone can confirm a transfer happened between two addresses. No one but the two parties can see how much moved.

***

## What stays private

**Visible on-chain:** sender address, receiver address, the fact that a transfer occurred, the token type.

**Encrypted on-chain:** the transfer amount and the resulting account balances.

**Never visible to ShadowPay:** your account balance in plaintext, transfer amounts in plaintext, or decrypted transaction history, unless you explicitly generate a disclosure through the app for compliance purposes.

ShadowPay's servers route requests, render UI state, and index on-chain events. They don't hold your keys, and they don't see your balances in the clear.

***

## Real-time indexing

On-chain events are indexed through Helius, giving the app real-time transaction state without polling the chain directly. WebSocket connections push status changes, pending to confirmed, to your feed as they happen.

***

## Next

* [Account Types](/overview/account-types.md): understand the different kinds of ShadowPay accounts
* [Confidential Transfers Explained](/privacy-and-confidential-transfers/confidential-transfers.md): a deeper look at the cryptography


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.useshadowpay.com/overview/how-shadowpay-works.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
