Skip to content

rh050/MSTBL-Blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MSTBL - Million Stable Coin Blockchain

MSTBL Logo

🌟 Overview

MSTBL (Million Stable Coin) is a Cosmos SDK-based blockchain built with CosmWasm smart contract support. The project features a CW20 token with a fixed supply of 1.1 million MSTBL tokens.

Live Services:

  • 🌐 Website: https://mstbl.com
  • πŸ”— RPC Endpoint: https://rpc.stbl.mstbl.com
  • πŸ“‘ REST API: https://api.stbl.mstbl.com
  • πŸ’Ž Chain ID: mstbl-1

πŸ“‹ Key Features

  • βœ… Cosmos SDK 0.45.0 - Built on proven blockchain technology
  • βœ… CosmWasm 1.0.0 - Smart contract platform
  • βœ… CW20 Token - Standardized token implementation
  • βœ… Fixed Supply - 1,100,000 MSTBL (minting permanently disabled)
  • βœ… Keplr Integration - Full wallet support
  • βœ… HTTPS Endpoints - Secure APIs via Caddy reverse proxy
  • βœ… Next.js Frontend - Modern web interface on Google Cloud Run

πŸ—οΈ Project Structure

MSTBL-Blockchain/
β”œβ”€β”€ frontend/               # Next.js web application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # React components (Keplr, wallet UI)
β”‚   β”‚   β”œβ”€β”€ hooks/         # useKeplr hook for wallet integration
β”‚   β”‚   β”œβ”€β”€ pages/         # Next.js pages
β”‚   β”‚   └── types/         # TypeScript definitions
β”‚   β”œβ”€β”€ public/            # Static assets, logos, videos
β”‚   └── Dockerfile         # Container build configuration
β”œβ”€β”€ backend/               # Node.js backend services
β”œβ”€β”€ chain-registry/        # Keplr Chain Registry files
β”‚   └── mstbl/
β”‚       β”œβ”€β”€ chain.json     # Blockchain configuration
β”‚       β”œβ”€β”€ assetlist.json # Token asset definitions
β”‚       └── README.md      # Chain documentation
β”œβ”€β”€ Caddyfile             # Reverse proxy config (HTTPS, CORS)
β”œβ”€β”€ .github/              # GitHub Actions, Copilot instructions
└── cw20_base.wasm        # CW20 smart contract (deployed)

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Docker (for deployment)
  • Git

Local Development

# Clone repository
git clone https://github.com/rh050/MSTBL-Blockchain.git
cd MSTBL-Blockchain

# Frontend setup
cd frontend
npm install
npm run dev

Visit http://localhost:3000

Environment Configuration

Create frontend/.env.local:

NEXT_PUBLIC_CHAIN_ID=mstbl-1
NEXT_PUBLIC_RPC_ENDPOINT=https://rpc.stbl.mstbl.com
NEXT_PUBLIC_REST_ENDPOINT=https://api.stbl.mstbl.com
NEXT_PUBLIC_BECH32_PREFIX=wasm
NEXT_PUBLIC_COIN_DENOM=mstbl
NEXT_PUBLIC_MSTBL_CONTRACT=wasm14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s0phg4d

πŸ” Smart Contract Details

CW20 Token Contract:

Address: wasm14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s0phg4d
Total Supply: 1,100,000 MSTBL (1,100,000,000,000 ustbl)
Decimals: 6
Minting: Disabled (immutable supply)
Standard: CW20 (CosmWasm)

View on Explorer:

# Query contract info
curl https://api.stbl.mstbl.com/cosmwasm/wasm/v1/contract/wasm14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s0phg4d

🌐 Blockchain Specifications

Property Value
Chain ID mstbl-1
Bech32 Prefix wasm
Coin Type 118 (Cosmos standard)
Block Time ~6 seconds
Consensus Tendermint 0.34.0
SDK Version Cosmos SDK 0.45.0
WASM Version CosmWasm 1.0.0

Public Endpoints:

  • RPC: https://rpc.stbl.mstbl.com
  • REST: https://api.stbl.mstbl.com
  • WebSocket: wss://rpc.stbl.mstbl.com/websocket
  • gRPC: 34.57.32.80:9090

