github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/x/auth/spec/02_state.md (about) 1 <!-- 2 order: 2 3 --> 4 5 # State 6 7 ## Accounts 8 9 Accounts contain authentication information for a uniquely identified external user of an SDK blockchain, 10 including public key, address, and account number / sequence number for replay protection. For efficiency, 11 since account balances must also be fetched to pay fees, account structs also store the balance of a user 12 as `sdk.Coins`. 13 14 Accounts are exposed externally as an interface, and stored internally as 15 either a base account or vesting account. Module clients wishing to add more 16 account types may do so. 17 18 - `0x01 | Address -> amino(account)` 19 20 ### Account Interface 21 22 The account interface exposes methods to read and write standard account information. 23 Note that all of these methods operate on an account struct confirming to the interface 24 - in order to write the account to the store, the account keeper will need to be used. 25 26 ```go 27 type Account interface { 28 GetAddress() AccAddress 29 SetAddress(AccAddress) 30 31 GetPubKey() PubKey 32 SetPubKey(PubKey) 33 34 GetAccountNumber() uint64 35 SetAccountNumber(uint64) 36 37 GetSequence() uint64 38 SetSequence(uint64) 39 40 GetCoins() Coins 41 SetCoins(Coins) 42 } 43 ``` 44 45 #### Base Account 46 47 A base account is the simplest and most common account type, which just stores all requisite 48 fields directly in a struct. 49 50 ```go 51 type BaseAccount struct { 52 Address AccAddress 53 Coins Coins 54 PubKey PubKey 55 AccountNumber uint64 56 Sequence uint64 57 } 58 ``` 59 60 ### Vesting Account 61 62 See [Vesting](vesting.md).