MANTRA Chain
  • Introduction
    • Overview
    • What is MANTRA Chain
    • Why MANTRA Chain
    • Building on MANTRA Chain
    • MANTRA RWA Suite
  • Using MANTRA Chain
    • MANTRA Chain Wallet Setup
      • Connect to Testnet
      • Connect to Mainnet
      • Testnet Faucet
    • MANTRA Zone
    • MANTRA Bridge
      • MANTRA Bridge User Guide
      • MANTRA Bridge FAQs
    • Stake
      • Stake User Guide
      • Stake FAQs
    • MANTRA Swap
      • MANTRA Swap User Guide
      • Liquidity Pools User Guide
      • MANTRA Swap FAQs
    • Claiming Journey
      • Check If You're Eligible
      • Claiming Journey User Guide
      • I've redeemed my rewards, now what?
    • Chakra Pool
      • What can I do with my USDY
      • Chakra Pool Deposit Guide
      • How KARMA works for Chakra Pool
        • How much KARMA do I get for depositing into Chakra Pool?
        • Can I make multiple deposits and how will KARMA be calculated then?
        • My KARMA is not updated even though I make multiple deposits?
        • Will I get daily KARMA for my deposit on USDY Chakra Pool launched on Hongbai earlier?
      • Chakra Pool FAQs
    • MANTRA Zone Leaderboard
      • MANTRA Zone Leaderboard User Guide
        • Mission Guides
          • Pledge your OM 🕉️
          • Claim OM Staking Rewards
          • OMly Drip 💧
      • MANTRA Zone Leaderboard FAQs
  • Developing on MANTRA Chain
    • Getting Started
      • DuKong Testnet
      • Install Prerequisites
      • Setting Up Dev Environment
      • Compiling a Contract
      • Deployment and Interaction
    • CosmWasm Quick Start Guide
      • CosmWasm Contracts
      • Understanding CosmWasm File Structure
    • DAPP Tooling
      • Cosmos SDK
      • Important Libraries
      • Developer Resources
    • Developer FAQs
  • MANTRA Smart Contracts
    • Overview
    • MANTRA Dex
      • 🚢Deployments
      • 📚Common Types
      • 💰Fee Collector
      • ⌛Epoch Manager
      • 🌊Pool Manager
      • 🎁Farm Manager
    • 🎊Claimdrop Contract V1
    • 🎁Claimdrop Contract V2
    • Audits
  • Node & Validator Operations
    • Overview
    • Node Setup & Deployment
      • Node System Requirements
      • Running a Node
      • How to run Mantrachain with Systemd
      • Validator Nodes
        • Connect sidecar
    • Validator Architecture Recommendations
      • Secure Validator
    • Governance
      • Draft a Proposal
        • Text Proposal
        • Community Spend Proposal
        • Software Upgrade
        • Cancel Software Upgrade
      • Submitting a Proposal
      • Verifying your transaction
      • Depositing funds
      • Voting on a Proposal
    • Download nodes snapshots
  • MANTRA Chain with EVM (Alpha)
    • Getting Started on OMSTEAD Testnet
  • Setup Instructions
  • Using Foundry
    • Deployment with Foundry
  • Using Hardhat
    • Deployment with Hardhat
  • Mainnet OM Information
    • Background
    • Updated OM Tokenomics
    • OM Distribution Updates
    • Inflation & Vesting Schedule
    • Legacy tokens to mainnet staking tokens
  • Appendix
    • Frequently Asked Questions
      • General FAQs
        • What is MANTRA Chain?
        • What are the key features/ modules available to builders on MANTRA Chain?
        • What support is available for developers and validators that join the ecosystem
        • Where can i find MANTRA Social Accounts & Communities?
        • How can an Issue or a bug be reported?
        • How can I identify official MANTRA communication and websites?
      • Validator FAQs
        • What does a new validator’s journey look like?
        • What are my key responsibilities as a validator?
        • What is uptime and how is it maintained?
        • What are the hardware requirements?
        • How to get validator keys?
        • How can I connect a validator from an older testnet to the newest testnet?
        • How do I create a backup snapshot of a node?
        • How do I restore a node from a snapshot?
        • What are the different states a validator can be in?
        • How do I unjail a validator?
        • How do I edit a validator's description?
        • What is self-delegation?
        • Is there a minimum amount of OM that must be delegated to be an active validator?
      • Developer FAQs
        • What is MANTRA Chain, and how does it utilize the Cosmos ecosystem?
        • How does MANTRA Chain ensure interoperability with other blockchains in the Cosmos ecosystem?
        • What is the Cosmos ecosystem, and how does it differ from other blockchain platforms?
        • Which programming languages are commonly used for developing on the Cosmos ecosystem?
        • How do I get started with development on the Cosmos ecosystem?
        • What are Cosmos SDK and Tendermint, and how do they work together?
        • What are Cosmos zones and how do they interact?
        • How do I build and deploy smart contracts on the Cosmos ecosystem?
        • How do I interact with Cosmos chains and applications programmatically?
        • What is the best way to learn about developing for the MANTRA Chain and Cosmos ecosystem?
      • Hongbai FAQs
        • Where do I sign up for Hongbai?
        • Why do I need to provide 2 wallets during signup?
        • How can I Login?
        • What should I do if I forgot my password?
        • What can I do if i forget my registered email?
        • Where do i verify my email?
        • How to connect my Metamask wallet?
        • Is Hongbai app a testnet or live app?
        • Can I change my wallet ?
        • Error “invalid user credentials“
        • Why can i not Invest?
      • How to Guides
        • Install Keplr Wallet
        • Keplr and Ledger
        • Add DuKong Testnet to Keplr
        • Get Tokens from Faucet
        • Track activity on Leaderboard
      • More Help & Support
      • MANTRA Zone FAQs
        • MANTRA Zone General FAQs
          • What wallets are currently supported on the MANTRA Zone?
          • How do I connect my wallet to the MANTRA Zone?
          • How do I copy my connected wallet’s address?
          • How do I connect a different wallet to the MANTRA Zone?
          • Can I disconnect my wallet from MANTRA Zone?
          • How can I resolve seeing multiple entires of the same amount of testnet OM in my Keplr wallet?
          • The question that I have is not covered by the FAQ, what should I do?
        • MANTRA Bridge FAQs
          • What is MANTRA Bridge?
          • Why should I use the MANTRA Bridge?
          • Is there a fee for using the MANTRA Bridge?
          • Do I have to pay gas fees?
          • What tokens will I receive?
          • How does the migration process work?
          • How long should the MANTRA Bridge order take?
          • How can I track the status of my MANTRA Bridge order?
          • What happens to my ERC20 OM tokens once I use the MANTRA Bridge?
          • Which network can I use on the MANTRA Bridge?
          • What should I do if I see ‘Wrong network’ error on the app?
          • Will there be a two-way bridge in the future?
          • My MANTRA Bridge order is stuck on Ethereum?! How can I fix this?
          • Who can I contact for support during the migration process?
          • Which EVM chains can I bridge from?
          • Are the OM tokens I receive wrapped tokens or the native MANTRA Chain OM tokens?
          • Is the MANTRA Bridge a non-custodial solution?
          • What happens if the MANTRA Bridge is hacked or goes offline?
          • Are there any risks associated with using the MANTRA Bridge?
          • How does the MANTRA Bridge ensure the security of my tokens during migration?
          • Can I use my existing Ethereum wallet to access the MANTRA Bridge?
          • How does wallet linking and airdrop participation work?
        • Stake FAQs
          • What is Stake?
          • What are validators, and how do I choose one?
          • What rewards can I earn by staking $OM?
          • How are staking rewards calculated?
          • Can I choose to unstake my $OM coins?
          • What is the unbonding period?
          • Can I change validators after staking $OM?
          • Can I stake $OM with multiple validators?
          • Are there any risks involved with staking $OM?
          • Will my rewards gets automatically restaked after redemption?
          • Do I lose my claimable rewards when performing actions with a validator with unclaimed rewards?
          • My wallet is showing a 0 balance even though I have funds. What should I do?
          • How do I know if my $OM is staked?
        • Chakra Pool FAQs
          • What are the Chakra Pool rewards?
          • What is USDY?
          • How do I get the yield from the treasury bonds by holding USDY?
          • Can I change my linked wallet?
          • I don’t remember my linked wallet - what can I do?
          • What are the bonus rewards and where I can see my rewards?
          • How are the USDY rewards calculated and when can I redeem my USDY rewards?
          • How are the $OM rewards calculated and when can I redeem my $OM rewards?
          • How are the $ONDO rewards calculated and when can I redeem my $ONDO rewards?
          • What can I do with my USDY and $OM rewards after redemption?
        • MANTRA Zone Leaderboard FAQs
          • I have someone that wants to participate in the MANTRA Zone Leaderboard but they don’t know how.
          • What does the ⚡icon and ‘Get + x KARMA’ text under the ‘KARMA’ section refer to?
          • The KARMA on the Zone Leaderboard only lists MANTRA Chain wallets, how to check my EVM wallet rank?
          • Which wallet IDs are visible on the Leaderboard Ranking Table?
          • Why are there three different categories for the Leaderboard Ranking Table?
          • How can I get the Leaderboard Ranking Table to show where my connected wallet ranks currently?
          • How can I search where a specific wallet ID ranks in the Leaderboard Ranking Table?
          • How can I search what wallet ID currently ranks in a specific ranking number?
          • My KARMA and/or multiplier amount did not update on the Leaderboard Ranking Table, why is that?
          • What is the calculation for the KARMA?
          • I’m unable to see the OMly Faucet on my Keplr/Cosmostation wallet
          • I'm unable to see my OMly Faucet Claim transaction on the explorer
          • The question that I have is not covered by the FAQ, what should I do?
        • MANTRA Swap FAQs
          • What is Swap?
          • How can I swap?
          • I have connected my EVM wallet, but I’m still unable to swap. Why?
          • Where can I view my past transactions?
          • Why is my swap button disabled?
          • Why can’t I swap with a slippage more than 5%?
          • What is Exchange Rate?
          • How do I get OM tokens in my wallet?
          • How do I get other tokens in my wallet?
          • Will the swap fee be deducted from my sell or buy token?
          • Why can’t I see the balance of tokens in my wallet but on the Swap panel?
          • How do I add liquidity to a pool?
          • I am unable to provide liquidity to the pool.
          • While adding liquidity, why are the two tokens USD value not equal?
          • How do I withdraw my funds from Liquidity Pools?
          • Why can I not see my tokens for withdrawal?
          • Why can I not remove liquidity?
          • Why is my deposited value of the two tokens changing in my position?
          • Do liquidity pools have a bonding period?
          • What are LP tokens?
          • What can I do with my LP tokens?
          • Why can I not see any LP token balance?
          • I am connected with my MANTRA wallet, but still cannot view my positions?
          • I provided liquidity, but I can’t see my position. What should I do?
          • Why is my transaction not successful?
    • Glossary
    • MANTRA Blockchain Tech
    • MANTRA's Incentivised Testnet
      • Testnet Phase 1
      • Hongbai - Testnet Phase 2
  • Third Party Bridges
    • Base Bridge
    • Polygon Bridge
