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

# Transaction Types

Seismic transaction types and data structures in seismic-alloy

Core data structures for building, signing, encrypting, and submitting Seismic transactions.

## Overview

seismic-alloy defines several transaction types that extend Alloy's standard Ethereum types with Seismic-specific encryption and privacy features. These types live in the `seismic-alloy-consensus` crate and are re-exported through the prelude.

## Type Summary

| Type                                                                                                                   | Description                                 | Use Case                                                            |
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------- |
| [`TxSeismic`](https://docs.seismic.systems/clients/alloy/transaction-types/tx-seismic.md)                              | Encrypted Seismic transaction (type `0x4A`) | Privacy-preserving contract calls and state changes                 |
| [`TxSeismicElements`](https://docs.seismic.systems/clients/alloy/transaction-types/tx-seismic-elements.md)             | Encryption metadata and security parameters | Attached to every `TxSeismic` for key exchange, nonce, and expiry   |
| [`TxSeismicMetadata`](https://docs.seismic.systems/clients/alloy/transaction-types/tx-seismic-metadata.md)             | Additional Authenticated Data (AAD) context | AEAD encryption binding — ensures ciphertext is tied to tx params   |
| [`TxLegacyFields`](https://docs.seismic.systems/clients/alloy/transaction-types/tx-seismic-metadata.md#txlegacyfields) | Standard EVM transaction fields             | Subset of tx fields used in AAD construction                        |
| [`SeismicTxEnvelope`](https://docs.seismic.systems/clients/alloy/transaction-types/seismic-tx-envelope.md)             | Signed transaction wrapper enum             | Network submission — wraps all supported tx types including Seismic |

## Transaction Lifecycle

```
TransactionRequest           Build with SeismicTransactionRequest::default()
       |
       v
SeismicTransactionRequest    Mark as seismic with .seismic()
       |
       v
TxSeismic                    Filled by filler pipeline (nonce, gas, elements)
       |
       v
Signed<TxSeismic>            Signed with wallet private key
       |
       v
SeismicTxEnvelope::Seismic   Wrapped in envelope for RLP encoding
       |
       v
Network                      Broadcast via send_raw_transaction
```

## Relationship Between Types

```
TxSeismic
├── chain_id, nonce, gas_price, gas_limit  (standard fields)
├── to, value, input                        (standard fields)
└── seismic_elements: TxSeismicElements
    ├── encryption_pubkey      (secp256k1 compressed, 33 bytes)
    ├── encryption_nonce       (12-byte AES-GCM nonce)
    ├── message_version        (0=RLP, >=2=EIP-712)
    ├── recent_block_hash      (freshness proof)
    ├── expires_at_block       (expiration block number)
    └── signed_read            (true for eth_call reads)

TxSeismicMetadata (for AAD construction)
├── sender: Address
├── legacy_fields: TxLegacyFields
│   ├── chain_id
│   ├── nonce
│   ├── to
│   └── value
└── seismic_elements: TxSeismicElements (same as above)

SeismicTxEnvelope (signed wrapper)
├── Legacy(Signed<TxLegacy>)
├── Eip2930(Signed<TxEip2930>)
├── Eip1559(Signed<TxEip1559>)
├── Eip4844(Signed<TxEip4844Variant>)
├── Eip7702(Signed<TxEip7702>)
└── Seismic(Signed<TxSeismic>)       <-- Seismic type 0x4A
```

## Crate Location

These types are defined in `seismic-alloy-consensus` and re-exported through `seismic-alloy-prelude`:

```rust
use seismic_alloy_consensus::{TxSeismic, TxSeismicElements, TxSeismicMetadata};
```

## Navigation

| Page                                                                                                     | Description                                                     |
| -------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [TxSeismic](https://docs.seismic.systems/clients/alloy/transaction-types/tx-seismic.md)                  | The core Seismic transaction struct with all fields and methods |
| [TxSeismicElements](https://docs.seismic.systems/clients/alloy/transaction-types/tx-seismic-elements.md) | Encryption parameters, builder methods, and crypto helpers      |
| [TxSeismicMetadata](https://docs.seismic.systems/clients/alloy/transaction-types/tx-seismic-metadata.md) | AAD generation for AEAD encryption                              |
| [SeismicTxEnvelope](https://docs.seismic.systems/clients/alloy/transaction-types/seismic-tx-envelope.md) | Signed transaction wrapper for network submission               |

## See Also

* [Contract Interaction](https://docs.seismic.systems/clients/alloy/contract-interaction.md) — How to use these types in practice
* [Shielded Calls](https://docs.seismic.systems/clients/alloy/contract-interaction/shielded-calls.md) — Building transactions with `.seismic()`
* [Encryption](https://docs.seismic.systems/clients/alloy/provider/encryption.md) — How encryption uses these types


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.seismic.systems/clients/alloy/transaction-types.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
