Skip to content

selendra/selendra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,023 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Selendra

License Substrate Rust EVM Compatible

A high-performance, EVM-compatible blockchain built with Substrate

Website β€’ Documentation β€’ Discord β€’ Telegram


πŸš€ Overview

Selendra is a next-generation Layer 1 blockchain that combines the best of Ethereum compatibility with Substrate's flexibility and performance. Built on Cardinal Cryptography's AlephBFT consensus, Selendra delivers sub-second finality, low transaction costs, and enterprise-grade reliability.

Key Features

  • ⚑ Blazing Fast: Sub-second finality with Aura block production + AlephBFT consensus
  • πŸ”— EVM Compatible: Full Ethereum compatibility via Frontier - deploy Solidity contracts seamlessly
  • πŸ” Unified Accounts: Native ↔ EVM account mapping for superior user experience
  • πŸ’° Low Fees: Optimized transaction costs with dynamic EVM base fee adjustment
  • 🎯 Enterprise Ready: Advanced staking, governance tools, and institutional features
  • πŸ› οΈ Developer Friendly: Substrate pallets + EVM smart contracts in one platform

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Selendra Network                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Consensus Layer                                    β”‚
β”‚  β”œβ”€ Aura (Block Production, 1s slots)               β”‚
β”‚  └─ AlephBFT (Byzantine Fault Tolerant Finality)    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Execution Environments                             β”‚
β”‚  β”œβ”€ EVM (Ethereum Virtual Machine via Frontier)     β”‚
β”‚  β”œβ”€ WASM (WebAssembly Contracts via pallet-contracts)β”‚
β”‚  └─ Native Pallets (Substrate Runtime Logic)        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Core Pallets (30 Total)                            β”‚
β”‚  β”œβ”€ Staking & Governance (DPoS, Treasury, Council)  β”‚
β”‚  β”œβ”€ EVM Integration (Ethereum, Dynamic Fees)        β”‚
β”‚  β”œβ”€ Unified Accounts (Native ↔ EVM Mapping)         β”‚
β”‚  └─ Utilities (Multisig, Proxy, Identity, Vesting)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Network Specifications

Property Value
Chain ID 1961 (Mainnet)
Block Time ~1 second
Finality Sub-second (AlephBFT)
EVM Gas Limit ~15M gas/block
Runtime Version v20004 (v3.0)
Native Token SEL
Decimals 18
Consensus Aura + AlephBFT

πŸ“¦ Repository Structure

selendra/
β”œβ”€β”€ bin/                        # Executables
β”‚   β”œβ”€β”€ node/                   # Selendra node implementation
β”‚   β”œβ”€β”€ runtime/                # Selendra runtime (WASM + native)
β”‚   β”œβ”€β”€ chain-bootstrapper/     # Network bootstrapping tool
β”‚   └── client-runtime-api/     # Client-side runtime APIs
β”œβ”€β”€ pallets/                    # Custom Substrate pallets
β”‚   β”œβ”€β”€ aleph/                  # AlephBFT integration
β”‚   β”œβ”€β”€ elections/              # DPoS validator elections
β”‚   β”œβ”€β”€ committee-management/   # Validator committee management
β”‚   β”œβ”€β”€ operations/             # Administrative operations
β”‚   β”œβ”€β”€ dynamic-evm-base-fee/   # EVM fee adjustment
β”‚   └── unified-accounts/       # Native ↔ EVM account mapping
β”œβ”€β”€ crate/                      # Supporting libraries
β”‚   β”œβ”€β”€ finality-aleph/         # AlephBFT finality gadget
β”‚   β”œβ”€β”€ aggregator/             # Signature aggregation
β”‚   β”œβ”€β”€ clique/                 # Peer discovery
β”‚   └── rate-limiter/           # Network rate limiting
β”œβ”€β”€ primitives/                 # Core primitive types
β”œβ”€β”€ scripts/                    # Deployment & utility scripts
└── vendors/                    # Vendored dependencies
    β”œβ”€β”€ selendra-client/        # Rust client library (v3.16.0)
    β”œβ”€β”€ frontier/               # Ethereum compatibility (submodule)
    └── bind_account/           # Account binding utilities

πŸ—οΈ Building from Source

Prerequisites

  • Rust: 1.75.0 or later (see rust-toolchain.toml)
  • OS: Linux (recommended), macOS, or WSL2 on Windows
  • Memory: 8GB RAM minimum, 16GB recommended
  • Disk: 50GB+ free space

Installation

  1. Install Rust & Dependencies

    # Install Rust (if not already installed)
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
    # Install build dependencies (Ubuntu/Debian)
    sudo apt update
    sudo apt install -y build-essential git clang curl libssl-dev llvm libudev-dev protobuf-compiler
    
    # Install build dependencies (macOS)
    brew install openssl cmake protobuf
  2. Clone the Repository

    git clone https://github.com/selendra/selendra.git
    cd selendra
    
    # Initialize submodules (Frontier, etc.)
    git submodule update --init --recursive
  3. Build the Node

    # Development build (faster compilation)
    cargo build --release
    
    # Production build (optimized for performance)
    cargo build --profile production

    The compiled binary will be at target/release/selendra-node (or target/production/selendra-node)