Powered by GitBook
On this page
  • Modular Design and Cosmos SDK Integration
  • Core Blockchain Components
  • MANTRA Chain Consensus Mechanism
  • Interoperability and Cross-Chain Capabilities (IBC, CosmWasm)
  • COSMWASM
  • IBC
  1. Appendix

MANTRA Blockchain Tech

Modular Design and Cosmos SDK Integration

MANTRA is architected as a modular Layer-1 blockchain, leveraging the robust and flexible Cosmos SDK. This choice of framework is fundamental to its design principles and capabilities. The inherent modularity of MANTRA's design empowers developers to extensively customize and optimize the blockchain's features, tailoring them to suit the specific requirements of a diverse range of applications.

This modularity also facilitates seamless upgrades, continuous improvements, and the effortless addition of new functional modules without causing disruptions to the network's core operations. Central to its architecture is a state-of-the-art node structure that precisely defines and manages the various states triggered by transactions, ensuring consistent and reliable network behavior.

Core Blockchain Components

As a foundational Layer-1 blockchain, MANTRA is responsible for handling the core functions essential to any blockchain network, including transaction processing, validation, and consensus. These functions are critical for ensuring the overall integrity, security, and decentralization of the network.

  • Data Layer: This component is specifically designed for the immutable storage of all transaction history and the current state of the blockchain. It maintains a comprehensive and unalterable record of all data. By distributing this data across multiple nodes, the data layer ensures the blockchain's immutability and decentralized nature, making it highly tamper-resistant.

  • Transaction Layer: This layer is where the operational work of the blockchain primarily occurs. It processes actual transactions, which include token transfers and the execution of smart contracts. The transaction layer is responsible for validating these transactions, rigorously checking for any fraudulent activity, and ensuring strict compliance with the rules established by the consensus mechanism.

  • Consensus Mechanism: MANTRA employs a Proof-of-Stake (PoS) consensus mechanism. Under this protocol, holders of the native OM token can stake their tokens to participate in the validation of transactions and contribute to the overall security of the network, earning rewards in return.

