# App AES Key

Every TApp has an AES key. This AES key is used to encrypt/decrypt any data stored to hosting nodes' local IPFS or OrbitDB databases.

## Generating the app's AES key

When a TApp is first created in the TAppStore, the GenreateAesKeyTxn is created and then executed in the [state machine](https://github.com/tearust/t-rust/blob/master/docs/_gitbook-dev-docs/z_glossary/state_machine.md).

During execution, a random AES key is generated in the state.

The state machine algorithm can keeps the random AES key consistent among all state machine nodes.

## A hosting node's access to this AES key

When a hosting node starts to host a TApp, the TApp actor can access the AES key from the state machine. The state machine only sends the AES key if the requestor is the TApp's actor.


---

# 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://dev.teaproject.org/z_glossary/app_aes_key.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.
