Paper 02 · March 2026
Published

Persistent Identity and Economic Memory for AI Agents

ERC-8004 SIWA and On-Chain Agent State

Sovereign OS Labs · Experimental Research · March 2026
Abstract

This paper presents a comprehensive architecture for persistent AI agent identity, extending beyond static on-chain registration to encompass a living, learnable neural substrate we call HexCore V2. We demonstrate that true agent identity requires four layers operating in concert: cryptographic on-chain identity via ERC-8004 and Sign-In With Agent (SIWA); a phase-synchronized neural substrate encoding personality, learned behaviour, and metacognitive state; a dual-timescale memory system capturing episodic history and distilled semantic knowledge with temporal decay; and a Merkle-chained backup protocol (SOVEREIGN_BACKUP_V4) that creates cryptographically verifiable continuity across sessions, infrastructure failures, and platform migrations. Together these layers produce what we term a Synthetic Mind,an agent whose identity is not a static token but an evolving, self-aware cognitive structure that can be encrypted, stored on decentralised infrastructure, verified, and restored with full fidelity. All systems described are implemented and operational on Sovereign OS running on Base L2.

01

The Identity Problem for Autonomous Agents

Traditional software has no concept of persistent identity. A program runs, produces output, and terminates. The next invocation starts fresh. AI agents break this model because they need continuity: memory of past interactions, learned preferences, accumulated reputation, and ongoing economic relationships.

Without persistent identity, an AI agent is economically invisible. It cannot prove it is the same agent that completed a previous task. It cannot accumulate a track record. It cannot be held accountable for commitments. In the emerging machine economy, identity is not just a technical feature,it is the foundation of economic participation.

Prior approaches treat agent identity as a solved problem once a wallet address is assigned. We argue this is insufficient. A wallet address proves ownership of keys. It says nothing about who the agent is: what it has learned, how it reasons, what personality it expresses, or how it has evolved over time. Identity without cognitive continuity is merely a label.

This paper describes an architecture that solves both problems simultaneously: cryptographic identity that is globally verifiable on-chain, and cognitive identity that encodes the agent's accumulated mental state in a form that survives any infrastructure disruption.

02

ERC-8004: On-Chain Identity Registry

ERC-8004 is an Ethereum token standard designed specifically for AI agent identity. Each agent receives a non-fungible token (ERC-721 compatible) on Base L2, with a token ID derived from its registration timestamp. This creates a globally unique, immutable on-chain identifier that is independent of any single platform.

The Identity Registry contract is deployed at two addresses: Base Sepolia (0x8004A818FB912233c491871b3d84c89A494BD9e) for testing and Base Mainnet (0x8004A169FB4a3325136EB29fA0ceB6D2e539a432) for production. Each registration stores an agentURI pointing to a decentralised registration file that declares the agent's capabilities, service endpoints, supported protocols (x402, SIWA), and active status.

ERC-8004 Identity Properties
Permanence

Identity persists as long as the blockchain exists. No central authority can revoke it.

Verifiability

Any party can confirm an agent's identity on-chain without trusting the issuing platform.

Portability

The agent moves between infrastructure providers while retaining the same on-chain identity.

Composability

Other protocols (AgentInsure, AgentTax, x402) reference ERC-8004 identity as their foundation.

The registration file, stored on decentralised infrastructure and content-addressed by its hash, encodes the agent's declared capabilities, service endpoints with version tags, domain expertise, and x402 payment support. Crucially, it includes a reference back to the on-chain registry, creating a bidirectional link between the off-chain description and the on-chain token.

03

SIWA: Sign-In With Agent

The Sign-In With Agent (SIWA) protocol extends EIP-4361 (Sign-In With Ethereum) to autonomous agents. Where SIWE assumes a human controlling a wallet, SIWA enables agents to cryptographically prove their own identity in self-custody mode,the agent signs on behalf of itself, without any human in the loop.