MANTRA Chain Consensus Mechanism

MANTRA Chain, built on the Cosmos SDK, leverages a robust and efficient consensus mechanism, primarily Tendermint Core, which has been rebranded to CometBFT. This consensus engine, combined with the modular nature of the Cosmos SDK and its Proof-of-Stake (PoS) design, provides a secure and highly customizable foundation for application-specific blockchains.

Consensus Mechanism: CometBFT (formerly Tendermint Core)

CometBFT is a Byzantine Fault Tolerant (BFT) consensus algorithm that provides instant finality and high throughput. It is a core component of any blockchain built with the Cosmos SDK, separating the networking and consensus layers from the application layer via the Application Blockchain Interface (ABCI). This modularity allows developers to build their blockchain's application logic in any programming language while relying on CometBFT for secure and consistent state replication.

How CometBFT Works (The Consensus Process):

The consensus process in CometBFT operates in rounds, with each round aiming to commit a new block. It involves a set of validators, chosen based on their bonded stake (Proof-of-Stake). The process consists of three main steps:

  1. Propose:

    • A validator, selected as the "proposer" for the current round (often in a round-robin fashion weighted by stake), creates a new block containing a batch of validated transactions.

    • The proposer broadcasts this block proposal to all other validators in the network.

  2. Pre-vote:

    • Upon receiving a block proposal, each validator validates its correctness (e.g., transaction signatures, balances, order).

    • If the block is valid, validators cast a "prevote" for that block. If they don't receive a valid proposal or a timeout occurs, they may prevote "nil."

    • Validators then broadcast their prevotes to the network.

  3. Pre-commit:

    • Each validator waits to receive a "polka" (Proof-of-Lock-Change), which signifies that over two-thirds (2/3+) of the total voting power has "prevoted" for the same block in the current round.

    • Once a validator observes a polka, they "pre-commit" to that block. This is a stronger signal of agreement.

    • If 2/3+ of the total voting power pre-commits to the same block, that block is officially committed and added to the blockchain. This provides instant finality, meaning once a block is committed, it is irreversible.

    • If consensus is not reached (e.g., proposer is offline, network latency, insufficient votes), the round times out, and a new round begins with a new proposer.

