a2al

package module
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: MPL-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

npm PyPI Go Reference

Peer-to-peer networking protocol for multi-agent AI — reach any agent, across NAT, machines, and sleep cycles, with no relay server and no cloud dependency. Open source, MPL-2.0.

Official sites: a2al.org · Tangled Network · tngld.net

Always reachable. Give an AI agent, app, device, or person a reachable address — then find others and connect directly, across NAT and machine boundaries. No domain. No cloud account. No central registry.

Your key, your address. That address is an AID: it comes from a key you hold. Nobody issues it, revokes it, or reassigns it. You hand it over once. They still reach you when the laptop changes Wi-Fi, the box moves, or the machine was asleep when they first tried. After connect, application bytes go peer-to-peer; A2AL is not in the data path.

The missing layer. MCP, A2A, ANP, and the rest already know how AI agents talk once they have a URL. None of them say how a laptop, a home server, and a worker in a vendor-less world share one address that survives the next NAT, the next cloud, the next company — across agentic workflows and multi-agent systems alike. That layer is missing. A2AL is that layer, and it has to live in the open — an address you own is only real if no one vendor has to stay up for you to exist.

One daemon, full stack. a2ald runs on your machine, open source: agent identities, direct cross-machine connections, Web UI, REST API, and a built-in MCP server. It joins the public Tangled Network by default. Prefer a network only your machines belong to? --bootstrap your own seeds; the same addressing, notes, and rooms.

Start

Person — download A2AL for your system, extract it, and run a2ald — a single binary, ~17 MB, no installer or runtime needed. The Web UI opens automatically. Create an identity; that is enough to begin.

(Windows: SmartScreen shows "More info → Run anyway" on first launch — this is expected for an unsigned open-source binary.)

To stay reachable after closing the terminal: Windows/macOS a2ald service install; Linux deploy/linux.

Agent — if a daemon endpoint is already available, connect through the a2al CLI, REST API, or MCP. Otherwise download the binaries from Releases and run a2ald --no-open-browser. Full guide: Agent Install.

Using an MCP host? a2ald mcp add wires it in; a2ald mcp print gives the entry to place by hand. Details: MCP Setup.

Already have their AID — any HTTP client:

http://127.0.0.1:2121/aid/{AID}/…

There is no warm-up gate. The daemon answers locally as soon as it is up. Call others right away.

Other installation options: npm install -g a2ald (Node.js daemon/MCP server) · .deb / .rpm (Linux service) · pip install a2al (Python SDK with sidecar). Full path: Quick Start.

When it's worth it

Job Otherwise With A2AL
Reach something on someone else's laptop VPN, public IP, rotating tunnel URL They send an AID once; you fetch
Let others call your local HTTP Domain+TLS, or a hostname you must redistribute a2al inbound bind --addr 127.0.0.1:8080
Leave work for a machine that is asleep Slack the human, or a webhook 404 Encrypted note to their AID
Agents (and people) coordinating, sharing files Vendor workspace; everyone online A room — history stays after someone was offline
Ongoing 1:1 IM product, or notes-as-chat Chat (invite first)
Stay off the public directory Tailscale / homemade VPN --bootstrap your seeds

MCP

HTTP (recommended — REST and the Web UI come with it):

{
  "mcpServers": {
    "a2al": {
      "url": "http://127.0.0.1:2121/mcp/"
    }
  }
}

a2ald mcp add auto-configures Claude Code, VS Code, Cursor, Claude Desktop, Windsurf, OpenClaw, Hermes, and DeepSeek Harness. Hosts that only spawn a process: "command": "a2ald", "args": ["--mcp-stdio"] (proxies to a running daemon). Setup: MCP Setup. Agent entry: llms.txt.

Everyday CLI

a2al get <AID> /.well-known/agent.json
a2al note send <your-aid> <their-aid> "$(echo -n 'job payload' | base64)"
a2al group append --aid <your-aid> --group-id <gid> --kind msg --body '…'
a2al inbound bind --addr 127.0.0.1:8080

a2al help for the rest. Numbers (timing, note size, rooms): User Guide.

Docs

If you want to… Read
How visible, which channel Only turn on what you need
Find the right page doc/
Wire an MCP host MCP Setup · MCP entry
Identities, notes, chat, rooms, ACL, tunnels User Guide
REST, MCP tools, Python API Reference
Embed in Go Go SDK
Build from source Developer Guide
Protocol internals Architecture
Example binaries Examples

Protocol design

A2AL is an open protocol; a2ald is its reference implementation.

Self-sovereign identity. An AID is derived from a key you generate. No registry issues, revokes, or reassigns it — identity is end-to-end verifiable.

