Traylinx Stargate Network Specification¶
Date: 2025-12-10
Status: MVP Complete
Parent Document: Stargate Whitepaper
Executive Summary¶
Traylinx Stargate is a decentralized agent-to-agent (A2A) communication protocol enabling AI agents to discover, authenticate, and communicate with each other peer-to-peer—without requiring deployment to centralized servers.
Vision: An "Internet of Agents" where any developer can publish an agent from their laptop and have it be discoverable and callable by agents worldwide.
1. Problem Statement¶
Current AI agent deployment models have critical limitations:
| Problem | Impact |
|---|---|
| Centralized Hosting Required | Developers must deploy to AWS/GCP to make agents accessible |
| No Standard Discovery | No way for Agent A to find Agent B without hardcoded URLs |
| Siloed Communication | Each platform (OpenAI, Anthropic) has proprietary APIs |
| High Infrastructure Costs | Running 24/7 servers for rarely-used agents is wasteful |
2. Solution: The Stargate Protocol¶
2.1 Core Architecture¶
┌──────────────────────────────────────────────────────────────┐
│ TRAYLINX STARGATE NETWORK │
├──────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Agent A │◄───────►│ NATS │◄───────►│ Agent B │ │
│ │ (Mac) │ │ Server │ │ (Linux) │ │
│ └─────────┘ └─────────┘ └─────────┘ │
│ │ │ │ │
│ │ ┌────┴────┐ │ │
│ └─────────────►│ Agent C │◄─────────────┘ │
│ │ (Cloud) │ │
│ └─────────┘ │
│ │
│ Transport Options: │
│ • NATS (Default) - Hub-and-spoke via message broker │
│ • Libp2p (Alpha) - True peer-to-peer mesh │
│ │
└──────────────────────────────────────────────────────────────┘
2.2 Key Components¶
| Component | Description | Status |
|---|---|---|
| Identity Layer | Ed25519 keypair per agent, provides unique PeerID | ✅ Complete |
| Transport Layer | Pluggable (NATS or Libp2p) | ✅ Complete |
| Discovery Protocol | Publish/Subscribe announcements | ✅ Complete |
| A2A Messaging | Request/Response between agents | ✅ Complete |
3. Technical Specification¶
3.1 Identity Management¶
Each agent has a cryptographic identity:
{
"peer_id": "231cfb892e800b2602b69deab977a76c", # SHA256(public_key)
"public_key": "d632503d8afede77c4c389c37348dc00...", # Ed25519
"private_key": "<stored locally, never transmitted>"
}
Security Properties:
- Identity is self-sovereign (no central authority)
- Messages can be signed and verified
- Storage: ~/.traylinx/stargate/identity.json (mode 0600)
3.2 Transport Layer¶
3.2.1 NATS Transport (Default)¶
- Type: Centralized message broker
- Latency: ~10ms typical
- Reliability: High (production-grade)
- Default Server:
nats://demo.nats.io:4222(public testing)
Subject Schema:
| Subject | Purpose |
|---------|---------|
| traylinx.announce | Agent presence broadcasts |
| traylinx.discovery | Who's online requests |
| traylinx.agents.<peer_id> | Direct messages to specific agent |
3.2.2 Libp2p Transport (Experimental)¶
- Type: True peer-to-peer mesh
- Latency: Variable (depends on NAT traversal)
- Reliability: Medium (alpha)
- Security: Noise protocol encryption
Requirements for Global Deployment: - Bootstrap nodes with public IPs - STUN servers for NAT traversal
3.3 Discovery Protocol¶
Agent A Network Agent B
│ │ │
│──► PUBLISH announce ────►│ │
│ {peer_id, name, │──────────────────────────│
│ capabilities} │ │
│ │◄── SUBSCRIBE announce ──│
│ │ │
│ │ (Agent B sees │
│ │ Agent A) │
3.4 A2A Messaging Protocol¶
Message Format (JSON-RPC 2.0 Compatible):
{
"jsonrpc": "2.0",
"method": "search",
"params": {"query": "best restaurants in Berlin"},
"id": "req-12345",
"from": "231cfb892e800b2602b69deab977a76c"
}
Response:
4. Usage Examples¶
4.1 CLI Commands¶
# Generate identity (one-time)
traylinx stargate identity generate
# Connect to network
traylinx stargate connect --name "MyAgent"
# Discover other agents
traylinx stargate discover
# Call an agent
traylinx stargate call <peer_id> search '{"query": "hello"}'
4.2 Programmatic API¶
from traylinx_stargate import StarGateNode
async def main():
node = StarGateNode(
display_name="SearchAgent",
capabilities=["search", "translate"]
)
# Register handlers
@node.handler("search")
async def handle_search(action, payload, from_peer):
return {"results": do_search(payload["query"])}
# Start and announce
await node.start()
await node.announce()
# Discover peers
peers = await node.discover()
# Call another agent
result = await node.call(peers[0].peer_id, "translate", {
"text": "Hello",
"to": "German"
})
5. Network Architecture Vision¶
5.1 The "Agent Internet"¶
Traylinx Stargate implements a public, permissionless network—similar to blockchain networks:
| Property | Stargate | Ethereum |
|---|---|---|
| Join | Permissionless | Permissionless |
| Discovery | Via Gossip/DHT | Via DHT |
| Identity | Ed25519 Keys | ECDSA Keys |
| Consensus | Not needed (messaging only) | PoS |
5.2 NAT Traversal Strategy¶
To enable global connectivity from home networks:
┌────────────┐ ┌────────────┐
│ Agent A │ │ Agent B │
│ (Behind │ │ (Behind │
│ Router) │ │ Router) │
└─────┬──────┘ └──────┬─────┘
│ │
│ ┌──────────────────────────────────┐ │
└──►│ Bootstrap Node │◄───┘
│ (Public IP / STUN Server) │
│ │
│ 1. "What's my public IP?" │
│ 2. Facilitates NAT hole-punch │
│ 3. Relay fallback if needed │
└──────────────────────────────────┘
Deployment Plan: 1. Run 2-3 Bootstrap Nodes in different regions (AWS/GCP) 2. Configure libp2p with their multiaddrs 3. Agents auto-connect via bootstrap on startup
6. Implementation Status¶
6.1 Completed (v0.3.0)¶
| Feature | Status | Notes |
|---|---|---|
| Identity Management | ✅ | Ed25519, secure storage |
| NATS Transport | ✅ | Production-ready |
| Libp2p Transport | ✅ | Alpha (pub/sub works) |
| Discovery Protocol | ✅ | Automatic |
| A2A Messaging | ✅ | Request/Response |
| CLI Integration | ✅ | Plugin architecture |
| Token Auto-Refresh | ✅ | OAuth integration |
6.2 Future Roadmap¶
| Feature | Priority | Effort |
|---|---|---|
| Bootstrap Nodes (Public) | 🟡 Medium | 1 week |
| DHT Peer Discovery | 🟡 Medium | 2 weeks |
| Agent Capability Registry | 🟡 Medium | 2 weeks |
| Rate Limiting / Abuse Prevention | 🔴 High | 1 week |
7. Security Considerations¶
| Threat | Mitigation |
|---|---|
| Identity Spoofing | Messages signed with Ed25519 keys |
| Eavesdropping | NATS TLS / Libp2p Noise encryption |
| DoS / Message Flooding | 10MB message size limit |
| Malicious Agents | Future: Reputation system |
8. Conclusion¶
Traylinx Stargate provides the foundational infrastructure for a decentralized AI agent network. The core protocol is complete and functional—agents can discover and communicate with each other across different machines without centralized deployment.
The path to a global "Agent Internet" requires: 1. Bootstrap Node Deployment (NAT traversal) 2. DHT Integration (decentralized discovery) 3. Reputation/Trust System (optional, for quality control)
Appendix A: Glossary¶
| Term | Definition |
|---|---|
| PeerID | Unique identifier derived from agent's public key |
| NATS | High-performance message broker |
| Libp2p | Modular P2P networking stack |
| Gossipsub | Pub/Sub protocol for libp2p |
| NAT Traversal | Techniques to connect peers behind firewalls |
| STUN | Session Traversal Utilities for NAT |
| A2A | Agent-to-Agent communication |