For the complete documentation index, see llms.txt. This page is also available as Markdown.

Network

Network abstractions for Seismic chain interaction

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

Production / Testnet

Full Seismic node (reth-based). Use for devnet, testnet, and mainnet.

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

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

SeismicProviderBuilder defaults to SeismicReth. Call .foundry() to switch to SeismicFoundry for local development with Sanvil.

Quick Start

Production / Testnet

Local Development (Sanvil)

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

Core trait defining Seismic network behavior

Production network type for devnet/testnet/mainnet

Development network type for Sanvil

See Also

Last updated