πŸ”— Wallet Integration

Keplr Wallet

MSTBL is fully integrated with Keplr Wallet:

  1. Visit https://mstbl.com
  2. Click "Connect Wallet"
  3. Approve network addition in Keplr popup
  4. Start using MSTBL tokens

Keplr Chain Registry:

  • PR Status: #1344 (Open)
  • Files: chain.json, assetlist.json, README.md

Programmatic Connection

// Using CosmJS
import { SigningStargateClient } from "@cosmjs/stargate";

const chainInfo = {
  chainId: "mstbl-1",
  chainName: "MSTBL Network",
  rpc: "https://rpc.stbl.mstbl.com",
  rest: "https://api.stbl.mstbl.com",
  // ... see chain-registry/mstbl/chain.json for full config
};

await window.keplr.experimentalSuggestChain(chainInfo);
await window.keplr.enable("mstbl-1");

πŸ“Š Tokenomics

  • Token Name: MSTBL
  • Total Supply: 1,100,000 MSTBL
  • Decimals: 6 (1 MSTBL = 1,000,000 ustbl)
  • Type: CW20 Token
  • Distribution: Fully distributed, minting disabled
  • Use Cases: Transactions, governance, staking

πŸ› οΈ Technology Stack

Blockchain Layer:

  • Cosmos SDK 0.45.0
  • Tendermint BFT Consensus 0.34.0
  • CosmWasm 1.0.0
  • CW20 Token Standard

Frontend Stack:

  • Next.js 14
  • React 18
  • TypeScript
  • Tailwind CSS
  • CosmJS / Keplr Wallet
  • i18next (Multi-language support)

Backend Services:

  • Node.js
  • Express.js
  • CosmJS Client

Infrastructure:

  • Cloud Provider: Google Cloud Platform
  • Compute: GCE e2-medium (us-central1-c)
  • Frontend Hosting: Cloud Run
  • Reverse Proxy: Caddy 2.10.2 (auto SSL)
  • DNS: Cloudflare
  • SSL Certificates: Let's Encrypt (auto-renewed)

πŸš€ Deployment

Frontend Deployment (Cloud Run)

cd frontend
gcloud run deploy mstbl-prod-v1 \
  --source . \
  --region us-central1 \
  --allow-unauthenticated

Caddy Reverse Proxy

# SSH to server
gcloud compute ssh mstbl-node1 --zone us-central1-c

# Install Caddy
sudo caddy run --config /root/Caddyfile

Caddyfile Configuration:

  • Automatic HTTPS (Let's Encrypt)
  • CORS headers for all origins
  • Path rewriting for Keplr compatibility
  • Reverse proxy to localhost services

πŸ“ Development Guide

Frontend Development

cd frontend

# Install dependencies
npm install

# Run development server
npm run dev

# Build for production
npm run build

# Deploy to Cloud Run
gcloud run deploy mstbl-prod-v1 --source .

Adding Features

  1. New Component: Add to frontend/src/components/
  2. New Page: Add to frontend/src/pages/
  3. Keplr Integration: Modify frontend/src/hooks/useKeplr.ts
  4. Translations: Update JSON files in frontend/public/locales/

Testing Keplr Integration

# Test configuration endpoint
curl https://mstbl.com/api/debug-keplr-test

# Open debug page
open https://mstbl.com/debug

πŸ”’ Security

Best Practices:

  • βœ… No private keys or mnemonics in repository
  • βœ… Environment variables for sensitive data
  • βœ… .gitignore excludes all secrets
  • βœ… HTTPS-only endpoints
  • βœ… CORS configured for security
  • βœ… Smart contract minting permanently disabled

Files Excluded from Git:

  • *.env (environment variables)
  • *private*key*.txt (private keys)
  • *mnemonic*.txt (seed phrases)
  • *-keyring/ (blockchain keyrings)
  • Build artifacts and logs

πŸ“– Documentation

🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

Apache License 2.0 - see LICENSE file for details

πŸ“§ Support & Contact

πŸ™ Acknowledgments


⭐ If you find this project useful, please consider giving it a star on GitHub!

Built with ❀️ on the Cosmos ecosystem

About

Million Stable Coin - Cosmos SDK blockchain with CW20 token

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors