> 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/alloy/chains/seismic-testnet.md).

# Seismic Testnet

The Seismic public testnet is the primary network for development and testing. It runs a full reth-based Seismic node with TEE support, shielded transactions, and all protocol features.

## Configuration

| Property          | Value                                   |
| ----------------- | --------------------------------------- |
| Chain ID          | `5124`                                  |
| RPC URL           | `https://testnet-1.seismictest.net/rpc` |
| Network Type      | `SeismicReth`                           |
| Transaction Types | Legacy, EIP-1559, Seismic (`0x4A`)      |

## Connecting

### Signed Provider (Full Capabilities)

Use a signed provider for sending transactions, shielded writes, and signed reads:

```rust
use seismic_prelude::client::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let signer: PrivateKeySigner = "0xYOUR_PRIVATE_KEY".parse()?;
    let wallet = SeismicWallet::<SeismicReth>::from(signer);
    let url = "https://testnet-1.seismictest.net/rpc".parse()?;

    let provider = SeismicProviderBuilder::new()
        .wallet(wallet)
        .connect_http(url)
        .await?;

    // Verify connection
    let block_number = provider.get_block_number().await?;
    let chain_id = provider.get_chain_id().await?;
    println!("Connected to chain {chain_id} at block {block_number}");

    Ok(())
}
```

### Unsigned Provider (Read-Only)

Use an unsigned provider for read-only operations that do not require a private key:

```rust
use seismic_prelude::client::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let url = "https://testnet-1.seismictest.net/rpc".parse()?;
    let provider = SeismicProviderBuilder::new()
        .connect_http(url)
        .await?;

    let block_number = provider.get_block_number().await?;
    println!("Testnet block: {block_number}");

    Ok(())
}
```

### With Builder Pattern

If you prefer to specify the network type explicitly:

```rust
use seismic_prelude::client::*;

let signer: PrivateKeySigner = "0xYOUR_PRIVATE_KEY".parse()?;
let wallet = SeismicWallet::<SeismicReth>::from(signer);
let url = "https://testnet-1.seismictest.net/rpc".parse()?;

let provider = SeismicProviderBuilder::new()
    .wallet(wallet)
    .connect_http(url)
    .await?;
```

## Examples

### Send a Shielded Transaction

```rust
use seismic_prelude::client::*;
use alloy_primitives::address;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let signer: PrivateKeySigner = "0xYOUR_PRIVATE_KEY".parse()?;
    let wallet = SeismicWallet::<SeismicReth>::from(signer);
    let url = "https://testnet-1.seismictest.net/rpc".parse()?;

    let provider = SeismicProviderBuilder::new()
        .wallet(wallet)
        .connect_http(url)
        .await?;

    // Build a Seismic transaction
    // The filler pipeline automatically handles:
    // - Encryption elements
    // - Calldata encryption
    // - Gas estimation
    // - Nonce and chain ID
    // - Signing

    let block = provider.get_block_number().await?;
    println!("Current block: {block}");

    Ok(())
}
```

### Check Connection

```rust
use seismic_prelude::client::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let url = "https://testnet-1.seismictest.net/rpc".parse()?;
    let provider = SeismicProviderBuilder::new()
        .connect_http(url)
        .await?;

    match provider.get_chain_id().await {
        Ok(chain_id) => println!("Connected to chain {chain_id}"),
        Err(e) => println!("Connection failed: {e}"),
    }

    Ok(())
}
```

### Using Environment Variables

```rust
use seismic_prelude::client::*;
use std::env;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let private_key = env::var("PRIVATE_KEY")?;
    let signer: PrivateKeySigner = private_key.parse()?;
    let wallet = SeismicWallet::<SeismicReth>::from(signer);

    let rpc_url = env::var("SEISMIC_RPC_URL")
        .unwrap_or_else(|_| "https://testnet-1.seismictest.net/rpc".to_string());
    let url = rpc_url.parse()?;

    let provider = SeismicProviderBuilder::new()
        .wallet(wallet)
        .connect_http(url)
        .await?;

    let block = provider.get_block_number().await?;
    println!("Block: {block}");

    Ok(())
}
```

## Notes

* Chain ID `5124` is used for EIP-155 and EIP-712 transaction signing
* The testnet supports all Seismic protocol features including shielded transactions and signed reads
* The TEE public key is fetched automatically by `SeismicElementsFiller` on the first transaction
* WebSocket endpoints may be available; check the Seismic documentation for current URLs
* The testnet is suitable for development and testing but not for production use

## See Also

* [Chains Overview](/clients/alloy/chains.md) - All supported chains
* [Sanvil](/clients/alloy/chains/sanvil.md) - Local development network
* [SeismicReth](/clients/alloy/network/seismic-reth.md) - Network type used with testnet
* [SeismicSignedProvider](/clients/alloy/provider/seismic-signed-provider.md) - Full-featured provider
* [Installation](/clients/alloy/installation.md) - Cargo setup and prerequisites


---

# 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.seismic.systems/clients/alloy/chains/seismic-testnet.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.
