# Technology

MetaSpace’s tech stack is chosen to deliver the most seamless RPG gaming experience possible. The game integrates blockchain technology, time-tested game development tools, and a scalable backend infrastructure. This combination ensures fast performance, true asset ownership, and smooth multiplayer features even as thousands of players join together. Each element is chosen to work well together so the game feels responsive on mobile phones, as well as on other platforms in the future. We focused on tools that are reliable, fast, and easy to scale as the community grows. The aim is to never let players worry about lag, lost items, or complicated setups. The stack is designed to keep the game running smoothly while giving the user full control over purchases.

### Blockchain Integration: Smart Contracts on Polygon

MetaSpace's smart contracts are deployed on the Polygon chain. We picked Polygon for its speed and affordability, along with the robust security of the Ethereum core. Polygon is a Layer 2 blockchain built on top of Ethereum and is designed for faster transaction speeds, significantly lower gas fees, and improved scalability. This makes the chain ideal for gaming applications that demand real-time interaction and frequent micro-transactions. Thus, players can buy, sell, and stake NFTs in real-time without waiting long or paying high fees.&#x20;

All in-game assets, such as weapons, vehicles, and characters in MetaSpace, are minted as NFTs on Polygon. The NFT smart contracts manage ownership and transfer of all in-game assets. Smart contracts ensure full and absolute ownership of in-game assets. Once a user buys or earns an item, it is permanently theirs on the blockchain. Users can trade, sell, stake, or use it inside the game. No one can take it away or modify it, and anyone can verify ownership via a Polygon blockchain scanner. MetaSpace smart contracts are regularly audited to protect against new vulnerabilities.

**These are our most used smart contracts:**

[NFT Manager🔗](https://polygonscan.com/address/0x2F2616c9248C8be22132Aac7Cf728a3a698a2a13#writeContract): Manage NFTs

0x2F2616c9248C8be22132Aac7Cf728a3a698a2a13

[MetaspaceNFTMarketplace🔗](https://polygonscan.com/address/0x7ca5DCE7A8886c023D37F383a2B8c219a287e0e5#code): NFT Marketplace

0x7ca5DCE7A8886c023D37F383a2B8c219a287e0e5

[NFTStaking🔗](https://polygonscan.com/address/0x674D083fE2D1F404a41eC7B8eac71797cdAd0D84): Staking of NFTs

0x674D083fE2D1F404a41eC7B8eac71797cdAd0D84

### Game Engine: Built on Unity

MetaSpace is built on the Unity game engine. We chose Unity because it is versatile and an industry-standard for scalable mobile games. Unity powers numerous successful titles, including other established Web3 mobile games. The game engine allows seamless deployment across iOS, Android, and VR devices. This means the same game runs smoothly on phones and VR headsets with minimal changes. Unity’s advanced rendering tools and physics simulations also offer high-quality graphics and performance. The game looks beautiful with detail-rich environments, smooth animations, and realistic lighting while still running well on even mid-range phones.

Unity offers extensible tooling support, resulting in seamless Web3 integration via native plugins. This accelerates development via pre-built Web3 features such as wallets, NFTs, token rewards, etc., instead of coding everything from scratch. This also allows for quick gameplay updates and feature additions. The engine also has a vast asset store and a large community. We can prototype new missions and environments faster and respond to player feedback more promptly. Unity balances accessibility and innovation perfectly. The engine is reliable in the long-term and has been battle-tested in many successful games. Overall, Unity was the best choice for building a cross-platform Web3 game that feels modern and professional.

### Backend Infrastructure

MetaSpace’s backend architecture is designed with low-latency hosting, real-time data synchronization, and comprehensive monitoring. The core servers and APIs are hosted on DigitalOcean. It’s a cloud platform that is known for its simplicity, cost-efficiency, and high-performance virtual machines. This gives us the freedom to scale quickly when player numbers suddenly rise. Thus, our servers can handle thousands of players with little or no lag. We use Web3Auth for player authentication during signup and login. This will allow users to instantly connect their social accounts or email without worrying about seed phrases or complex wallet setup.&#x20;

For dynamic features like live multiplayer sessions, leaderboards, and in-game events, we use Google Cloud's real-time database solutions. It’s a NoSQL database and offers sub-second query times, automatic synchronization across devices, and built-in security. This allows leaderboards to update instantly, and multiplayer matches go smoothly even with players from different countries.

System health and performance are monitored using Grafana, an open-source analytics platform integrated with our cloud infrastructure. Grafana provides customizable dashboards for metrics like server uptime, latency, and resource usage. Our team can spot and fix issues before players even notice them. The backend is designed to be reliable and supports a massive user base and real-time interaction. It ensures MetaSpace scales well as the community grows. We chose this stack for the backend because they offer the perfect mix of speed, reliability, and cost-effectiveness. The infrastructure is built to grow with the game for many years ahead.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://metaspacechain.gitbook.io/whitepaper/technology.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
