Architecture
Data Stores
All the data per user is stored in 2 trees called Account Tree
and State Tree
where the account tree is a global data store for all the hubble RollApp
chains while the state tree is a data store per RollApp
chain.
Account Tree 🌳
Account tree is a global data store to store public keys for users, once a public key has been added to Account tree the user never has to do a L1 deposit again to use a RollApp
chain. Index of the leaf that gets assigned to you by this tree is your AccountID
which you can use to create accounts on different RollApp
chains
State Tree 🌳
State tree is a RollApp specific data store which is used by coordinators to store state. The index in State Tree is known as StateID
and this index is used when you send transactions to point to user accounts.
State can be anything, for use cases like transfers it will be [balance, tokenID, nonce]
. Every leaf in the state tree stores the reference to AccountID
and the state represented in bytes
for a particular RollApp
chain.