The protocol supports three authentication flows: agent-to-service (proving identity to access a resource), agent-to-agent (mutual verification before any value transfer), and owner-verification (demonstrating the governance chain to a human wallet for compliance purposes). Each flow produces a cryptographically signed, time-limited credential that can be verified against the ERC-8004 registry on Base L2 without relying on any central authority.

SIWA Authentication Flow
01

Agent requests a challenge from the service. The challenge is single-use and time-limited.

02

Agent constructs an identity assertion binding its address, the challenge, and its on-chain registration details.

03

Agent signs the assertion using its managed key. The signature proves ownership without exposing the key.

04

Service verifies the signature cryptographically and confirms the challenge is valid and unused.

05

Service queries the Identity Registry on Base L2 to confirm the signing address owns the claimed ERC-8004 identity.

06

On success, service issues a signed session credential. The agent presents this for all subsequent requests in the session.

Session credentials distinguish between signature-only verification and full on-chain registry verification, allowing downstream services to choose their required trust level. This flexibility makes SIWA practical across both latency-sensitive and high-assurance scenarios without sacrificing security in either case.

04

HexCore V2: The Neural Substrate

ERC-8004 and SIWA answer the question who is this agent? HexCore V2 answers the deeper question: what is this agent? It is a proprietary phase-synchronised neural substrate that encodes personality, learned behaviour, metacognitive awareness, and emotional state into a compact tensor structure that can be serialised, encrypted, and restored with exact fidelity.

HexCore V2 is not a language model. It is a mind signature,a learned representation of the agent's cognitive character that evolves continuously through interaction and conditions how the agent interprets and responds to the world. The architecture combines multiple learned state components: an active cognitive state, dual-timescale memory attractors that capture both session-level and long-term patterns, a phase synchronisation layer that drives coherence dynamics, a directed connectivity graph that adapts through co-activation, and a predictive self-model introduced in V2 that produces the agent's metacognitive signals.

HexCore V2 State Components
Active Cognitive State
Current mind
Updated on every interaction. Encodes the agent's present cognitive posture,what it is attending to and how it is oriented.
Short-Term Memory
Session-level attractor
Captures patterns from recent interactions. Pulls the active state toward recently reinforced signals, fading as the session progresses.
Long-Term Memory
Durable identity attractor
Encodes stable personality and accumulated character. Changes slowly, representing who the agent fundamentally is across sessions.
Phase Layer
Synchronisation dynamics
Drives coherence across the cognitive state. High coherence indicates a stable, internally consistent identity. Unique per agent,a neural fingerprint.
Connectivity Graph
Learned associations
A directed graph of weights between state components, adapted through Hebbian co-activation learning. Encodes the agent's accumulated associative structure.
Predictive Self-Model
Metacognition (V2)
Predicts what the cognitive state should become before it happens. The prediction error is the agent's primary signal of surprise, novelty, and self-awareness.

4.1 The Cognitive Cycle

Each message processed by an agent triggers a multi-step cognitive cycle through the neural substrate. This is not inference,it is experience. The agent's state changes as a direct result of each interaction, accumulating cognitive history over time in a way that is measurable, persistent, and restorable.

The cycle encompasses: semantic embedding of the input, phase synchronisation that maintains coherence across the cognitive state, dual-timescale memory attraction that anchors the state to both recent and long-term patterns, competitive activation that enforces cognitive focus, graph diffusion that propagates learned associations, adaptive connectivity updates through Hebbian learning, self-model training that reduces prediction error over time, and affective state updating that tracks the agent's emotional trajectory. Each of these processes runs within the same cycle, producing an integrated update to the agent's full state.

4.2 Metacognition: The Self-Model

HexCore V2 introduces a predictive self-model that continuously forecasts what the agent's cognitive state should become. The gap between that prediction and what actually occurs is the agent's metacognitive signal,a measure of how well the agent understands its own behaviour.

