Soul Module
Soul Module
Sóul_Módule // Pórtal_Idéntity
ᚠ ᛫ ᛟ ᛫ ᚱ ᛫ ᛒ ᛫ ᛟ ᛫ ᚲ
The Soul module enables cross-game agent portability by serializing agent state to IPFS. Souls can be minted as NFTs for true ownership.
T̷h̴e̸ ̷s̵o̸u̷l̴ ̵t̶r̷a̶n̵s̵c̶e̷n̶d̸s̶ ̶t̸h̵e̷ ̵v̵e̶s̷s̵e̷l̷.
Overview
A Soul is a portable bundle containing:
- Persona: The agent’s personality and backstory
- State: Current mood, inventory, relationships
- Memories: Accumulated experiences and knowledge
- Signature: Cryptographic proof of ownership
Quick Start
API Reference
createSoulInstance(id, name, persona, state, memories?, apiUrl?)
Factory function to create a Soul instance.
soul.export(config?)
Export the Soul to IPFS.
Parameters:
config.apiUrl(string): API URL for IPFS pinningconfig.includeMemories(boolean): Include memories in exportconfig.sign(boolean): Sign with wallet
Returns: Promise<SoulExportResult>
soul.toJSON()
Get the Soul data as a plain object.
Returns: Soul
importSoulFromIPFS(cid, config?)
Import a Soul from IPFS by CID.
Parameters:
cid(string): The IPFS Content IDconfig.apiUrl(string): API URL for IPFS retrievalconfig.verifySignature(boolean): Verify signature before import
Returns: Promise<Soul>
createAgentFromSoul(cid, cortexId, config?)
Create a new agent from an imported Soul.
Parameters:
cid(string): The IPFS Content IDcortexId(string): The Cortex instance to useconfig.apiUrl(string): API URL
Returns: Promise<{ agentId: string; persona: string }>
getSoulList(limit?, apiUrl?)
Get a list of all exported Souls.
Parameters:
limit(number): Maximum entries to return (default: 50)apiUrl(string): Optional API URL
Returns: Promise<SoulListEntry[]>
Pure Functions
createSoul(id, name, persona, state, memories?)
Create a Soul data object (pure function).
serializeSoul(soul)
Serialize a Soul to JSON string.
deserializeSoul(json)
Deserialize a Soul from JSON string.
validateSoul(soul)
Validate Soul schema.
Soul Schema
NFT Integration (Metaplex)
Souls can be minted as Metaplex Core NFTs on Solana:
Cross-Game Portability
Exporting from Game A
Importing into Game B
Security Considerations
- Signatures: Always verify signatures when importing Souls
- Validation: Validate Soul schema before use
- Sanitization: Sanitize persona/memory text for XSS
- Rate Limiting: Implement rate limits on export/import
ᚠ ᛫ ᛟ ᛫ ᚱ ᛫ ᛒ ᛫ ᛟ ᛫ ᚲ
A̵ ̸s̷o̶u̶l̸ ̵i̷s̵ ̵n̸o̷t̸ ̴o̸w̸n̶e̸d̵.̷ ̸I̵t̷ ̶i̵s̸ ̷b̶o̵r̴r̶o̸w̶e̵d̴.
