create_public_client
Create sync Web3 instance with public (read-only) Seismic access
Create a synchronous Web3 instance with public (read-only) Seismic access.
Balance RPC migration: On reth with PR #502,
w3.eth.get_balance()returns a compatibility placeholder, not native or sUSDC holdings. Do not use it for funding decisions. See Balance RPCs for explicit native queries.
Overview
create_public_client() creates a client for read-only operations on the Seismic network. No private key is required. The w3.seismic namespace provides only public read operations: get_tee_public_key(), get_deposit_root(), get_deposit_count(), and contract() (with .tread only).
This is useful for applications that only need to query chain state without submitting transactions, such as block explorers, analytics dashboards, or read-only dApps.
Signature
def create_public_client(rpc_url: str) -> Web3Parameters
rpc_url
str
Yes
HTTP(S) URL of the Seismic node (e.g., "https://testnet-1.seismictest.net/rpc"). WebSocket URLs are not supported — see note below
Returns
Web3
A Web3 instance with w3.seismic namespace attached (SeismicPublicNamespace)
Examples
Basic Usage
Using Chain Configuration
Read-Only Contract Access
Standard Web3 Operations
Block Explorer Pattern
How It Works
The function performs two steps:
Create Web3 instance
Attach public Seismic namespace
No TEE public key fetching or encryption setup is performed since the client cannot perform shielded operations.
Client Capabilities
Standard Web3 Methods (e.g. w3.eth, w3.net)
get_block(),get_transaction(),get_balance()get_code(),call(),estimate_gas()All other standard read-only
web3.pyfunctionality
Public Seismic Methods (w3.seismic)
get_tee_public_key()- Get TEE public keyget_deposit_root()- Query deposit merkle rootget_deposit_count()- Query deposit countcontract()- Create contract wrappers (.treadonly)
NOT Available
send_shielded_transaction()- Requires private keydebug_send_shielded_transaction()- Requires private keysigned_call()- Requires private key and encryptiondeposit()- Requires private keyContract
.swriteand.sreadmethods - Require private key
Public vs Wallet Client
Private key
Not required
Required
Shielded writes
No
Yes
Signed reads
No
Yes
Transparent reads
Yes
Yes
Deposits
No
Yes
TEE queries
Yes
Yes
Standard Web3
All read operations
All operations
Notes
HTTP only — Sync clients use
Web3withHTTPProvider, which does not support WebSocket connections. This is a limitation of the underlyingweb3.pylibrary (WebSocketProvideris async-only). If you need WebSocket support (persistent connections, subscriptions), usecreate_async_public_client()withws=TrueNo private key required or accepted
No encryption setup performed
No RPC calls during client creation (lightweight)
Cannot perform any write operations or shielded reads
Contract wrappers only expose
.tread(transparent read)For write operations, use
create_wallet_client()For async operations, use
create_async_public_client()
Use Cases
Block explorers and chain analytics
Read-only dApps that display public data
Monitoring and alerting systems
Price oracles and data aggregators
Public dashboards and visualizations
Testing and validation tools
See Also
create_async_public_client - Async variant with WebSocket support
create_wallet_client - Full-featured client with private key
SeismicPublicNamespace - The public
w3.seismicnamespaceChains Configuration - Pre-configured chain constants
Contract Instances - Working with contract wrappers
Last updated

