Account Model

1Money implements an Account Model (vs UTXO) for its ledger, where, aside from asset positions, also contains properties governing different issuance functions. Account types include:

Account Types

StateAccount

StateAccount represents a standard user account that can participate in regular transactions.

Key Properties:

  • Nonce: A counter that increments with each transaction to prevent replay attacks

Use Cases:

  • Serving as the base account type for users to manage their token holdings


MintAccount

Mint accounts are specialized accounts that control the creation and management of tokens in the system. They represent the authority over a specific token type.

Key Properties:

  • Nonce: A counter for transaction sequencing

  • Token metadata and configuration

  • Authority information

Use Cases:

  • Creating new tokens

  • Minting additional token supply

  • Managing token authorities

  • Updating token metadata

  • Pausing/unpausing token transfers


TokenAccount

TokenAccount represents an account that holds a specific token type. It tracks the ownership and balance of tokens for a particular user.

Key Properties:

  • Mint: Address of the mint that issued this token

  • Amount: The token balance

  • Owner: Address of the account that owns these tokens

Use Cases:

  • Holding token balances

  • Transferring tokens between users

  • Tracking token ownership


Sample code of Typescript how to derive token account from state account and mint account

Sample code of Go how to derive token account from state account and mint account

Last updated