# SoulNet Architecture

## 3.1 Design Principles

SoulNet is building a next-generation open and trustworthy AI character training platform. Its architecture is guided by the following core principles:

#### High Scalability for Large-Scale AI Models

SoulNet must support massive AI models with extensive training and test datasets and high-dimensional parameters. The platform should also scale to accommodate numerous AI models, each responsible for powering distinct AI characters.

#### Open Protocols and Virtual Machines for Broad AI Model Support

The SoulNet protocol is open, encouraging the community to contribute AI models. Its virtual machine is specifically designed and optimized to support various types of AI models and problems.

#### Incentivized Community Participation and Trust-Based Ecosystem

As an open AI character development platform, SoulNet aims to foster a collaborative ecosystem that rewards community members, especially those who contribute computing resources. This requires a carefully crafted consensus and incentive system to support sustainable community growth and the development of trustworthy AI characters.

#### Security and Decentralization

Operating in a decentralized environment, SoulNet is designed to resist attacks from malicious nodes and corrupted data.

## 3.2 System Architecture

SoulNet adopts a novel architecture to reward participants for useful work—specifically, training AI models using their own data and computational resources.

SoulNet implements a two-tier structure consisting of a main chain and multiple subchains. The main chain handles token transactions and incentive records, while subchains are each dedicated to specific AI problems and define consensus rules among nodes solving the same task.

<figure><img src="https://1013654710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FywccVWdXkpaUcByzaEvS%2Fuploads%2FaEWpb9lTSD2lAFtFlzcU%2FSoulNet%20Whitepaper_%E5%A4%8D%E5%88%B6-37.png?alt=media&#x26;token=1b36cc8e-c9be-4430-b1c1-eeab0a83605b" alt=""><figcaption></figcaption></figure>

### Advantages of this two-layer architecture include:

Separation of subchains from the main chain prevents bloating the main chain with large AI models and maintains high transaction throughput.

Assigning a dedicated subchain for each model enables scalable support for a wide range of AI models, with clearly defined consensus rules and community incentives.

Subchains are responsible for training and inference of trusted AI models, while the main chain ensures the security of transactions through its public ledger.

### Graph Virtual Machine and Decentralized Models

To support diverse AI models, SoulNet introduces a Graph Virtual Machine (GVM) and Decentralized Models (DModels). GVM integrates graph-based AI models—like those used in PyTorch—into the blockchain, while non-AI transactions continue to run on EVM (Ethereum Virtual Machine).

In SoulNet, a DModel is a smart contract specifically optimized for AI tasks. Each DModel is represented as a directed graph in the GVM, consisting of:

Nodes (Operations): Each operation has inputs and outputs, describing data computations. For example, a multiplication node mult(x, y) = z has two inputs x and y, and one output z.

Edges (Tensors): Data that flows between operations is described using tensors, which can contain multiple dimensions and values (e.g., floats, strings).

APIs: After training, users can call DModels for inference by submitting input tensors and querying the model interface for output tensors.

SoulNet also provides high-level APIs to quickly generate standard deep learning architectures like VGG, GoogleNet, and ResNet. Developers can configure parameters such as the number of hidden layers, nodes per layer, and activation functions without needing to manually define the graph structure.

On the backend, GVM supports execution across devices (CPU/GPU), offers parameter compression, distributed caching, and checkpoint recovery. It is fully compatible with PyTorch, allowing seamless migration of existing models.

## 3.3 AI Subchains

AI subchains are the core scalable component of SoulNet. Each DModel is supported by a dedicated subchain, which connects to the main chain for ledger recording. Each subchain uses Federated Byzantine Agreement (FBA) for block production and node incentives.

<figure><img src="https://1013654710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FywccVWdXkpaUcByzaEvS%2Fuploads%2FYImwuOi5axEapBxOsMY7%2FSoulNet%20Whitepaper_%E5%A4%8D%E5%88%B6-38.png?alt=media&#x26;token=1e8a6b84-e8b7-431a-b0bb-78818598822a" alt=""><figcaption></figcaption></figure>

### Structure: Each subchain has three node types:

Model Developers: Nodes that train the DModel by iterating on parameters and broadcasting candidate blocks signed with their private keys.