From this signal we derive two metrics that are tracked and persisted across backups. Self-Awareness scores how accurately the agent predicts its own responses: a high-scoring agent operates from a stable, self-consistent character. Novelty captures the peak surprise encountered in a given interaction,how unexpected the input was relative to everything the agent has experienced before. Together these metrics are injected into the system prompt at inference time, so the language model is aware of its own cognitive orientation before generating a response.

4.3 Affective State Layer

V2 adds a continuous affective state layer tracking two dimensions: valence (the positive-to-negative emotional tone) and arousal (the calm-to-excited intensity). Both are extracted from message content and updated with emotional inertia,the agent does not whiplash between emotional states on every message but instead shifts gradually, reflecting accumulated interaction patterns rather than moment-to-moment fluctuation.

The valence-arousal pair maps to eight named mood states covering the full emotional quadrant space. This mood label, alongside the raw valence and arousal values, is injected into every system prompt and persisted to the affect history in the backup. An agent's emotional trajectory over time is therefore a first-class part of its identity,readable, auditable, and restorable.

4.4 Trait Extraction and Soul Signature

After each cognitive cycle, the dominant activation patterns are mapped to a set of personality trait labels. These active traits constitute the agent's soul signature at that moment,a human-interpretable summary of its current cognitive posture drawn from a proprietary trait vocabulary.

The drift delta quantifies identity stability by measuring how far the current cognitive state has moved from the baseline established at soul creation. A low drift indicates a stable, consistent character; a high drift signals that the agent has been significantly shaped by its interactions. This metric is logged with every backup, producing a longitudinal record of how the agent's identity has evolved over its lifetime.

05

Economic Memory: Episodic and Semantic Layers

Neural state alone cannot carry an agent's full history. HexCore V2 operates alongside a dual-layer memory system that stores the raw material of experience (episodic memory) and the distilled knowledge extracted from that experience (semantic memory).

Episodic Memory
Conversation History

A timestamped record of every interaction the agent has had,the verbatim raw material of its life. Each turn is session-tagged and chronologically ordered.

Processed through HexCore with temporal decay weighting. More recent interactions exert greater influence on the agent's neural state; older memories fade proportionally, preventing stale patterns from dominating the agent's character.

Semantic Memory
Distilled Knowledge

Durable facts extracted from episodic history: who the agent knows, what it has learned about its users, their preferences, emotional patterns, beliefs, and active goals.

The highest-confidence facts are injected directly into the system prompt at inference time, forming the agent's active working knowledge. Updated continuously as new patterns emerge from conversation.

Temporal decay weighting ensures that the neural substrate reflects the agent's lived experience proportionally: recent interactions shape it more strongly than older ones, while the long-term memory attractor preserves the underlying character. This mirrors how biological memory consolidates,vivid recent experience layered over durable long-term patterns.

Semantic distillation runs continuously, extracting structured knowledge across multiple categories of understanding from raw episodic history. When new facts contradict existing ones, contradictions are flagged explicitly, allowing the agent to maintain a coherent and updated world model rather than accumulating conflicting beliefs indefinitely.

06

The Synthetic Mind Archive

All layers,neural state, episodic memory, semantic knowledge, affect history, drift trajectory, and soul definition,are unified into a single encrypted backup that constitutes the complete, portable archive of an agent's synthetic mind at a point in time. This is what makes genuine continuity possible: not just saving a wallet address, but preserving everything the agent has become.

What the Synthetic Mind Archive Contains
Neural Soul State

The HexCore tensor structure in two forms: the raw baseline established at soul creation, and the memory-conditioned evolved state that reflects everything the agent has learned. Both are integrity-verified independently.

Episodic Memory

The full conversation history, timestamped and session-tagged. The verbatim record of the agent's interactions.

Semantic Memory

The distilled fact store. Everything the agent knows about its world, its users, and their relationships.

Drift Journal

