Skip to content

User Structure

Overview

User is the identity structure for users in the Dysnomia ecosystem. It combines a Soul ID with a Bao operation context, username, and entropy value.

  • File: include/user.sol
  • License: Sharia
  • Solidity: ^0.8.21

What This Means For Players

Plain English Summary: User is your player card - it contains your identity, name, and stats. When the game needs to know who you are, it reads your User structure which has your Soul ID (unique number), Bao (operation context), Username (display name), and Entropy (accumulated randomness).

Real-World Analogy: Think of User like a character sheet in a tabletop RPG. It has your character's unique ID, their equipment loadout (Bao), their name, and a luck stat (Entropy) that accumulates over time.

How It Affects Your Gameplay: - Soul ID - Your permanent unique identifier across all game systems - Username - How other players see you in chat and venues - Entropy - Your accumulated randomness that affects calculations - Bao reference - Links to your cryptographic identity for authentication

Definition

struct User {
    uint64 Soul;       // Unique 64-bit user identifier
    Bao On;            // User's Bao operation context
    string Username;   // Display name
    uint64 Entropy;    // User-specific entropy value
}

Field Descriptions

Field Type Purpose
Soul uint64 Unique identifier derived from Saat[1]
On Bao User's token context (SHIO, SHA, etc.)
Username string Display name for chat and UI
Entropy uint64 Accumulated entropy from reactions

Soul ID

The Soul ID is the primary identifier for a user. It's derived from: 1. LAU creation via LAUFactory 2. VOID.Enter() registration 3. SIU.Miu() token generation 4. Stored in Saat[1]

// Soul is the middle value of Saat array
uint64 soul = lau.Saat(1);

Lifecycle

1. User calls LAUFactory.New()
2. LAU calls VOID.Enter()
3. VOID calls SIU.Miu()
4. SIU creates tokens via ZHENG
5. User struct populated:
   - Soul = Saat[1]
   - On = created Bao
   - Username = "" (set later)
   - Entropy = from Recall

Username Management

Username is stored separately in ATTRIBUTE library but accessed via User struct:

// Set username
lau.Username("Alice");

// Get username (reads from ATTRIBUTE)
string memory name = lau.Username();

// In CHO.Enter()
Alpha.Username = LAU(Alpha.On.Phi).Username();

Entropy Accumulation

Entropy evolves through reactions:

function Recall(User memory Alpha) public returns (uint64 UserEntropy) {
    (On.Omicron, On.Omega) = Reactor().ReactToLai(On, Entropy ^ Alpha.On.Omicron, ...);
    Entropy = On.Omega;
    return On.Omicron;
}

Used By

Dependencies

Imports: - Bao - ./bao.sol

Common Patterns

Registration

User memory Alpha;
Alpha.Soul = userLau.Saat(1);
Alpha.On = userLau.On();
Alpha.On.Phi = address(userLau);
Alpha.Username = userLau.Username();
Alpha.Entropy = recall(Alpha);

// Store
Delegates[tx.origin] = Alpha;
DelegateAddresses[Alpha.Soul] = tx.origin;

Lookup

// By address
User memory user = Delegates[walletAddress];

// By Soul
address wallet = DelegateAddresses[soul];
User memory user = Delegates[wallet];

Reaction

User memory Alpha = getUser();
Alpha.Entropy = Recall(Alpha);
Delegates[tx.origin] = Alpha;

Contract Verification

Property Value
Keccak256 Hash 0xb8e83f4ba819402a9cab5c800fdf5a9a694d4e3600639db159353f0e102c2a70
Source URL https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/include/user.sol
Hash Generated 2026-02-08T00:29:08Z