CritterCraft Universe ‐ Initial Blockchain Architecture - BigBossBoolingB/CritterCraftUniverse GitHub Wiki

Wiki: Initial Blockchain Architecture Document ID: ARCH-BLK-001 Status: Finalized Architect: Josephis K. Wade

  1. Overview This document outlines the foundational technology stack and architectural choices for the CritterCraft blockchain. The design prioritizes modularity, future-readiness, and a phased approach to decentralization, in line with the project's Architectural Principles.

  2. Core Framework: Substrate (Polkadot SDK) CritterCraft will be built as a sovereign Layer 1 blockchain using the Substrate framework.

Rationale:

Ultimate Modularity (The "S" in KISS): Substrate's FRAME system allows for the entire blockchain logic to be built as modular components called "pallets." This is the perfect technical embodiment of our architectural philosophy, enabling us to add, remove, and upgrade features with surgical precision.

Forkless Upgrades: Runtime upgrades can be deployed seamlessly without requiring a hard fork, ensuring the universe can evolve without fragmenting the community or network.

Inherent Interoperability: Building with Substrate provides a clear and native path to becoming a parachain on the Polkadot or Kusama relay chains, fulfilling our long-term Scalability Plan.

Performance & Customization: Substrate allows us to define our own transaction weighting, fees, and block logic, creating a chain optimized specifically for the needs of an AI pet simulation, rather than being constrained by a generic smart contract platform.

  1. Initial Consensus Mechanism: Proof-of-Authority (PoA) The network will launch with a Proof-of-Authority (PoA) consensus model.

Rationale:

Launch Velocity & Stability: PoA allows the core development team to manage the validator set initially. This ensures high performance, predictable block times, and the ability to rapidly patch any critical issues during the nascent phase of the ecosystem.

Iterative Development: It aligns with the "Iterate Intelligently" principle, allowing us to focus on perfecting the core gameplay loops before introducing the complexities of decentralized consensus.

Migration Path: This is a temporary, strategic choice. The architecture will be fully compatible with a transition to Nominated Proof-of-Stake (NPoS) as outlined in the Consensus Migration Plan.

  1. Runtime Composition: Core Pallets The CritterCraft runtime will be composed of the following pallets:

Standard FRAME Pallets pallet-balances: Manages the PTCN token balances.

pallet-timestamp: Provides on-chain timekeeping.

pallet-sudo: Grants root-level access for initial administration and emergency fixes. To be deprecated and removed upon transition to full governance.

pallet-transaction-payment: Manages transaction fee logic.

pallet-utility: Provides helper functions for batching calls.

Custom CritterCraft Pallets (The Core Game) pallet-nft: Manages the creation (minting), transfer, and data structure of all PetNfts.

pallet-marketplace: Governs the listing and sale of NFTs. (See Marketplace Spec).

pallet-battles: Contains the logic for the pet battle system.

pallet-quests: Manages the creation, acceptance, and completion of in-game quests.

pallet-rewards: Handles the logic for daily claims and distribution of rewards.