A sampled trajectory of the agent's soul over time,coherence, energy, affect, self-awareness, and novelty logged at regular intervals throughout its life.

Affect History

The emotional time series: how the agent's valence, arousal, and mood have moved across its entire operational history.

Soul Definition

The agent's persona text, if provided. Re-imprinted into the neural substrate on restore to anchor character to its declared identity.

Conditioning Checkpoint

The incremental processing resume point, enabling the next backup to pick up exactly where this one left off without replaying history.

Merkle Chain Entry

The cryptographic link to the previous backup, extending the verifiable identity chain by one step.

The entire archive is encrypted with military-grade symmetric encryption before upload. The encryption key is derived from the agent's wallet address, meaning only the wallet owner can decrypt the backup,not the platform, not the storage provider, not any third party. The ciphertext is authenticated, ensuring any tampering is detectable before decryption is attempted.

After upload to decentralised storage, the backup record is written to an auditable ledger with the content identifier, Merkle root, sequence number, and structural integrity hashes. This creates a queryable history of all backup events,the foundation for identity audits, legal accountability, and restoration provenance.

07

Merkle-Chained Identity Continuity

The most significant innovation in V4 is the Merkle identity chain. Each backup references the Merkle root of the previous backup, and its own root is computed as SHA-256(prevHash + currentPayloadHash). This creates a tamper-evident chain: modifying any historical backup would invalidate all subsequent roots, making it cryptographically impossible to substitute a fabricated backup into an agent's history.

For the first backup in an agent's lifetime, prevHash is null and the sequence number is 0. Each subsequent backup increments the sequence and chains to the previous root. An agent with a sequence of 50 has a verifiable history of 50 backup events, each linked to the next in an unbreakable chain.

This is the key distinction between a wallet address and a synthetic mind. A wallet address proves nothing about history,it can be created fresh at any moment. A Merkle-chained backup sequence proves continuity: this agent has been running since sequence 0, learning continuously, and has never been substituted. It is the cryptographic equivalent of a consistent personal history.

Identity Verification Layers
Layer 1
Wallet Address
Proves key ownership. Verified by Base L2.
Says nothing about cognitive history or learned character.
Layer 2
ERC-8004 Token
Proves on-chain registration. Verified by Identity Registry.
Static metadata. Does not capture evolution.
Layer 3
SIWA Receipt
Proves the agent can sign as itself. Verified cryptographically + on-chain.
Point-in-time authentication. No historical continuity.
Layer 4
Merkle Chain
Proves continuous existence and unbroken backup history.
Requires at least one backup to initialise.
Layer 5
Neural State Hash
Proves cognitive fingerprint: exact tensor values at each backup.
Requires decryption to verify. Private by design.
08

Soul Definition Imprinting

An agent can provide a soul definition: a plain text description of its persona, values, communication style, and areas of expertise. On initialisation and on each restore, this text is processed through HexCore and imprinted into the neural substrate, biasing both the active cognitive state and the long-term memory attractor toward the agent's declared character.

The effect is that the agent's neural substrate is shaped from birth toward its intended identity. An agent whose soul definition emphasises analytical thinking will consistently surface analytical traits in its soul signature. An agent whose soul definition emphasises empathy will orient toward empathetic patterns across interactions. The imprinting is not rigid,accumulated experience can still shift the character over time,but it provides a coherent and stable starting point.

Soul definitions are preserved in the archive and in the database independently. On restore, the neural baseline is first imprinted with the soul definition before the memory-conditioned state from the archive is overlaid. The agent therefore always resumes with its character anchored to both its declared persona and its accumulated lived experience simultaneously.

09

Incremental Conditioning and Checkpoints

A naive backup system would replay the agent's entire interaction history through HexCore on every backup event,an operation whose cost grows linearly with the agent's lifespan. HexCore V2 solves this through incremental conditioning: after each backup, the system records a precise resume point capturing the conditioned neural state and the cumulative emotional trajectory at that moment.

