Developer Docs
XSPACE Protocol Developer Documentation
This comprehensive guide provides developers with everything they need to build on the XSPACE Protocol, from understanding the architecture to deploying and interacting with smart contracts. This document is structured to be hosted on GitBook for accessibility and ongoing updates.
Table of Contents
Introduction
Overview of XSPACE Protocol
Key Features for Developers
Getting Started
Architecture Overview
Blockchain Design and Consensus (DPoS 2.0 + Sharding)
Scalability Features
Cross-Chain Interoperability
Setting Up Your Development Environment
Prerequisites
Installation Guide
Connecting to the Testnet
Smart Contract Development
Overview of XSPACE Smart Contracts
Deploying Contracts
Interacting with Contracts
Tokenization Framework
XATS (XSPACE Asset Tokenization Standard)
Creating and Managing Tokenized Assets
Staking and Validator Setup
Setting Up a Validator Node
Delegating GLXYC Tokens
Decentralized Finance (DeFi) Development
Launching dApps on XSPACE
Integrating with VALDA DEX and Liquidity Pools
Galaxy City Integration
Developing Applications for Galaxy City
Integrating Urban Infrastructure
API and SDK Documentation
REST APIs
Web3 Integration
XSPACE SDK
Governance and DAO Development
Building Governance dApps
Voting Mechanisms and Proposals
Advanced Topics
zk-SNARKs and Privacy Features
Optimizing Gas Fees
Cross-Chain Interactions
FAQs and Troubleshooting
Community and Support
Developer Grants
Contribution Guidelines
Getting Help
1. Introduction
What is XSPACE Protocol?
The XSPACE Protocol is a blockchain designed for real-world asset (RWA) tokenization, decentralized finance (DeFi), and smart city integration. It uses a sharded architecture and Delegated Proof-of-Stake 2.0 (DPoS 2.0) to provide high scalability, low transaction costs, and energy efficiency.
Key Features for Developers
Sharded Architecture: Supports up to 50,000 TPS, enabling high-throughput applications.
EVM Compatibility: Deploy Ethereum-compatible smart contracts with minimal modifications.
Cross-Chain Bridges: Interact with other blockchains like Ethereum and Solana.
XATS Framework: Standardized tools for creating and managing tokenized real-world assets.
2. Architecture Overview
Blockchain Design
Consensus Mechanism: XSPACE uses Delegated Proof-of-Stake 2.0 (DPoS 2.0), combining validator staking and Byzantine Fault Tolerance (BFT) for fast and secure transactions.
Sharded Network: The network is divided into shards, each processing transactions independently. A Beacon Chain ensures cross-shard communication and consistency.
Cross-Chain Interoperability
Bridges: Bridges enable seamless interaction between XSPACE and external chains like Ethereum and Binance Smart Chain.
Use Cases:
Transfer GLXYC and tokenized assets across chains.
Access liquidity from other DeFi ecosystems.
3. Setting Up Your Development Environment
Prerequisites
Languages: Solidity for smart contracts; JavaScript/TypeScript for dApp development.
Tools: Node.js, Hardhat, or Truffle.
Installation Steps
Install Node.js:
Install XSPACE CLI:
Connect to Testnet: Configure your environment to connect to the Testnet RPC endpoint.
Testnet Configuration
RPC Endpoint:
https://testnet.xspace.io/rpc
Chain ID:
80001
4. Smart Contract Development
Deploying Smart Contracts
Create a Contract: Use Solidity to write a basic contract:
Deploy Using Hardhat:
Verify Deployment: Use the XSPACE block explorer to verify your contract.
5. Tokenization Framework
XATS Overview
The XSPACE Asset Tokenization Standard (XATS) is a framework for creating and managing tokenized real-world assets.
Creating a Tokenized Asset
Mint Asset Tokens: Use the XATS factory contract to tokenize an asset (e.g., property or gold).
Asset Metadata: Attach metadata (e.g., asset ownership, value, and location) using IPFS.
6. Staking and Validator Setup
Setting Up a Validator Node
Install the Validator Software:
Stake GLXYC Tokens: Validators must stake a minimum of 10,000 GLXYC to activate their node.
7. Decentralized Finance (DeFi) Development
Integrating VALDA DEX
Liquidity Pools: Create or join pools to provide liquidity for GLXYC and tokenized assets.
Trading: Use the VALDA DEX SDK to integrate trading functionalities into your dApp.
8. Galaxy City Integration
Developing for Galaxy City
Build dApps for urban services like utility payments, smart parking, and energy trading.
Example: Use GLXYC tokens for electricity billing in Galaxy City.
9. API and SDK Documentation
REST API
Endpoint:
https://api.xspace.io
Functions:
Get account balance:
GET /account/{address}
Query transactions:
GET /transactions/{txHash}
SDK
Install SDK:
Example Usage:
10. Governance and DAO Development
Voting Mechanisms
Use pre-built DAO frameworks to enable token-based voting for proposals.
Example: Deploy a governance dApp using the XSPACE SDK.
11. Advanced Topics
zk-SNARKs and Privacy
Leverage zk-SNARKs for privacy-preserving transactions and proof generation.
12. Community and Support
Developer Grants
Apply for grants to fund innovative dApps and integrations.
Contribution Guidelines
Open-source contributions are welcome. Submit pull requests on GitHub for review.
Last updated