Have you returned to an app and found that one of your data items is no longer showing up?
On Stellar, the storage type tells you whether that data can be recovered or whether the app needs to create it again.
The period is measured in network closes
Stellar smart contracts run on Soroban. Each entry they store has an expiration limit called a TTL. It is measured in ledger closes on the network. If the current close is 1,000 and the limit is 1,050, there are 50 closes left until the limit. Once that number is exceeded, the data is no longer available to the contract.
A game stores two pieces of data
Fictional example. A game stores your record persistently and an invite code for a friend in temporary storage. If both expire, the record is archived and can be restored. The code is permanently deleted from the contract state. To invite someone again, the game needs to issue another one.
There is also instance data, such as a setting shared by all players. This data expires along with the contract instance and can also be restored. Each persistent entry has its own expiration period. The game can keep running even if a player's record is archived.
What happens when the data is restored
When preparing a transaction, the application can simulate it. If the simulation finds archived data, it usually adds it to the restoration list. When the transaction includes that entry in the list, the network restores it before executing the contract. Restoration may add a cost. On Stellar, $XLM is used to pay network fees.
An entry's expiration period can be extended. To do so, the contract or a network operation must explicitly request it. Reads and writes alone leave the expiration as it was.
If an app stores something you expect to keep, find out how it stores the data and who covers the cost of restoration. In the game example, those answers would tell you whether you can recover the record and why the fee might change when you return.
Binance Academy and Stellar Developer Docs (“State Archival”).
Information compiled with the help of AI.
The author may receive rewards from Binance.
