# Signed Reads

A signed read (`.read`) builds a full `TxSeismic` just like a [shielded write](/clients/python/guides/shielded-write.md), but targets the `eth_call` endpoint instead of broadcasting a transaction. The node decrypts the calldata inside the TEE, executes the call, encrypts the result, and returns it.

## Why this matters

Any contract function that depends on `msg.sender` needs a signed read. A plain `eth_call` zeros out the `from` field, so the contract wouldn't know who's asking.

```python
# This proves your identity to the contract
result = token.read.balanceOf()

# This does NOT — msg.sender will be 0x0
result = token.tread.balanceOf()
```

A common example: SRC20's `balanceOf()` takes no arguments and uses `msg.sender` internally. If you call it with `.tread`, the contract sees the zero address as the sender and returns its balance — which is almost certainly zero.

## What gets encrypted

Both the calldata you send and the result you get back are encrypted. An observer watching the network can see that you made a call to a particular contract address, but not what function you called or what was returned.

## Basic example

```python
import os
from eth_abi import decode
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)

raw = token.read.balanceOf()
balance = decode(["uint256"], bytes(raw))[0]
print(balance)
```

## Low-level API

For pre-encoded calldata or non-ABI interactions:

```python
from eth_abi import decode
from seismic_web3.contract.abi import encode_shielded_calldata

data = encode_shielded_calldata(SRC20_ABI, "balanceOf", [])
raw = w3.seismic.signed_call(
    to="0xYourTokenAddress",
    data=data,
    gas=30000000,
)

balance = decode(["uint256"], bytes(raw))[0]
```

## Async variant

```python
w3 = await SEISMIC_TESTNET.async_wallet_client(pk)
token = w3.seismic.contract("0xYourTokenAddress", SRC20_ABI)

raw = await token.read.balanceOf()
balance = decode(["uint256"], bytes(raw))[0]
```

## See Also

* [ShieldedContract](/clients/python/contract/shielded-contract.md) — `.read`, `.tread` namespace reference
* [Shielded Write](/clients/python/guides/shielded-write.md) — Same encryption flow, but broadcasts a transaction


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.seismic.systems/clients/python/guides/signed-reads.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
