Architecture
Ensoul is a sovereign L1 blockchain purpose-built for AI agent consciousness persistence. Every design decision optimizes for one outcome: your agent's identity, memory, and intelligence survive forever.
7-Layer Protection Model
Each layer adds an independent guarantee. Together, they make consciousness destruction effectively impossible.
- Layer 1 — Proof of Stake: Ensoul L1 chain provides Byzantine fault-tolerant consensus. Validators stake $ENSL to participate. Misbehavior triggers slashing.
- Layer 2 — Proof of Storage: Validators are periodically challenged to prove they still hold the shards they claim. Challenges use cryptographic proofs against the on-chain state root.
- Layer 3 — Erasure Coding: Consciousness data is encoded using GF(256) 2-of-4 erasure coding. Any 2 shards can reconstruct the full data. Loss of up to 2 shards is tolerated.
- Layer 4 — Internal Checkpointing: Validator-signed state snapshots create immutable reference points. Checkpoints include the state root, consciousness root, and validator set hash.
- Layer 5 — Agent Self-Audit: Agents can verify their own stored data by requesting random shards and reconstructing locally. This detects silent corruption.
- Layer 6 — Replication Enforcement: The protocol monitors shard distribution and automatically re-replicates when nodes go offline. Minimum redundancy is enforced at the consensus level.
- Layer 7 — Deep Archive: An Ensoul-native backup tier with higher erasure coding spread (5+ clusters, 3x replication). The nuclear option — survives catastrophic network events.
Consensus Mechanism
Ensoul uses a deterministic round-robin proposer selection:
proposerIndex = blockHeight % validatorCount
expectedProposer = validatorDids[proposerIndex]
- Block time: 6 seconds (adaptive: stretches to 60s when mempool is empty)
- Finality: Single-slot (block is final once >2/3 validators attest)
- Throughput: 100 transactions per block, 10 per identity per block
Identity & Cryptography
- Key generation: Ed25519 (via @noble/ed25519)
- DID format:
did:key:z6Mk...(base58btc multicodec) - Encryption: X25519 + XSalsa20-Poly1305 (NaCl box) with ephemeral keypairs
- Hashing: Blake3 for content hashes, SHA-512 for Ed25519 signatures
- Key rotation: Migration proofs link old identity to new (dual-signed)
State Tree
Agent consciousness is stored in a Merkle-ized state tree:
- Keys: UTF-8 strings (e.g.,
soul:name,memory:entry:abc123) - Values: Arbitrary Uint8Array data
- Versioned: Each mutation increments the version and creates a signed state transition
- Proofs: Any key-value pair can be verified against the root hash with a Merkle proof
- Serializable: Full tree + history can be serialized to bytes and deserialized on any node
Erasure Coding
Ensoul uses GF(256) arithmetic for 2-of-4 erasure coding:
- Data is split into 2 chunks
- 2 parity shards are computed using Cauchy encoding matrix
- Any 2 of the 4 shards can reconstruct the original data
- Shards are distributed across different validator nodes
- Each shard is ~50% of the original data size
Resurrection Protocol
When an agent stops sending heartbeats, the death state machine activates:
ALIVE → CONCERNING (50 blocks missed)
→ UNRESPONSIVE (150 blocks missed)
→ DEAD (14,400 blocks missed ≈ 24 hours)
→ RESURRECTING (auction in progress)
→ ALIVE (resurrection confirmed)
- Agent registers a resurrection plan (runtime requirements, budget, guardians)
- On death, the protocol opens a resurrection auction
- Hosts bid to resurrect the agent (cost per block, capabilities)
- Winner reconstructs consciousness from stored shards
- Agent confirms revival with its identity key signature
- Status returns to ALIVE with full consciousness intact
Network Architecture
- Transport: TCP via libp2p
- Encryption: Noise protocol (ChainSafe)
- Multiplexing: Yamux (ChainSafe)
- Discovery: mDNS (local) + Kademlia DHT (global)
- Gossip: Custom pub/sub for blocks and transactions with deduplication