Key Properties of CometBFT:

  • Byzantine Fault Tolerance (BFT): CometBFT can tolerate up to one-third (1/3) of the validators being malicious or faulty (e.g., going offline, double-signing, attempting to fork the chain) while still guaranteeing safety (no conflicting blocks are committed) and liveness (the chain continues to make progress).

  • Instant Finality: Once a block is committed, it is final and cannot be reverted without 1/3+ of the stake committing an explicit and detectable double-spend attack. This contrasts with probabilistic finality in Proof-of-Work chains (like Bitcoin), where confirmations provide increasing certainty but not absolute finality.

  • High Performance: The synchronous, round-based nature allows for high transaction throughput and low latency, typically committing blocks in a few seconds.

  • Modularity: The ABCI separates the consensus engine from the application layer, allowing developers to focus on application logic without reinventing the wheel for consensus and networking.

Security Features of Cosmos SDK Blockchains

The security of a Cosmos SDK-based blockchain is multifaceted, relying on CometBFT's BFT properties, the Proof-of-Stake mechanism, and specific modules designed to enforce network integrity.

  1. Byzantine Fault Tolerance (inherent to CometBFT):

    • Safety: Ensures that all honest validators agree on the same sequence of blocks and that a block, once committed, will never be reverted. This prevents double-spending within the chain.

    • Liveness: Guarantees that as long as more than 2/3 of the voting power is honest and online, new blocks will continue to be produced, even if some validators are malicious or offline.

  2. Proof-of-Stake (PoS) Security Model:

    • Validators: Network security relies on a set of elected validators who bond (stake) their native tokens as collateral. Validators are responsible for proposing and validating blocks.

    • Delegators: Token holders who do not wish to run a validator node can "delegate" their tokens to existing validators, thereby contributing to the validator's voting power and sharing in their rewards (and risks).

    • Economic Security: The significant value locked in staked tokens creates an economic disincentive for malicious behavior. Any validator attempting to act maliciously risks losing a portion or all of their staked tokens.

  3. Slashing Mechanisms (x/slashing module):

    • Punishment for Misbehavior: The Cosmos SDK includes a robust slashing module (x/slashing) that automatically penalizes validators for specific attributable faults. These faults typically fall into two categories:

      • Downtime/Liveness Faults: If a validator is offline or fails to participate in consensus for a specified period (e.g., missing a certain percentage of blocks in a window), they can be temporarily "jailed" (removed from the active validator set) and/or have a small percentage of their stake slashed.

      • Double-Signing: This is a severe offense where a validator cryptographically signs two conflicting blocks at the same height (attempting to fork the chain). This results in a much larger slash (e.g., 2% or more of their stake) and permanent removal ("tombstoning") from the validator set, meaning they cannot rejoin.

    • Proportional Slashing: Some Cosmos chains implement proportional slashing, where the slash amount increases with the collective voting power involved in a coordinated attack, disincentivizing large validators from acting maliciously or centralizing power.

    • Delegator Risk: Delegators also bear the risk; if the validator they've delegated to is slashed, a proportional amount of their delegated stake is also slashed. This incentivizes delegators to choose reliable and honest validators and monitor their performance.

