Technical Architecture
WSCChain's technical architecture is divided into the following key layers, each responsible for specific functions:
Data Layer
Function: Stores all blockchain data.
Core Components:
Block: Contains the header (timestamp, previous block hash, Merkle root) and transaction data.
State Database: Uses a Merkle Patricia Trie (MPT) to store account balances and contract state.
Transaction Pool: Caches transactions waiting to be included in blocks.
Characteristics: Supports fast queries and data integrity verification.
Network Layer
Function: Handles node-to-node communication and data synchronization.
Core Components:
P2P Network: Uses a peer-to-peer protocol to implement node discovery and data propagation.
Node Types: Full nodes (full data), light nodes (headers only), and validator nodes.
Characteristics: Efficiently broadcast transactions and blocks.
Consensus Layer
Function: Ensures consistency of network state.
Core Mechanisms: WPoSA (see below).
Characteristics: 1-second block time, providing fast confirmations.
Execution Layer
Function: Executes transactions and smart contracts.
Core Components:
EVM: Supports Solidity smart contracts.
Gas Mechanism: Low-cost transaction fees.
Characteristics: Compatible with Ethereum tools and contracts.
Application Layer
Function: Provides developer interfaces.
Core Components:
JSON-RPC API: Supports Web3.js interaction.
Tools: Developer platform, traffic analysis dashboard.
Characteristics: Facilitates dApp development and integration.
WPoSA Consensus Mechanism
WPoSA is WSCChain's core consensus mechanism, combining features of Proof of Stake (PoS) and Proof of Authority (PoA) to provide efficient and secure block production.
Core Design
Validator Architecture:
Core Validators: Up to 21, responsible for block production.
Backup Validators: Replace faulty core validators at any time.
Candidate Validators: Compete to participate by staking WSC tokens.
Staking Mechanism:
Users stake WSC tokens to become validators or delegate to existing validators.
Block Production Process:
Core validators take turns producing blocks, generating a new block every 1 second.
Performance Parameters
Block Time: 1 second.
Transaction Confirmation Time: 1 second (1 block).
Throughput: Supports thousands of transactions per second (specific numbers depend on network load and optimizations).
Fault Tolerance: Can tolerate failures of up to 1/3 of core validators (i.e., up to 7).
Security
Voting Weight: Adjusted according to validator stake and historical performance.
Penalty Mechanism: Malicious behavior or being offline will result in deduction of part of the staked WSC.
Network Topology
WSCChain uses a decentralized P2P network and supports multiple node roles.
Node Types
Full Node:
Stores the full blockchain data and validates all transactions.
Suitable for developers or those requiring high reliability.
Light Node:
Only syncs block headers and relies on full nodes to obtain data.
Suitable for resource-constrained devices.
Validator Node:
Participates in WPoSA consensus, must stake WSC and stay online.
Data Synchronization
Block Propagation: Quickly broadcasts new blocks via the P2P network.
State Synchronization: New nodes perform incremental updates starting from the latest state.
Core Components
1. WSC Token
Uses:
Pays transaction Gas fees.
Stake to participate in consensus and governance.
Characteristics: Drives network security and ecosystem incentives.
2. Block Structure
Header:
Timestamp, previous block hash, Merkle root, validator signature.
Body:
List of transactions (including regular transfers and contract calls).
Size: Default 2 MB, adjustable according to needs.
3. State Database
Implementation: Based on MPT, stores account and contract data.
Characteristics: Efficient reads and writes, supports fast state queries.
Performance Features
WSCChain's design optimizes the following performance metrics:
Fast Block Production: 1-second block time, suitable for high-frequency trading and real-time applications.
Low Cost: Gas fees far lower than Ethereum, on average below 0.001 WSC.
High Throughput: Supports high concurrency through parallel transaction processing.
EVM Compatibility: Supports Ethereum smart contracts and tools with no additional learning cost.
Developer Integration
1. RPC Interface
Endpoints:
https://rpc.onwsc.comExample(Query block height):
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' https://rpc.onwsc.comid: 1 is not the chain ID (chainId), but the request identifier in the JSON-RPC protocol used for the client to match requests and responses.
Response:
{"jsonrpc":"2.0","id":1,"result":"0x1a2b3c"}
2. Network Configuration
Mainnet:
Chain ID: 20180422
Currency Symbol: WSC
Gas Parameters:
Minimum Gas Price: 20 gwei.
Transaction Gas Limit: 5,500,000.
3. Tool Support
Development Frameworks: Truffle, Hardhat.
Block Explorer:https://scan.onwsc.com/
Comparison with Other Blockchains
Features
WSCChain
Ethereum
BNB Chain
Consensus Mechanism
WPoSA
PoS
PoSA
Block Time
1 second
12-15 seconds
3 seconds
Transaction Cost
< 0.001 WSC
Relatively high
Moderate
EVM Compatibility
Yes
Yes
Yes
WSCChain has obvious advantages in block production speed and cost.
Summary
WSCChain's technical architecture, through the WPoSA consensus, EVM compatibility, and efficient network design, provides a fast, low-cost blockchain platform. Its 1-second block time and high throughput make it especially suitable for traffic-intensive and latency-sensitive dApps. Developers can use the information in this document to quickly integrate with WSCChain and build applications.
Last updated