πŸš€ Running a Node

Development Node (Single Node Testnet)

# Run a local development chain
./target/release/selendra-node \
  --dev \
  --tmp \
  --rpc-cors=all \
  --rpc-methods=unsafe

Access the node:

  • RPC Endpoint: http://localhost:9944
  • Ethereum RPC: http://localhost:9933 (Web3/Metamask compatible)

Mainnet Node

# Sync with Selendra mainnet
./target/release/selendra-node \
  --chain=mainnet \
  --pruning=archive \
  --rpc-cors=all \
  --rpc-external \
  --ws-external \
  --rpc-methods=safe \
  --name="MySelendraNode"

Validator Node

# Run a validator (requires staking)
./target/release/selendra-node \
  --chain=mainnet \
  --validator \
  --name="MyValidator" \
  --rpc-methods=safe \
  --prometheus-external

For detailed validator setup, see Validator Guide


πŸ”Œ Connecting to Selendra

Metamask Configuration

Add Selendra to Metamask:

  • Network Name: Selendra Mainnet
  • RPC URL: https://rpc.selendra.org
  • Chain ID: 1961
  • Currency Symbol: SEL
  • Block Explorer: https://scan.selendra.org

Polkadot.js Apps

Connect via Polkadot.js Apps:

  • Custom Endpoint: wss://rpc.selendra.org

Using TypeScript/JavaScript

// Coming soon: @selendra/sdk
// For now, use @polkadot/api or web3.js

// Option 1: Polkadot.js API (for Substrate calls)
import { ApiPromise, WsProvider } from '@polkadot/api';

const provider = new WsProvider('wss://rpc.selendra.org');
const api = await ApiPromise.create({ provider });

// Query balance
const balance = await api.query.system.account('ACCOUNT_ADDRESS');
console.log('Balance:', balance.data.free.toHuman());

// Option 2: Web3.js (for EVM calls)
import Web3 from 'web3';

const web3 = new Web3('https://rpc.selendra.org');
const balance = await web3.eth.getBalance('0xEVM_ADDRESS');
console.log('Balance:', web3.utils.fromWei(balance, 'ether'), 'SEL');

πŸ› οΈ Development

Smart Contract Deployment

Solidity (EVM)

  1. Using Hardhat

    // hardhat.config.js
    module.exports = {
      networks: {
        selendra: {
          url: 'https://rpc.selendra.org',
          chainId: 1961,
          accounts: [process.env.PRIVATE_KEY]
        }
      },
      solidity: "0.8.20"
    };
    npx hardhat deploy --network selendra
  2. Using Remix IDE

    • Set Metamask to Selendra network
    • Compile contract in Remix
    • Deploy via "Injected Provider - Metamask"

ink! (WASM)

# Install cargo-contract
cargo install cargo-contract

# Create new contract
cargo contract new my_contract
cd my_contract

# Build contract
cargo contract build

# Deploy via Polkadot.js Apps
# 1. Upload WASM & metadata.json
# 2. Instantiate contract

Runtime Development

Modify or add pallets in pallets/:

# Create a new pallet
cargo new --lib pallets/my-pallet

# Add to workspace in Cargo.toml
# [workspace]
# members = [
#   ...
#   "pallets/my-pallet"
# ]

# Include in runtime (bin/runtime/src/lib.rs)
construct_runtime!(
    pub struct Runtime {
        ...
        MyPallet: pallet_my_pallet,
    }
);

Testing

# Run all tests
cargo test --workspace

# Run specific pallet tests
cargo test -p pallet-elections

# Run runtime tests
cargo test -p selendra-runtime

# Run with output
cargo test -- --nocapture

🌐 EVM Precompiles

Selendra provides custom precompiles for accessing Substrate functionality from EVM:

Address Function Description
0x0000...0001 ECRecover Ethereum signature recovery
0x0000...0002 SHA256 SHA-256 hashing
0x0000...0003 RIPEMD160 RIPEMD-160 hashing
0x0000...0004 Identity Data copy
0x0000...0005 ModExp Modular exponentiation
0x0000...0400 SHA3FIPS256 SHA3-256 (FIPS)
0x0000...0401 ECRecoverPublicKey Public key recovery

Coming Soon:

  • 0x0402 - Oracle Price Feeds
  • 0x0403 - Staking Interface
  • 0x0404 - Governance Interface
  • 0x0405 - Unified Accounts

πŸ“Š Runtime Pallets

Core System Pallets

  • System - Core blockchain functionality
  • Aura - Block production (Authority Round)
  • Aleph - AlephBFT finality consensus
  • Timestamp - Block timestamps
  • Balances - Native token management
  • TransactionPayment - Fee handling
  • Scheduler - Delayed/scheduled calls

