> 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/python/src20/intelligence-providers.md).

# Intelligence Providers

Viewing key management and encrypted event decryption

Manage viewing keys and decrypt SRC20 event data. Viewing keys are 32-byte AES-256 keys stored in the [Directory](/clients/python/abis/directory.md) genesis contract that allow holders to decrypt Transfer and Approval event amounts.

## Functions

| Function                                                                                                     | Returns             | Description                                     |
| ------------------------------------------------------------------------------------------------------------ | ------------------- | ----------------------------------------------- |
| [`register_viewing_key`](/clients/python/src20/intelligence-providers/register-viewing-key.md)               | `HexBytes`          | Register a viewing key (shielded write)         |
| [`get_viewing_key`](/clients/python/src20/intelligence-providers/get-viewing-key.md)                         | `Bytes32`           | Fetch your viewing key (signed read)            |
| [`check_has_key`](/clients/python/src20/intelligence-providers/check-has-key.md)                             | `bool`              | Check if address has a key (public)             |
| [`get_key_hash`](/clients/python/src20/intelligence-providers/check-has-key.md)                              | `bytes`             | Get `keccak256` hash of address's key (public)  |
| `compute_key_hash`                                                                                           | `bytes`             | Compute `keccak256(viewing_key)` locally (pure) |
| [`watch_src20_events_with_key`](/clients/python/src20/intelligence-providers/watch-src20-events-with-key.md) | `SRC20EventWatcher` | Watch events using an explicit viewing key      |

All functions except `compute_key_hash` have async variants prefixed with `async_`.

## Example

```python
import os
from seismic_web3 import PrivateKey, Bytes32, SEISMIC_TESTNET
from seismic_web3.src20 import register_viewing_key, get_viewing_key

pk = PrivateKey.from_hex_str(os.environ["PRIVATE_KEY"])
w3 = SEISMIC_TESTNET.wallet_client(pk)

# Register a viewing key
viewing_key = Bytes32(os.urandom(32))
tx_hash = register_viewing_key(w3, w3.seismic.encryption, pk, key=viewing_key)
w3.eth.wait_for_transaction_receipt(tx_hash)

# Fetch it back
fetched = get_viewing_key(w3, w3.seismic.encryption, pk)
assert fetched == viewing_key
```

## See Also

* [Event Watching](/clients/python/src20/event-watching.md) — Watch and decrypt SRC20 events
* [Types](/clients/python/src20/types.md) — Decrypted event data structures
* [Directory ABI](/clients/python/abis/directory.md) — Low-level ABI and contract address


---

# 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/python/src20/intelligence-providers.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.