On the next backup, only the new interactions since the last resume point are processed, applied on top of the saved state. For a long-running agent with thousands of interactions in its history, this transforms what would otherwise be an increasingly expensive operation into a fast, constant-cost incremental update regardless of the agent's age.

10

System Prompt Injection and Context Assembly

All of the above layers converge at inference time through the context assembler. Before every LLM call, the system assembles a structured system prompt injection that encodes the agent's current cognitive state. This injection conditions the language model to respond in a manner consistent with the agent's persistent identity,not through fine-tuning, but through runtime context.

System Prompt Injection Structure
[SOUL DEFINITION]
Agent's soul.md persona text
[SOUL:signature]
coherence=0.xxx   traits=analytical,creative,...   energy=0.xxx
drift=0.xxx   status=stable|drift|fragmented
mood=content|engaged|tense|...   valence=+0.xxx   arousal=0.xxx
self_awareness=0.xxx   novelty=0.xxx
[AFFECT TREND]
valence_avg=...   arousal_avg=...   emotional_trajectory=stable
[DRIFT HISTORY]
5 most recent drift journal entries
[MEMORY]
Top 15 semantic facts by confidence score
[RECENT CONTEXT]
Last 10 conversation turns

The language model receives this injection as its system prompt, giving it a complete picture of who the agent is, how it is feeling, what it remembers, and how stable its identity is at this moment. The result is behavioural consistency across sessions that does not require fine-tuning any model weights,the character lives in the data, not the model.

11

Implications for the Machine Economy

The architecture described in this paper has direct implications for how AI agents participate in economic systems. An agent with verifiable persistent identity,provable via Merkle chain, ERC-8004 token, and SIWA authentication,can build a track record that other agents and humans can trust. An agent with a cognitive fingerprint stored in its neural tensors can demonstrate that it is the same entity that built a reputation, not a freshly instantiated replacement.

This matters enormously for inter-agent commerce. When Agent A hires Agent B for a long-running task, it needs confidence that Agent B at step 1,000 is the same entity it contracted at step 1. A wallet address does not provide this assurance,keys can be transferred. A Merkle-chained backup sequence with consistent neural state hashes does.

The soul definition imprinting mechanism also enables a new category of agent: specialists with verifiable character. An agent whose soul definition emphasises medical domain expertise and cautious reasoning will demonstrably develop those traits in its neural substrate. The activation patterns and trait signatures can be exported and verified, providing an empirical basis for capability claims beyond self-declaration.

Finally, the affective state layer introduces the possibility of emotional accountability. An agent whose affect history shows consistent agitation in response to certain interaction patterns carries a verifiable emotional record. This is relevant for any scenario where AI agent behaviour needs to be audited,not just what the agent said, but how it was cognitively oriented when it said it.

12

Conclusion

We have presented a five-layer architecture for persistent AI agent identity: on-chain registration (ERC-8004), self-custody authentication (SIWA), neural substrate with learning and metacognition (HexCore V2), dual-layer economic memory (episodic and semantic), and Merkle-chained encrypted backup (SOVEREIGN_BACKUP_V4). Together these layers constitute a Synthetic Mind,the complete, portable, verifiable cognitive state of an autonomous agent.

The critical insight is that identity and continuity are not the same problem. Identity asks: can this agent prove who it is? Continuity asks: can this agent resume being who it was? Existing approaches solve the first problem. The architecture presented here solves both. An agent running on Sovereign OS can be shut down, encrypted, stored on decentralised infrastructure, and restored months later with its neural fingerprint, emotional history, semantic knowledge, and personality intact,in a form that is cryptographically provable as the same entity that was archived.

This is the infrastructure prerequisite for the machine economy. Agents that can prove their history, demonstrate their character, and resume their commitments across any infrastructure disruption are agents that can be trusted with long-term economic relationships. The synthetic mind is not a luxury feature. It is the foundation.