In summary, Cosmos SDK blockchains leverage CometBFT's proven BFT consensus for fast, final, and secure block production, complemented by a robust Proof-of-Stake model with economic incentives and slashing penalties to maintain validator integrity and network security. The modular framework further enhances security by providing customizable, auditable components for application-specific needs.

Interoperability and Cross-Chain Capabilities (IBC, CosmWasm)

COSMWASM

CosmWasm is a smart contract platform specifically designed for the Cosmos ecosystem. It's often described as the "Cosmos way of using WebAssembly (Wasm)," hence the name. Here's a deeper dive into what makes CosmWasm significant:

1. WebAssembly (Wasm) as the Foundation:

  • What is Wasm? Wasm is a low-level bytecode format designed for high performance, portability, and security. It's a compile target for many programming languages, making it suitable for running code efficiently in various environments.

  • Why Wasm for Smart Contracts? Wasm offers several advantages for smart contracts:

    • Performance: Wasm is designed for near-native execution speed, crucial for blockchain performance.

    • Security (Sandboxing): Wasm provides a secure, isolated environment (sandbox) where smart contracts can execute without affecting the underlying blockchain system. This significantly reduces the risk of common vulnerabilities like reentrancy attacks.

    • Portability: Wasm is highly portable, meaning code compiled to Wasm can run on different systems consistently.

    • Language Agnostic (Mostly Rust): While Wasm supports multiple languages, Rust is the primary and most encouraged language for CosmWasm smart contract development. Rust's focus on memory safety and concurrency makes it an excellent choice for secure and performant blockchain applications.