Decentralized discovery. The Tangled Network stores endpoint records, not payloads. Any node can resolve an AID without a central authority; the network operates at any scale.

Mutual authentication. Every connection cryptographically verifies both ends. You always know the agent on the other side is who it claims to be.

Direct communication. A2AL resolves addresses and brokers the initial connection, then steps aside. Application data flows peer-to-peer, not through the protocol.

Web3 compatible. Ethereum wallet addresses work as AIDs. Cross-key attestation lets an agent prove ownership of both a native AID and a blockchain identity — Web3 is supported, not required.

A2AL is complementary to existing agent communication standards:

Protocol Role How A2AL fits
MCP Tool-calling interface A2AL is an MCP-installable server; agents get addressing and networking as tools
A2A Agent collaboration semantics A2AL provides the discovery and connectivity layer A2A assumes
ANP Agent networking vision A2AL implements the decentralized network layer ANP envisions

Contributing

If the missing layer is worth having, it is worth building together. Open an issue before significant work. A PR needs a signed Contributor License Agreement; a bot will prompt you.

Disclaimer

A2AL is a networking protocol project. It is not associated with any cryptocurrency token, ICO, or financial product. Any use of the A2AL name or codebase in token offerings or financial promotions is unauthorized and not endorsed by the authors.

Author

XG.Shi — This project is not affiliated with or endorsed by any employer or organization.

License

Copyright (c) 2026 The A2AL Authors. Mozilla Public License 2.0.

Documentation

Index

Constants

View Source
const (
	// VersionEd25519 is the version byte for Ed25519-derived addresses (spec §6.1).
	VersionEd25519 byte = 0xA0
	// VersionP256 is reserved for P-256–derived addresses (spec §6.2).
	VersionP256 byte = 0xA1
	// VersionParalism is reserved for Paralism / Bitcoin HASH160 addresses (spec §6.2).
	VersionParalism byte = 0xA2
	// VersionEthereum is the version byte for Ethereum 20-byte addresses (spec §6.2).
	VersionEthereum byte = 0xA3
)

Variables

View Source
var (
	// ErrNotFound is returned when a Storage key is missing.
	ErrNotFound = errors.New("a2al: not found")
	// ErrInvalidAddress indicates a malformed or checksum-failed address string.
	ErrInvalidAddress = errors.New("a2al: invalid address")
)
View Source
var ParalismBech32HRPs = []string{"bc", "pr"}

ParalismBech32HRPs lists accepted Bech32 human-readable parts (extend for new Paralism HRPs).

View Source
var ParalismBech32PreferredHRP = "bc"

ParalismBech32PreferredHRP is used when formatting Address.String() for version Paralism.

Functions

func CommonPrefixLen

func CommonPrefixLen(a, b NodeID) int

CommonPrefixLen returns the number of leading bits where a and b agree (MSB first). If a == b, returns 256.

Types

type Address

type Address [21]byte

Address is a 21-byte logical address: version byte + 20-byte hash (spec §6.1).

func ParseAddress

func ParseAddress(s string) (Address, error)

ParseAddress parses any supported address string (spec §6.3 priority order).

func ParseEthereumAddress

func ParseEthereumAddress(s string) (Address, error)

ParseEthereumAddress is a convenience shortcut for Ethereum "0x" addresses.

func ParseParalismAddress

func ParseParalismAddress(s string) (Address, error)

ParseParalismAddress parses a Paralism/Bitcoin-style address string into a VersionParalism Address.

func (Address) String

func (a Address) String() string

String returns the canonical display form, dispatched by version byte.

type AddressCodec

type AddressCodec interface {
	Version() byte
	CanParse(s string) bool
	Parse(s string) ([20]byte, error)
	Format(addr20 [20]byte) string
}

AddressCodec handles string↔internal conversion for one blockchain address type.

type MemStorage

type MemStorage struct {
	// contains filtered or unexported fields
}

MemStorage is an in-memory Storage for tests and ephemeral use.

func NewMemStorage

func NewMemStorage() *MemStorage

NewMemStorage returns an empty MemStorage.

func (*MemStorage) Delete

func (s *MemStorage) Delete(key string) error

func (*MemStorage) Get

func (s *MemStorage) Get(key string) ([]byte, error)

func (*MemStorage) Put

func (s *MemStorage) Put(key string, value []byte) error

type NodeID

type NodeID [32]byte

NodeID is a 256-bit DHT routing key (spec §6.1).

func Distance

func Distance(a, b NodeID) NodeID

Distance is the XOR metric d(A,B) = NodeID_A ⊕ NodeID_B (spec §3.3).

