Shielded Write
Encrypted transactions — lifecycle, security parameters, and the low-level API
A shielded write encrypts calldata, builds a TxSeismic (type 0x4a), signs it, and broadcasts it.
How it works
When you call contract.write.someMethod(...), the SDK:
Fetches your nonce and the latest block hash from the node
Builds a
TxSeismic(type0x4a) with encryption metadataEncrypts the calldata using AES-GCM with a shared key derived via ECDH between your ephemeral keypair and the node's TEE public key
Signs and broadcasts the transaction
The encrypted calldata is bound to the transaction context (chain ID, nonce, block hash, expiry) via AES-GCM additional authenticated data, so it can't be replayed or tampered with.
Basic example
import os
from seismic_web3 import PrivateKey, SEISMIC_TESTNET, SRC20_ABI
pk = PrivateKey.from_hex_str(os.environ["PRIVATE_KEY"])
w3 = SEISMIC_TESTNET.wallet_client(pk)
token = w3.seismic.contract("0xYourTokenAddress", SRC20_ABI)
tx_hash = token.write.transfer("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", 1000)
receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
print(receipt["status"]) # 1Gas payment
Omitted gas_payment resolves to GasPayment.auto() before signing. To select another registered fee token, pass a top-level keyword (also supported by async calls):
The selector is public, signed metadata. Explicit Native/Token never falls back. Smart routing stays ABI-based and rejects non-Auto on transparent paths; use .swrite to force a Seismic transaction. Estimates and debug views preserve the choice. See GasPayment for validation, fee units, and SDK/node compatibility.
Security parameters
Every shielded transaction includes a block-hash freshness check and an expiry window. The defaults are sane (100-block window, random nonce, latest block hash), but you can override them per-call:
Security parameters work on both .write and .read calls.
Low-level API
When you need manual control over calldata — contract deployments, pre-encoded data, or bypassing the ShieldedContract abstraction:
Debug mode
.dwrite sends a real transaction and also returns plaintext/encrypted views for debugging:
Async variant
See Also
ShieldedContract —
.write,.dwritenamespace referenceSeismicSecurityParams — Security parameter details
Signed Reads — Encrypted reads using the same encryption flow
Last updated