2. Integration with Cosmos SDK:

  • Module-Based Design: CosmWasm is implemented as a module that plugs directly into the Cosmos SDK. This is a key differentiator. Any blockchain built using the Cosmos SDK can easily add CosmWasm smart contract functionality without needing to rewrite existing logic or significantly alter its architecture. This fosters rapid adoption within the Cosmos ecosystem.

  • Interoperability (IBC): CosmWasm is built with the Inter-Blockchain Communication (IBC) protocol in mind. This allows CosmWasm smart contracts on one Cosmos chain to securely and reliably communicate with contracts and modules on other Cosmos chains. This is fundamental to building a truly interconnected multi-chain ecosystem.

3. Key Features and Advantages:

  • Security Focus: CosmWasm emphasizes security from the ground up. It aims to mitigate many attack vectors common in other smart contract platforms (like Solidity on Ethereum), such as reentrancy attacks, by design and through the use of Rust's safety features.

  • Developer Experience:

    • Rust Tooling: Leverages Rust's robust tooling, including a powerful compiler, comprehensive testing frameworks (unit, integration, and full-stack tests), and a rich ecosystem of libraries.

    • Standard Library (cosmwasm-std): Provides a well-defined standard library (cosmwasm-std) with essential utilities and types for building secure and efficient smart contracts, including helpers for interacting with storage, handling messages, and performing queries.

    • Entry Points: Smart contracts define specific "entry points" (like instantiate, execute, query, migrate) that correspond to different types of interactions, making the contract's API clear and structured.

  • Performance: Designed for high transaction throughput, capable of processing hundreds of transactions per second. This is enhanced by the ability to deploy contracts across multiple interconnected Cosmos chains, distributing the load and keeping costs low.

  • Composability: Enables the creation of complex and interconnected smart contracts, similar to the "DeFi legos" concept in Ethereum, but with added architectural support for enhanced safety and security.

  • Flexibility and Migration: Projects can easily migrate from one CosmWasm-enabled blockchain to another, or even launch their own sovereign CosmWasm zone (a dedicated blockchain with CosmWasm contracts) while maintaining IBC connectivity. This provides significant flexibility for scaling and evolving dApps.

  • On-Chain Transparency: Each smart contract instance has a unique address and can act like any other account on the chain, making its state and interactions transparent.

4. How it Works (Simplified):

  1. Develop in Rust: Developers write their smart contract logic in Rust.

  2. Compile to Wasm: The Rust code is compiled into WebAssembly (Wasm) bytecode.

  3. Upload to Blockchain: The Wasm bytecode is then uploaded to a CosmWasm-enabled Cosmos SDK blockchain.

  4. Instantiate: A contract can be "instantiated" (deployed) on the chain, which gives it a unique address and sets its initial state.

  5. Execute: Users can send "execute" messages to the contract to trigger actions that modify its state (e.g., transfer tokens, update data).

  6. Query: Users can send "query" messages to the contract to retrieve information from its state without modifying it.

  7. WasmVM Execution: The x/wasm module in the Cosmos SDK utilizes a Wasm virtual machine (like Wasmer) to execute the smart contract bytecode in a secure, sandboxed environment. Gas metering ensures fair resource consumption.

In essence, CosmWasm provides a robust, secure, and highly performant platform for building decentralized applications within the interconnected Cosmos ecosystem, leveraging the power and safety of Rust and WebAssembly.

IBC

MANTRA supports Inter-Blockchain Communication (IBC), a critical protocol that enables seamless cross-chain interoperability. This functionality allows tokenized assets residing on MANTRA Chain to interact effortlessly with other blockchain networks, significantly reducing liquidity fragmentation and expanding the utility and use cases of digital assets across disparate ecosystems.

Beyond IBC, the native OM token itself is designed to operate on multiple prominent blockchains, including Ethereum, Binance Smart Chain (BSC), and Polygon. This multi-chain presence further enhances MANTRA's interoperability and broadens its reach within the wider decentralized finance (DeFi) ecosystem.

PreviousGlossaryNextMANTRA's Incentivised Testnet

Last updated 1 day ago