Staking & Governance

  • Staking - Proof-of-Stake validation
  • Elections - DPoS validator elections
  • CommitteeManagement - Validator committee
  • Session - Session management
  • History - Historical session data
  • Treasury - Community fund management (Council-approved)
  • NominationPools - Liquid staking pools
  • Council - Community governance collective (13 members)
  • TechnicalCommittee - Technical governance collective (7 members)
  • Democracy - Public referendums and proposals
  • CouncilElections - Phragmen-based council elections
  • Preimage - Proposal preimage storage

EVM Integration

  • Ethereum - Ethereum compatibility layer
  • EVM - EVM execution environment
  • DynamicEvmBaseFee - Dynamic EVM fee adjustment
  • UnifiedAccounts - Native ↔ EVM account mapping

Smart Contracts

  • Contracts - WASM smart contracts (ink!)

Utilities

  • Utility - Batch calls, multi-operations
  • Multisig - Multi-signature accounts
  • Proxy - Proxy accounts & delegation
  • Identity - On-chain identity
  • Vesting - Token vesting schedules

Administrative

  • Operations - Admin operations
  • Sudo - Superuser access (transition period, to be removed post-governance maturity)
  • SafeMode - Emergency chain halt
  • TxPause - Transaction filtering

πŸ—ΊοΈ Roadmap

History

  • 2019: Project started
  • 2020: First testnet launched
  • 2022: v1 mainnet launch
  • 2025: v3 mainnet launch (current)

Current Status (v3.0 - October 2025)

  • βœ… Full EVM compatibility via Frontier
  • βœ… AlephBFT consensus (sub-second finality)
  • βœ… Unified accounts (native ↔ EVM)
  • βœ… DPoS staking with nomination pools
  • βœ… Dynamic EVM fee adjustment
  • βœ… Council governance (13-member council)
  • βœ… Democracy & referendum system
  • βœ… Treasury with Council approval
  • βœ… 35 runtime pallets
  • βœ… Mainnet live and operational

Next Steps (Q4 2025 - Q2 2026)

  • πŸ”§ Fix critical security issues (randomness, storage bounds)
  • πŸ“¦ TypeScript SDK development
  • πŸ›οΈ Transition governance (reduce sudo, increase council powers)
  • πŸ—³οΈ First council elections
  • πŸ› οΈ Enhanced developer tooling
  • πŸ’± DeFi infrastructure (DEX, oracles)
  • πŸ“š Comprehensive documentation

Long-Term (2026+)

  • πŸŒ‰ Cross-chain bridges
  • 🏦 Expanded DeFi ecosystem
  • 🎯 Developer adoption in Cambodia and Southeast Asia
  • 🏒 Real-world use cases (remittance, supply chain)

See docs/chain-dev.md for detailed technical roadmap.


🀝 Contributing

We welcome contributions! Here's how to get involved:

Development Workflow

  1. Fork & Clone

    git clone https://github.com/YOUR_USERNAME/selendra.git
    cd selendra
    git remote add upstream https://github.com/selendra/selendra.git
  2. Create a Branch

    git checkout -b feature/my-awesome-feature
  3. Make Changes & Test

    cargo test --workspace
    cargo fmt
    cargo clippy
  4. Submit Pull Request

    • Push to your fork
    • Open PR against master branch
    • Include clear description & tests
    • Link related issues

Contribution Areas

  • πŸ› Bug Fixes: Report or fix bugs
  • ✨ Features: Propose new functionality
  • πŸ“– Documentation: Improve guides & docs
  • πŸ§ͺ Testing: Add test coverage
  • πŸ” Security: Report vulnerabilities (security@selendra.org)
  • 🌍 Translations: Translate documentation

Code Style

  • Follow Rust API Guidelines
  • Use cargo fmt for formatting
  • Pass cargo clippy with no warnings
  • Write tests for new functionality
  • Document public APIs with /// comments

πŸ”’ Security

Reporting Vulnerabilities

DO NOT open public issues for security vulnerabilities.

Security Audits

  • Status: In progress
  • Firms: CertiK, Trail of Bits
  • Scope: Runtime, custom pallets, EVM integration
  • Reports: Published at selendra.org/security

Known Issues

  • ⚠️ Randomness: Currently using insecure collective flip (fix in progress)
  • ⚠️ Sudo: Superuser key present during governance transition period (removal planned after 6 months)
  • ⚠️ Contract Calls: Wasm contracts have limited runtime call access
  • ℹ️ Governance: Council system implemented, undergoing testing before sudo removal

See Security Advisory for details.


πŸ“„ License

This project is licensed under the GNU General Public License v3.0 - see LICENSE file.

Copyright (C) 2019-2025 Selendra

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

πŸ”— Links & Resources

Official

Community

Developer Resources

Technical


πŸ™ Acknowledgments

Selendra is built on the shoulders of giants:

  • Cardinal Cryptography - AlephBFT consensus & Polkadot SDK fork
  • Parity Technologies - Substrate framework & Frontier EVM
  • Polkadot - Shared security model & ecosystem
  • Ethereum Foundation - EVM specification & tooling
  • Community Contributors - Bug reports, features, and support

Special thanks to all validators, developers, and community members making Selendra possible.


Built with ❀️ by the Selendra Team

Join our Discord β€’ Follow on Twitter β€’ Read the Docs