# Welcome to KiiChain Builder Guide 🚀

By [dropper7](https://paragraph.com/@dropper7) · 2026-01-01

kiichain, crypto

---

Introduction
============

Hey builders! KiiChain is a Cosmos SDK-based L1 appchain with full EVM compatibility, IBC interoperability, and lightning-fast finality—perfectly tailored for real-world finance in emerging markets. We're talking on-chain FX swaps for local stablecoins, compliant RWA tokenization, programmable payments (PayFi), and credit/lending (CrediFi) on tokenized assets.

Why build here?

*   **Massive opportunity**: Bring DeFi to billions in Latin America, Africa, and Asia with tools for remittances, micro-lending, and asset-backed finance.
    
*   **Developer-friendly**: Deploy Solidity contracts **or** CosmWasm, use familiar tools like Hardhat or Rust, and leverage pre-built modules.
    
*   **Testnet ready**: Oro Testnet is live—faucet up and start building today!
    
*   **Community perks**: Grants, hackathons, and showcases for top projects
    

Links to get started:

*   Docs: https://docs.kiiglobal.io/docs
    
*   GitHub: https://github.com/KiiChain
    
*   Testnet: http://kiichain.io/testnet
    
*   RWA Protocol: https://github.com/KiiChain/Kii-RWA-Protocol
    

Below are practical, step-by-step guides with code examples for the core modules. Let's attract more builders by making this ecosystem explode!

1\. Quickstart: Set Up Your Dev Environment & Connect to Testnet
----------------------------------------------------------------

### Prerequisites

*   Node.js (for EVM/Hardhat)
    
*   Rust + Cargo (for CosmWasm)
    
*   Wallet: Keplr (for Cosmos) or MetaMask (for EVM)
    

### Steps

1.  Add KiiChain to Keplr/MetaMask via chain-registry repos.
    
2.  Get test tokens from the Oro Testnet faucet.
    
3.  For EVM dev: Install Hardhat.
    
        npm init -y
        npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
        npx hardhat
        
    
4.  Configure `hardhat.config.js` with KiiChain RPC (check docs for latest endpoints).
    

Now you're ready to deploy!

2\. Stablecoins on KiiChain: Issue & Swap
-----------------------------------------

Stablecoins are the backbone—peg to fiat reserves and enable FX.

### Example: Deploy a Basic ERC20 Stablecoin (EVM/Solidity)

Use Hardhat to deploy a mintable stablecoin.

    // contracts/LocalStable.sol
    pragma solidity ^0.8.0;
    
    import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
    import "@openzeppelin/contracts/access/Ownable.sol";
    
    contract LocalStable is ERC20, Ownable {
        constructor(string memory name, string memory symbol) ERC20(name, symbol) {}
    
        function mint(address to, uint256 amount) public onlyOwner {
            _mint(to, amount);
        }
    
        function burn(uint256 amount) public {
            _burn(msg.sender, amount);
        }
    }
    

Deploy script (`scripts/deploy.js`):

    async function main() {
      const Stable = await ethers.getContractFactory("LocalStable");
      const stable = await Stable.deploy("Colombian Peso Stable", "COPM");
      await stable.waitForDeployment();
      console.log("Deployed to:", await stable.getAddress());
    }
    main();
    

### FX Swaps: Integrate On-Chain/Hybrid FX

Use Kii's FX layer for cross-stable swaps (e.g., USDT → COPM). For production, integrate the hybrid API (quickstart in docs).

Simple frontend swap simulation (React + viem):

    import { createPublicClient, http } from 'viem';
    import { kiichain } from 'viem/chains'; // Add custom chain
    
    const client = createPublicClient({
      chain: kiichain,
      transport: http('https://testnet-rpc.kiichain.io'),
    });
    
    // Fetch quote (pseudo – use actual FX module endpoints)
    async function getQuote(from: string, to: string, amount: bigint) {
      // Call FX module or API
      return { rate: 4000, slippage: '0.5%' }; // Example COPM per USDT
    }
    

**Use Case**: Build a remittance dApp swapping USD stables to local ones instantly.

3\. RWA Module: Tokenize Real-World Assets Compliantly
------------------------------------------------------

Use the Kii-RWA-Protocol (T-REX standard via CosmWasm) for regulated tokens (e.g., real estate fractions).

### Steps to Tokenize an RWA

1.  Install CosmWasm tools:
    
        rustup update
        cargo install cargo-generate
        
    
2.  Generate contract from template (use repo examples).
    
3.  Key features: ONCHAINID for KYC, modular compliance (country blocks, accreditation claims).
    

### Example Flow (From Repo)

*   Deploy T-REX token suite via Factory.
    
*   Register identities and claims.
    
*   Transfer only if compliant.
    

Pseudo CosmWasm execute msg:

    #[entry_point]
    pub fn execute(
        deps: DepsMut,
        _env: Env,
        info: MessageInfo,
        msg: ExecuteMsg,
    ) -> Result<Response, ContractError> {
        match msg {
            ExecuteMsg::Transfer { recipient, amount } => {
                // Compliance check via ONCHAINID + modules
                ensure_compliant(deps, &info.sender, &recipient)?;
                cw20_transfer(deps, info.sender, recipient, amount)
            }
            // ...
        }
    }
    

**Use Case**: Tokenize Colombian real estate—fractional ownership for retail investors, with built-in KYC.

4\. CrediFi: Build Lending on RWAs
----------------------------------

CrediFi enables collateralized loans using RWA tokens.

### Example: Simple Lending Pool (Solidity)

Deposit RWA as collateral, borrow stablecoins.

    // contracts/CrediFiPool.sol
    pragma solidity ^0.8.0;
    
    import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
    
    contract CrediFiPool {
        IERC20 public collateralToken; // e.g., RWA token
        IERC20 public borrowToken;     // e.g., USDT
        mapping(address => uint) public collateral;
        mapping(address => uint) public borrows;
        uint public ltv = 70; // 70% Loan-to-Value
    
        constructor(address _collateral, address _borrow) {
            collateralToken = IERC20(_collateral);
            borrowToken = IERC20(_borrow);
        }
    
        function depositCollateral(uint amount) external {
            collateralToken.transferFrom(msg.sender, address(this), amount);
            collateral[msg.sender] += amount;
        }
    
        function borrow(uint collateralAmount, uint borrowAmount) external {
            require(borrowAmount <= (collateral[msg.sender] * ltv) / 100, "Exceeds LTV");
            borrows[msg.sender] += borrowAmount;
            borrowToken.transfer(msg.sender, borrowAmount);
        }
    
        // Add oracle for valuation + liquidation logic
    }
    

**Use Case**: Micro-loans in emerging markets—collateralize tokenized invoices or crops.

5\. PayFi: Programmable Payments
--------------------------------

PayFi for streaming salaries, subscriptions, or pay-per-use.

### Example: Streaming Payment Contract (Solidity)

    contract PayFiStream {
        uint public ratePerSecond;
        uint public startTime;
        address public recipient;
    
        function startStream(uint _ratePerSecond, address _recipient) external payable {
            ratePerSecond = _ratePerSecond;
            startTime = block.timestamp;
            recipient = _recipient;
        }
    
        function withdraw() external {
            uint elapsed = block.timestamp - startTime;
            uint owed = elapsed * ratePerSecond;
            payable(recipient).transfer(owed);
        }
    }
    

**Use Case**: Payroll in local stables—stream wages to workers in real-time, gas-optimized.

Next Steps to Grow the Ecosystem
--------------------------------

*   Fork repos and build demos!
    
*   Share your projects on X with @KiiChainio.
    
*   Propose bounties or tutorials.
    
*   Join Discord/Telegram for support.
    

What do you want to build next? Drop ideas—let's make KiiChain the go-to for emerging market DeFi! 🌍💸

---

*Originally published on [dropper7](https://paragraph.com/@dropper7/kiichain-builder-guide)*