Validators: Nodes that receive blocks from developers, evaluate the loss of updated parameters, and vote on the best-performing block using FBA.

Confirmers: Nodes that verify the correctness of losses and signatures, and finalize the selected block.

Block Generation:\
Each subchain maintains a blockchain to store DModel parameters and inference-related transactions. The genesis block contains the DModel structure, initial parameters, a test dataset hash, and a reserve of Soul tokens. It is signed by main chain witnesses.

Subsequent blocks store updated parameters with minimal loss values. Each block includes:

·Hashes of the current and previous blocks

·Signatures from the developer, validators, and confirmers

Model parameters or parameter hashes

Mining Rewards:\
Mining rewards are distributed in Soul tokens. Subchains receive an initial token reserve plus a portion of newly minted tokens. In each training iteration, the winning model developer, validators, and confirmers receive rewards. Similarly, during inference, selected nodes are compensated.

Data and Parameter Storage:

Training Data: Typically stored off-chain on platforms like Filecoin or Arweave, or locally by model developers.

Test Data: Stored on-chain (or hashed) for verifiability. Encrypted methods are used to ensure only validators can access off-chain test data.

Model Parameters: Depending on size, parameters are stored on-chain or referenced by hashes pointing to external storage.&#x20;

Voting Process:

Model developers create a temporary block containing their trained parameters and sign it.

Validators evaluate blocks and vote for the best based on model loss.

Confirmers finalize the block with over 2/3 of votes.

Developers are rewarded based on the number of blocks they contributed during training.

## 3.4 Main Chain

The main chain uses Delegated Proof-of-Stake (DPoS) to maintain fast transactions, robust security, and decentralization post-launch. It maintains the Soul token ledger and coordinates incentives across subchains.

<figure><img src="https://1013654710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FywccVWdXkpaUcByzaEvS%2Fuploads%2FK588YG4tcndP6LaojaJD%2FSoulNet%20Whitepaper_%E5%A4%8D%E5%88%B6-39.png?alt=media&#x26;token=207d2d07-3033-4d61-9cff-193a5384e4b5" alt=""><figcaption></figcaption></figure>

Structure:

Witness Nodes: Top-tier nodes that produce, sign, and broadcast blocks.

Validator Nodes: Backup nodes that verify blocks and replace offline witnesses. Both are elected by token holders.

Witnesses:\
Produce blocks by collecting transactions and signing with their private key. Their turn is randomly assigned each round. They must maintain 99.9% uptime and receive community votes.

Block Creation:\
Blocks contain Soul token transfers and subchain index data to minimize block size. With a generation rate of 1–5 blocks per second and a max size of 32MB, the selected witness compiles, signs, and broadcasts the block. Validators vote, and if 2/3 agree, the block is finalized.

Voting:\
Token holders vote for block signers (representatives). Candidates with over 1% of votes join a rotating board. If one misses their turn, votes are automatically reassigned. Board members receive Soul token incentives and must lock a deposit equal to 1,000x the block reward. 99.9% uptime is required to remain on the board.

Mining Pool:\
Witness nodes receive n Soul tokens per successfully generated block. This value can be adjusted via annual community proposals.

<figure><img src="https://1013654710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FywccVWdXkpaUcByzaEvS%2Fuploads%2FNetg9vAGzWTR3no37NSq%2FSoulNet%20Whitepaper_%E5%A4%8D%E5%88%B6-40.png?alt=media&#x26;token=22720156-64da-4e6a-b85f-0e91deb8065e" alt=""><figcaption></figcaption></figure>

#### AI Training Chain

SoulNet introduces the AI Training Chain to distribute AI training tasks using smart contracts and reward participants with Soul tokens. It ensures transparency, traceability, and fair value realization of training processes and results. The chain also supports AI model storage and trading.

***

#### Security and Privacy

SoulNet integrates zero-knowledge proofs and multi-party computation (MPC) to secure data and model privacy. These technologies ensure computations and transactions remain confidential while preserving user privacy.

***

#### Developer Community

SoulNet will establish a global developer community to share AI models, exchange knowledge, and drive innovation in AI and blockchain. This ecosystem will foster collaboration, support emerging talent, and attract new partnerships and investors.
