# Account

# What is Account?

Account structure is used to hold the balance and sequence number of an account.

# Account Structure

The format of the account is as seen below:

type Account struct {
   Address  Address `cbor:"1,keyasint"`
   Number   int     `cbor:"2,keyasint"`
   Sequence int     `cbor:"3,keyasint"`
   Balance  int64   `cbor:"4,keyasint"`
}
  • Address is the address of account which is 20 bytes in length
  • Number is a unique and sequential number for the account
  • Sequence increasers anytime user send a transactions to prevent replaying the transaction
  • Balance holds the balance of the account

# Example

Hers is an example of a account data:

000000   A4 01 54 43 6D 9A 52 FD  0E 4C 60 CA 8D D8 9F 75   ¤.TCm.Rý.L`Ê.Ø.u
000010   10 58 CF F4 0E DE E0 02  01 03 00 04 1A 1D CD 65   .XÏô.Þà.......Íe
000020   00                                                .

Which can be interpreted in CBOR (opens new window) format:

{
  1: h'436D9A52FD0E4C60CA8DD89F751058CFF40EDEE0',
  2: 1,
  3: 0,
  4: 500000000
}

Account Hash is the hash of the account in binary format. For this example the account hash is:

0x8b66cb22841238f424835e6e7313cff870dfe9b851e958eb5b3bf842acc20e1d