LogoLogo
  • Technical Architecture
  • LagomChain CLI
    • Configuration
    • Working With Docker
    • Single Node
    • Multi Node
    • Alternative Databases
    • CLI Commands
    • Drafting a proposal
  • Concepts
    • Accounts
    • EIP-155: Replay Protection
    • Chain ID
    • Encoding
    • Gas and Fees
    • IBC Relayers
    • Key Management
    • Keyring
    • State Export/Imort
    • Multisig
    • Pending State
    • Signing
    • Token
    • Transactions
  • Modules
    • epochs
    • erc20
    • evm
    • feemarket
    • inflation
    • vesting
  • Module Accounts
  • Bugs
  • IBC Channels
  • Security Overview
    • Audits
    • Simple Arrangement for Funding Upload (SAFU)
  • Metrics
  • Frequently Asked Questions
Powered by GitBook
On this page
  • Module Accounts & Permissions
  • IBC Module Accounts in LagomChain

Module Accounts

Certain LagomChain modules have dedicated module accounts, which act as wallets controlled exclusively by their respective modules. These accounts are used to manage minting, burning, staking, and IBC transfers.


Module Accounts & Permissions

Each module account has specific permissions that define what operations it can perform.

Types of Permissions

  • Burner – Can burn (destroy) tokens.

  • Minter – Can mint (create) new tokens.

  • Staking – Can stake tokens on behalf of users.

These permissions ensure that only authorized modules execute key token-related operations, preventing unauthorized minting or burning.


IBC Module Accounts in LagomChain

In addition to standard module accounts, IBC transfers use specialized module accounts to escrow tokens when LagomChain is the source chain of a transfer.

How IBC Escrow Accounts Work

  1. When an IBC transfer is initiated, the tokens are escrowed into a module account.

  2. Each IBC connection has a unique escrow account, derived using SHA256 hashing.

  3. The account format follows ADR 028, using the first 20 bytes of the SHA256 hash of the account name.

Example: Generating an IBC Escrow Address

// The account name is composed of the IBC version, portID, and channelID
accountName := Version + "\0" + portID + "/" + channelID
addr := sha256.Sum256(accountName)[:20]

// Example for channel-0
addr := sha256.Sum256("ics20-1\0transfer/channel-0")[:20]

Note: These IBC escrow accounts do not appear in standard queries using:

lagomd q auth module-accounts

This is because module accounts are pre-defined at compile time, and dynamically generated IBC accounts are not included in the AccountKeeper's address map.

PreviousvestingNextBugs

Last updated 3 months ago