Replies: 1 comment 5 replies
-
Having the account and storage types as part of the account ID would imply that this can not be changed after an account is created. Wouldn't it be better to have these defined externally? The storage format could be implicitly defined, i.e. if there is no on-chain data for the given account, it is by definition off-chain. The faucet could be implicitly define by the account's code. I think immutability is different and should be part of the account ID. Also, IIUC state prunning is possible for the account and note DBs, so IMO the account ID is not a good fit to determine the account storage type. Question: If we do have account prunning, what is the incentive for an operator to keep the state around? Will there be a fee model to incentivize keeping account's state on-chain? IOW, what determines when an account is removed from on-chain? Idea: An user could generate a few notes in advance, each claimable after a given block in the future, and only by the block's operator. And to consume the note the operator would have to provide a proof of state. (I haven't thought about how to implement this, just dropping the idea on how to pay fees to maintain an account on-chain). Observations: 1. If we do have state pruning, it is very important to have a mechanism to backup an account's state 2. Also, I would say full on-chain state is a special case of stateless state. |
Beta Was this translation helpful? Give feedback.
-
Just as for notes, we need to define how accounts are going to be recorded on chain. With accounts we have two cases:
Full state of an account consists of the following components:
Similar to the the approach taken with notes, we can use account ID itself to specify whether just the hash, or the full state should be recorded on chain. This is already discussed in #13, but to be more specific, we need account IDs to contain the following info:
00
- regular account with updatable code.01
- regular account with immutable code.10
- fungible faucet, the code is immutable.11
- no-fungible faucet, the code is immutable.0
- full details are stored on chain.1
- only account hash is stored on chain.Thus, we can use 3 most significant bits of the account ID to encode all relevant info. One question is whether these should be most or least significant bits. For example, most significant bits define the path in the account DB tree - so, there might be some implications to how the accounts will be distributed in the SMT - but ultimately, it probably doesn't matter too much.
With 3 bits taken up by meaningful info, we still have 61 bits for the actual account ID, which I think should be plenty.
Beta Was this translation helpful? Give feedback.
All reactions