Signed Read Pattern
Authenticated read pattern with encrypted request and response
This example demonstrates the authenticated read pattern: create a signed provider, deploy a contract, write shielded data, read it back with a signed read, and compare with a transparent read to show the difference.
Prerequisites
export PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
export RPC_URL="https://testnet-1.seismictest.net/rpc"Cargo.toml — see Installation for the full template including the required [patch.crates-io] block:
[package]
name = "signed-read-pattern"
version = "0.1.0"
edition = "2021"
rust-version = "1.82"
[dependencies]
seismic-prelude = { git = "https://github.com/SeismicSystems/seismic-alloy" }
seismic-alloy-network = { git = "https://github.com/SeismicSystems/seismic-alloy" }
seismic-alloy-provider = { git = "https://github.com/SeismicSystems/seismic-alloy" }
alloy-provider = "1.1"
alloy-signer-local = "1.1"
alloy-primitives = "1.1"
alloy-sol-types = "1.1"
alloy-network = "1.1"
tokio = { version = "1", features = ["full"] }
reqwest = "0.12"
# [patch.crates-io] block required — see Installation.Complete Example
When Results Differ
The example above uses isOdd(), which does not depend on msg.sender. Both reads return the same value. To see a real difference, consider a contract where the view function uses msg.sender:
Key Differences at a Glance
Aspect
.seismic().call() (Signed Read)
.call() (Transparent Read)
Method
contract.method().seismic().call()
contract.method().call()
msg.sender
Your wallet address
Zero address (0x0)
Calldata
Encrypted with AES-GCM
Plaintext
Response
Encrypted by TEE, decrypted by provider
Plaintext
Provider
SeismicSignedProvider only
Any provider
Privacy
Full (observers see nothing)
None (calldata and result visible)
Expected Output
Next Steps
Shielded Write Complete - Full shielded write lifecycle
Contract Deployment - Deploy and interact patterns
Basic Setup - Provider setup details
See Also
Signed Reads Guide - Step-by-step guide
Shielded Calls - API reference
Transparent Calls - Non-encrypted operations
SeismicSignedProvider - Provider documentation
Last updated

