> For the complete documentation index, see [llms.txt](https://docs.seismic.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seismic.systems/clients/python/client.md).

# Client

The Seismic Python SDK provides two client types for interacting with Seismic nodes:

* [**Wallet client**](/clients/python/client/create-wallet-client.md) — Full capabilities (shielded writes, signed reads, deposits). Requires a private key.
* [**Public client**](/clients/python/client/create-public-client.md) — Read-only (transparent reads, TEE public key, deposit queries). No private key needed.

Both clients are available in **sync** and **async** variants.

## Quick Start

### Installation

```bash
pip install seismic-web3
```

Or with [uv](https://docs.astral.sh/uv/):

```bash
uv add seismic-web3
```

### Wallet Client (Sync)

```python
import os
from seismic_web3 import SEISMIC_TESTNET, PrivateKey

pk = PrivateKey.from_hex_str(os.environ["PRIVATE_KEY"])
w3 = SEISMIC_TESTNET.wallet_client(pk)
```

This gives you a standard `Web3` instance with an extra `w3.seismic` namespace. Everything from `web3.py` works as usual — `w3.eth.get_block(...)`, `w3.eth.wait_for_transaction_receipt(...)`, etc.

### Wallet Client (Async)

```python
import os
from seismic_web3 import SEISMIC_TESTNET, PrivateKey

pk = PrivateKey.from_hex_str(os.environ["PRIVATE_KEY"])

# HTTP
w3 = await SEISMIC_TESTNET.async_wallet_client(pk)

# WebSocket (auto-selects ws_url from chain config)
w3 = await SEISMIC_TESTNET.async_wallet_client(pk, ws=True)
```

Every method on `w3.seismic` and on `ShieldedContract` is `await`-able when using the async client.

### Public Client

```python
from seismic_web3 import SEISMIC_TESTNET

# Sync
public = SEISMIC_TESTNET.public_client()

# Async
public = SEISMIC_TESTNET.async_public_client()
```

The public client's `w3.seismic` namespace has limited methods: `get_tee_public_key()`, `get_deposit_root()`, `get_deposit_count()`, and `contract()` (with `.tread` only).

## Client Factory Functions

### Wallet Clients (Require Private Key)

| Function                                                                              | Type  | Description                             |
| ------------------------------------------------------------------------------------- | ----- | --------------------------------------- |
| [create\_wallet\_client](/clients/python/client/create-wallet-client.md)              | Sync  | Create sync wallet client from RPC URL  |
| [create\_async\_wallet\_client](/clients/python/client/create-async-wallet-client.md) | Async | Create async wallet client from RPC URL |

### Public Clients (No Private Key)

| Function                                                                              | Type  | Description                             |
| ------------------------------------------------------------------------------------- | ----- | --------------------------------------- |
| [create\_public\_client](/clients/python/client/create-public-client.md)              | Sync  | Create sync public client from RPC URL  |
| [create\_async\_public\_client](/clients/python/client/create-async-public-client.md) | Async | Create async public client from RPC URL |

## Chain-Based Creation

The recommended approach is to use chain configuration objects:

```python
import os
from seismic_web3 import SEISMIC_TESTNET, SANVIL, PrivateKey

# Seismic testnet
pk = PrivateKey.from_hex_str(os.environ["PRIVATE_KEY"])
w3 = SEISMIC_TESTNET.wallet_client(pk)

# Sanvil testnet
w3 = SANVIL.wallet_client(pk)
```

See [Chains Configuration](/clients/python/chains.md) for more details.

## Encryption

The wallet client automatically handles encryption setup:

1. Fetches the network's TEE public key
2. Derives a shared [AES-GCM](https://en.wikipedia.org/wiki/Galois/Counter_Mode) key via [ECDH](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman)
3. Uses this key to encrypt calldata for all shielded transactions and signed reads

You don't need to manage this manually, but the encryption state is accessible at `w3.seismic.encryption` if needed.

### Encryption Components

| Component                                                     | Description                                  |
| ------------------------------------------------------------- | -------------------------------------------- |
| [EncryptionState](/clients/python/client/encryption-state.md) | Holds AES key and encryption keypair         |
| [get\_encryption](/clients/python/client/get-encryption.md)   | Derives encryption state from TEE public key |

## Client Capabilities

### Wallet Client (`w3.seismic`)

* [`send_shielded_transaction()`](/clients/python/namespaces/methods/send-shielded-transaction.md) - Send shielded transactions
* [`debug_send_shielded_transaction()`](/clients/python/namespaces/methods/debug-send-shielded-transaction.md) - Debug shielded transactions
* [`signed_call()`](/clients/python/namespaces/methods/signed-call.md) - Execute signed reads
* [`get_tee_public_key()`](/clients/python/namespaces/methods/get-tee-public-key.md) - Get TEE public key
* [`deposit()`](/clients/python/namespaces/methods/deposit.md) - Deposit ETH/tokens
* [`get_deposit_root()`](/clients/python/namespaces/methods/get-deposit-root.md) - Query deposit merkle root
* [`get_deposit_count()`](/clients/python/namespaces/methods/get-deposit-count.md) - Query deposit count
* [`contract()`](/clients/python/contract.md) - Create contract wrappers

### Public Client (`w3.seismic`)

* [`get_tee_public_key()`](/clients/python/namespaces/methods/get-tee-public-key.md) - Get TEE public key
* [`get_deposit_root()`](/clients/python/namespaces/methods/get-deposit-root.md) - Query deposit merkle root
* [`get_deposit_count()`](/clients/python/namespaces/methods/get-deposit-count.md) - Query deposit count
* [`contract()`](/clients/python/contract.md) - Create contract wrappers (`.tread` only)

## See Also

* [Contract Instances](/clients/python/contract.md) - Working with shielded and public contracts
* [Namespaces](/clients/python/namespaces.md) - Detailed `w3.seismic` namespace documentation
* [Chains Configuration](/clients/python/chains.md) - Chain configs and constants
* [Shielded Write Guide](/clients/python/guides/shielded-write.md) - Step-by-step shielded transaction guide


---

# 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:

```
GET https://docs.seismic.systems/clients/python/client.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.
