Where Messages are Stored
In the TEA Party, the messages are stored in an OrbitDB database. OrbitDB is a non-relational database running on top of IPFS.
For TEA Party's public messages, there's no need to encrypt.
But private messages aren't saved in plain text. The hosting nodes will encrypt the message using the app_aes_key and then save the cypher to OrbitDB.
Because only TEA Party hosting nodes have the app_aes_key in their own enclave, other apps or users cannot get the content of these messages.
OrbitDB /IPFS is very cheap compared to using the state machine which exclusively uses RAM to store the state. For more details, please see orbitdb.