For cryptocurrencies, storage might consist of a mapping between account keys and corresponding balances.
More generally, blockchains provide an interface to store and interact with data in a verifiable and globally irreversible way. In this context, data is stored in a series of snapshots, each of which may be accessed at a later point in time, but, once created, snapshots are considered irreversible.
The previous single-value storage recipe showed how a single value can be stored in runtime storage. In this section, we cover
- caching values rather than calling to storage multiple times
- storing sets, checking membership, and iteration
- efficient subgroup removal by key prefix with double maps
- storing custom structs