SHIO¶
Overview¶
SHIO (Paired Token System) combines two SHA tokens (Rod and Cone) into a cryptographically-bound pair. The pairing enables symmetric reactions and logging functionality for chat/messaging systems.
- Inherits: DYSNOMIA
- License: Sharia
- Solidity: ^0.8.21
What This Means For Players¶
Plain English Summary: SHIO is a paired lock system - like having two keys that must work together. It combines two SHA tokens (called Rod and Cone) into a cryptographically linked pair that powers your chat messages and identity verification. Your SHIO is what allows you to send messages and proves you're really you.
Real-World Analogy: Imagine a safe deposit box at a bank that requires two keys - the bank has one key, you have the other, and both must be used together to open the box. SHIO works similarly: the Rod and Cone are mathematically bound together, and both must "agree" for any action to be valid. This makes it extremely secure.
How It Affects Your Gameplay: - Chat messaging - Every chat message you send is logged through your SHIO - Symmetric verification - The Rod and Cone verify each other, preventing forgery - Reaction outputs - When you interact with venues or other players, SHIO produces unique outputs that track your activity
State Variables¶
| Variable | Type | Visibility | Description |
|---|---|---|---|
| Type | string | public constant | "SHIO" |
| Rho | Shao | public | Contains Rod and Cone SHA references + Barn value |
| Manifold | uint64 | public | Computed manifold from magnetization |
| Monopole | uint64 | public | XOR of Rod and Cone Chin values |
Structs¶
Shao¶
struct Shao {
SHA Rod; // Primary SHA token
SHA Cone; // Secondary SHA token
uint64 Barn; // Barn value from magnetization
}
Read Functions¶
Rod¶
- Returns: Reference to Rod SHA token - In Plain English: Get the address of the first (Rod) SHA token in this pair. The Rod and Cone work together like two halves of a key.Cone¶
- Returns: Reference to Cone SHA token - In Plain English: Get the address of the second (Cone) SHA token in this pair. Together with Rod, they form a complete cryptographic identity.Rho¶
- Returns: Complete Shao structure with both tokens - In Plain English: Access the full pairing data including both SHA tokens and the Barn value. Contains everything about this cryptographic pair.Write Functions¶
Log¶
- Access:onlyOwners
- Parameters:
- Soul (uint64): User's unique 64-bit Soul ID identifier
- Aura (uint64): User's current Aura value from SIU
- LogLine (string): The message content to log
- Description: Emits a LogEvent for permanent on-chain chat/messaging.
- Logic Flow:
1. Emit LogEvent(Soul, Aura, LogLine)
- Side Effects: Emits LogEvent event; no state changes
- In Plain English: Record a chat message on the blockchain permanently. The Soul ID identifies who sent it, the Aura provides cryptographic context, and the LogLine is the actual message. All messages are immutable once logged.
Generate¶
- Access:onlyOwners
- Parameters:
- Xi (uint64): Generation seed used in ConductorGenerate for Avail
- Alpha (uint64): Identity parameter for Cone's Conify
- Beta (uint64): Identity parameter for Rod's Saturate
- Description: Initializes the Rod/Cone pair through cross-linking and saturation.
- Logic Flow:
1. Call ConductorGenerate(Xi):
- Rho.Rod.Avail(Xi) and Rho.Cone.Avail(Xi)
- Rho.Rod.Form(Rho.Cone.View().Contour) (cross-link with Cone's Contour)
- Rho.Cone.Form(Rho.Rod.View().Contour) (cross-link with Rod's Contour)
- Rho.Rod.Polarize() and Rho.Cone.Polarize()
2. Rho.Rod.Conjugate(Rho.Cone.View().Pole) (Rod accepts Cone's Pole)
3. Rho.Cone.Conjugate(Rho.Rod.View().Pole) (Cone accepts Rod's Pole)
4. Rho.Cone.Conify(Alpha) (establish Cone's identity)
5. Rho.Rod.Saturate(Alpha, Cone.Foundation, Cone.Channel) (Rod saturates with Cone's values)
6. Rho.Cone.Saturate(Beta, Rod.Foundation, Rod.Channel) (Cone saturates with Rod's values)
7. Call _mintToCap()
- Side Effects: Modifies both Rod and Cone SHA states; mints tokens
- In Plain English: This is the "birth" of the SHIO pair. It performs the complete cross-linking sequence: both tokens process the same Xi, exchange Contours via Form, exchange Poles via Conjugate, then Saturate with each other's Foundation and Channel. After this, Rod and Cone are cryptographically bound.
Isomerize¶
- Access:onlyOwners
- Description: Bonds the Rod SHA to finalize its pairing.
- Logic Flow:
1. Call Rho.Rod.Bond() which:
- Recomputes Dynamo = Base^Signal mod Element
- Clears Pole = 0
2. Call _mintToCap()
- Side Effects: Modifies Rod's Dynamo and Pole; mints tokens
- In Plain English: Lock in the Rod token's pairing. Bonding recalculates the Dynamo using Element as the modulus (not MotzkinPrime) and clears the Pole to signal completion. Rod is now permanently bound to this SHIO and ready for reactions.
Isolate¶
- Access:onlyOwners
- Description: Bonds the Cone SHA to finalize its pairing.
- Logic Flow:
1. Call Rho.Cone.Bond() which:
- Recomputes Dynamo = Base^Signal mod Element
- Clears Pole = 0
2. Call _mintToCap()
- Side Effects: Modifies Cone's Dynamo and Pole; mints tokens
- In Plain English: Lock in the Cone token's pairing. Like Isomerize but for the Cone half. Both Isomerize and Isolate must be called before Magnetize to complete the pairing.
Magnetize¶
- Access:onlyOwners
- Returns:
- Ring (uint64): Computed ring value that proves valid pairing
- Description: Finalizes pairing by computing Manifold, Ring, Barn, and Monopole with three equality assertions.
- Logic Flow:
1. Compute Manifold = Rod.Adduct(Cone.Dynamo())
2. Verify Manifold == Cone.Adduct(Rod.Dynamo()) or revert ManifoldInequality
3. Compute Ring = modExp64(Rod.Coordinate, Manifold, Rod.Element)
4. Verify Ring == modExp64(Cone.Coordinate, Manifold, Cone.Element) or revert RingInequality
5. Compute Rho.Barn = modExp64(Ring, Manifold, Rod.Element)
6. Verify Barn == modExp64(Ring, Manifold, Cone.Element) or revert BarnInequality
7. Compute Monopole = modExp64(Rod.Chin, Cone.Chin, MotzkinPrime)
8. Call _mintToCap(), Rod.mintToCap(), Cone.mintToCap()
9. Return Ring
- Computation Details:
- Manifold = ConesDynamo^RodsSignal mod RodsElement (and symmetric)
- Ring = Coordinate^Manifold mod Element (must match on both)
- Barn = Ring^Manifold mod Element (must match on both)
- Monopole = RodsChin^ConesChin mod MotzkinPrime
- Side Effects: Sets Manifold, Rho.Barn, Monopole; mints tokens on all three contracts
- In Plain English: Complete the pairing by verifying Rod and Cone are properly matched through three symmetric computations. If any check fails, the tokens weren't paired correctly. Returns a Ring value as proof of valid pairing. The Monopole is used to XOR inputs during React.
React¶
- Access:public (callable by anyone)
- Parameters:
- Pi (uint64): Input value to react
- Returns:
- Omicron (uint64): First reaction output (from Cone)
- Omega (uint64): Second reaction output (from Cone, equals Rod's Eta)
- Description: XORs input with Monopole, reacts on both Rod and Cone, verifies symmetric outputs.
- Logic Flow:
1. XOR input with Monopole: Pi = Pi ^ Monopole
2. Call (Eta, Kappa) = Rod.React(Pi, Cone.Channel)
3. Call (Omicron, Omega) = Cone.React(Pi, Rod.Channel)
4. Verify symmetry: Omicron == Kappa && Omega == Eta or revert ReactionInequalityError
5. Verify non-zero: Omega != 0 && Omicron != 0 or revert ReactionZeroError
6. Call mintToCap()
7. Return (Omicron, Omega)
- Computation Details:
- Rod: Eta = Pi^RodChannel mod ConeChannel, Kappa = Pi^ConeChannel mod RodChannel
- Cone: Omicron = Pi^ConeChannel mod RodChannel, Omega = Pi^RodChannel mod ConeChannel
- Symmetry: Rod's Eta == Cone's Omega, Rod's Kappa == Cone's Omicron
- Side Effects: Mints tokens; reverts if outputs don't match or are zero
- In Plain English: Process an input through the paired tokens to produce two unique outputs. The input is first XORed with Monopole to add system entropy. Both Rod and Cone react, and their outputs are verified to be symmetric - proving the pair is valid. This powers chat logging, reward calculations, and all cryptographic game interactions.
Events¶
| Event | Parameters | Description |
|---|---|---|
| LogEvent | Soul (uint64), Aura (uint64), LogLine (string) | Chat/message log entry |
Errors¶
| Error | Parameters | Description |
|---|---|---|
| ManifoldInequality | Manifold | Rod/Cone manifold mismatch |
| RingInequality | Ring | Ring computation mismatch |
| BarnInequality | Barn | Barn computation mismatch |
| ReactionZeroError | Eta, Kappa | Reaction produced zero |
| ReactionInequalityError | Eta, Kappa | Rod/Cone reaction mismatch |
Contract Interactions¶
Depends On¶
Depended On By¶
- SHIOFactory - Creates SHIO instances
- YI - Uses SHIO for DeFi operations
- Bao - References SHIO in operations
Special Mechanisms¶
ConductorGenerate¶
Private function that: 1. Calls Avail on both Rod and Cone with Xi 2. Calls Form on each with the other's Contour (cross-linking) 3. Polarizes both tokens
Symmetric Pairing Verification¶
Magnetize() includes three equality assertions: - Manifold computed from Rod must equal Manifold from Cone - Ring values must match - Barn values must match
This ensures proper cryptographic pairing.
React Symmetry¶
The React function verifies that reacting on Rod with Cone's Channel produces the same result as reacting on Cone with Rod's Channel (transposed). This symmetric property is essential for message encryption/verification.
Usage Pattern¶
// Creation via factory
SHIO shio = SHIOFactory.New(rodAddr, coneAddr, mathAddr);
// Initialization
shio.Generate(xi, alpha, beta);
shio.Isomerize();
shio.Isolate();
uint64 ring = shio.Magnetize();
// Usage
(uint64 omicron, uint64 omega) = shio.React(inputValue);
shio.Log(soul, aura, "Hello World");
Contract Verification¶
| Property | Value |
|---|---|
| Keccak256 Hash | 0xfcb03144ff9a373458124e215f2655545d3cce0652b334257eceaaa02a315b64 |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/03_shio.sol |
| Hash Generated | 2026-02-08T00:29:57Z |