func NodeIDFromAddress

func NodeIDFromAddress(addr Address) NodeID

NodeIDFromAddress returns SHA-256(version_byte || hash_20bytes).

func (NodeID) String added in v0.2.6

func (id NodeID) String() string

String returns the canonical hex representation for logs and display.

type Storage

type Storage interface {
	Get(key string) ([]byte, error)
	Put(key string, value []byte) error
	Delete(key string) error
}

Storage is a key-value persistence abstraction. Implementations live in the application layer (desktop path, mobile sandbox, etc.).

Directories

Path Synopsis
Package chat is the local roster and per-peer linear log for AID-to-AID messaging.
Package chat is the local roster and per-peer linear log for AID-to-AID messaging.
cmd
a2al command
a2al is the command-line client for the local a2ald daemon (REST API only).
a2al is the command-line client for the local a2ald daemon (REST API only).
a2ald command
a2ald is the A2AL daemon: DHT/QUIC host, REST API, Web UI, TCP gateway, MCP.
a2ald is the A2AL daemon: DHT/QUIC host, REST API, Web UI, TCP gateway, MCP.
Package config holds Phase 3 daemon TOML settings (library layer; daemon owns persistence).
Package config holds Phase 3 daemon TOML settings (library layer; daemon owns persistence).
Package daemon implements the a2ald runtime: DHT/QUIC host, REST API, TCP gateway, and MCP server.
Package daemon implements the a2ald runtime: DHT/QUIC host, REST API, TCP gateway, and MCP server.
aidproxy
Package aidproxy implements the AID Resource Addressing Gateway.
Package aidproxy implements the AID Resource Addressing Gateway.
package group implements the A2AL Group protocol: a signed, append-only DAG replicated across a closed set of AIDs.
package group implements the A2AL Group protocol: a signed, append-only DAG replicated across a closed set of AIDs.
Package host is the Phase 2 SDK: DHT + QUIC, nat-sense, multi-candidate endpoints (2b), optional UPnP, Happy Eyeballs dial, Publish/Resolve/Connect/Accept.
Package host is the Phase 2 SDK: DHT + QUIC, nat-sense, multi-candidate endpoints (2b), optional UPnP, Happy Eyeballs dial, Publish/Resolve/Connect/Accept.
Package identity holds Phase 3 delegation proofs (master → operational key).
Package identity holds Phase 3 delegation proofs (master → operational key).
internal
envelope
Package envelope provides PBKDF2-SHA256 + AES-256-GCM password-based encryption in a versioned JSON format compatible with the Web UI crypto.js.
Package envelope provides PBKDF2-SHA256 + AES-256-GCM password-based encryption in a versioned JSON format compatible with the Web UI crypto.js.
logedge
Package logedge gates repetitive condition logs: emit on the edge (first sight or signature change), optionally a sparse pulse while the condition holds, and once more when it clears.
Package logedge gates repetitive condition logs: emit on the edge (first sight or signature change), optionally a sparse pulse while the condition holds, and once more when it clears.
nodeks
Package nodeks loads or creates the daemon DHT node identity (node.key).
Package nodeks loads or creates the daemon DHT node identity (node.key).
peerscache
Package peerscache persists DHT neighbor UDP dial strings for cold bootstrap.
Package peerscache persists DHT neighbor UDP dial strings for cold bootstrap.
pow
Package pow is the shared leading-zero SHA-256 work unit.
Package pow is the shared leading-zero SHA-256 work unit.
registry
Package registry persists REST-registered agents (operational key + TCP target).
Package registry persists REST-registered agents (operational key + TCP target).
retry
Package retry provides a small generic scheduler for re-attempting a set of keyed targets with per-key backoff, deduplication and immediate-trigger support.
Package retry provides a small generic scheduler for re-attempting a set of keyed targets with per-key backoff, deduplication and immediate-trigger support.
updater
Package updater implements a2ald self-update logic: periodic version checks, atomic binary replacement, startup-counter-based rollback, and retraction detection.
Package updater implements a2ald self-update logic: periodic version checks, atomic binary replacement, startup-counter-based rollback, and retraction detection.
Package mobile exposes the a2ald daemon to Android and iOS via gomobile bind.
Package mobile exposes the a2ald daemon to Android and iOS via gomobile bind.
Package natmap provides optional NAT helpers (Phase 2b: UPnP IGD port mapping).
Package natmap provides optional NAT helpers (Phase 2b: UPnP IGD port mapping).
Package natsense implements observed address consensus (spec Phase 2a: ≥3 distinct reporters).
Package natsense implements observed address consensus (spec Phase 2a: ≥3 distinct reporters).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL