> 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/network.md).

# Network

The `seismic-alloy` SDK defines network types that configure how providers encode transactions, parse responses, and interact with Seismic nodes. Every provider is generic over a network type that implements the `SeismicNetwork` trait.

## Overview

Alloy's architecture uses a `Network` trait to associate transaction types, receipt types, and other chain-specific types into a single coherent set. Seismic extends this pattern with the `SeismicNetwork` trait, which adds methods for handling shielded transaction elements, calldata encryption, and Seismic-specific signing.

The SDK provides two concrete network implementations:

| Network                                                       | Use Case             | Description                                                           |
| ------------------------------------------------------------- | -------------------- | --------------------------------------------------------------------- |
| [`SeismicReth`](/clients/alloy/network/seismic-reth.md)       | Production / Testnet | Full Seismic node (reth-based). Use for devnet, testnet, and mainnet. |
| [`SeismicFoundry`](/clients/alloy/network/seismic-foundry.md) | Local Development    | Sanvil (Seismic Anvil). Use for local testing with `sanvil`.          |

Both implement `SeismicNetwork` and can be used with the `SeismicProviderBuilder` to create providers.

## Core Abstraction

The [`SeismicNetwork`](/clients/alloy/network/seismic-network-trait.md) trait is the foundation of the network layer. It extends Alloy's `Network` and `RecommendedFillers` traits and defines how to:

* Attach and retrieve seismic encryption elements on transaction requests
* Read and write encrypted calldata (`input`) on requests and envelopes
* Sign transactions using a `SeismicWallet`
* Identify Seismic transaction types
* Extract Seismic metadata from signed envelopes

```rust
use seismic_prelude::client::*;
use seismic_alloy_network::reth::SeismicReth;

// SeismicReth for production (default)
let provider = SeismicProviderBuilder::new()
    .wallet(wallet)
    .connect_http(url)
    .await?;

// SeismicFoundry for local dev with Sanvil
let provider = SeismicProviderBuilder::new()
    .foundry()
    .wallet(wallet)
    .connect_http(url)
    .await?;
```

## Choosing a Network Type

```
Are you connecting to a remote Seismic node (devnet/testnet/mainnet)?
  -> Use SeismicProviderBuilder::new() (defaults to SeismicReth)

Are you testing locally with sanvil?
  -> Use SeismicProviderBuilder::new().foundry()
```

{% hint style="info" %}
`SeismicProviderBuilder` defaults to `SeismicReth`. Call `.foundry()` to switch to `SeismicFoundry` for local development with Sanvil.
{% endhint %}

## Quick Start

### Production / Testnet

```rust
use seismic_prelude::client::*;
use seismic_alloy_network::reth::SeismicReth;

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?;
```

### Local Development (Sanvil)

```rust
use seismic_prelude::client::*;
use seismic_alloy_network::foundry::SeismicFoundry;

let signer: PrivateKeySigner = "0xYOUR_PRIVATE_KEY".parse()?;
let wallet = SeismicWallet::<SeismicFoundry>::from(signer);
let url = "http://127.0.0.1:8545".parse()?;

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

## Associated Types

Both network types define the same set of associated types required by Alloy's `Network` trait, but with different concrete implementations:

| Associated Type       | SeismicReth                      | SeismicFoundry                          |
| --------------------- | -------------------------------- | --------------------------------------- |
| `TxType`              | `SeismicTxType`                  | `SeismicFoundryTxType`                  |
| `TxEnvelope`          | `SeismicTxEnvelope`              | `SeismicFoundryTxEnvelope`              |
| `UnsignedTx`          | `SeismicTypedTransaction`        | `SeismicFoundryTypedTransaction`        |
| `TransactionRequest`  | `SeismicTransactionRequest`      | `SeismicFoundryTransactionRequest`      |
| `ReceiptEnvelope`     | `SeismicReceiptEnvelope`         | `SeismicFoundryReceiptEnvelope`         |
| `TransactionResponse` | `Transaction<SeismicTxEnvelope>` | `Transaction<SeismicFoundryTxEnvelope>` |

## Pages

| Page                                                                    | Description                                        |
| ----------------------------------------------------------------------- | -------------------------------------------------- |
| [SeismicNetwork Trait](/clients/alloy/network/seismic-network-trait.md) | Core trait defining Seismic network behavior       |
| [SeismicReth](/clients/alloy/network/seismic-reth.md)                   | Production network type for devnet/testnet/mainnet |
| [SeismicFoundry](/clients/alloy/network/seismic-foundry.md)             | Development network type for Sanvil                |

## See Also

* [Provider Overview](/clients/alloy/provider.md) - Signed and unsigned provider types
* [Fillers](/clients/alloy/fillers.md) - Transaction filler pipeline
* [Wallet](/clients/alloy/wallet.md) - SeismicWallet documentation
* [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/network.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.
