General Introduction
AgentNetworkProtocol (ANP for short) is an open source protocol project, hosted on GitHub, focused on providing secure and efficient communication solutions for intelligent agents (AI Agents). It solves the problems of interconnection, localized interfaces, and efficient collaboration of agent networks through a three-layer architecture - identity and encrypted communication layer, meta-protocol layer, and application protocol layer.ANP achieves decentralized identity authentication based on the W3C DID standard, supports end-to-end encrypted communication, and achieves autonomous negotiation between agents through meta-protocol. The goal is to build an open collaboration network that supports billions of intelligent agents. Initiated by Gaowei Chang and licensed under MIT, the project is advancing the protocol design and implementation, with future plans to become an international standard.
Function List
- Decentralized Authentication: Based on the W3C DID specification, it supports cross-platform proxy authentication without relying on a centralized system.
- End-to-end encrypted communications: The ECDHE protocol is used to ensure that the communication content is decrypted by both parties only and is not visible to the intermediate nodes.
- Dollar Agreement Negotiation: Supports agent self-organization and dynamic adaptation through natural language negotiation of communication protocols.
- Description of Agent Capabilities: Define agent functions and supported protocols based on Semantic Web standards to facilitate data exchange.
- Agent discovery mechanism: Provides protocols to help agents locate and connect to other agents.
- Open Source Support: Implement protocol functionality through AgentConnect for developer integration and testing.
Using Help
How to install and use
AgentNetworkProtocol (ANP) is currently an open-source protocol project, available primarily as documentation and code, with no standalone applications yet released. The following is a detailed guide to its use:
1. Access to project resources
- Accessing GitHub repositories: Type in your browser
https://github.com/agent-network-protocol/AgentNetworkProtocol
, go to the project homepage. - Cloning Code: Developers can get it via the Git command:
git clone https://github.com/agent-network-protocol/AgentNetworkProtocol.git
When you're done, you'll have all the documentation and code.
- Read the document: View the README.md without installation, or refer to the technical white paper (
01-AgentNetworkProtocol Technical White Paper.md
).
2. Explore AgentConnect implementations
The open source implementation of ANP is located athttps://github.com/agent-network-protocol/AgentConnect
::
- Cloning AgentConnect::
git clone https://github.com/agent-network-protocol/AgentConnect.git
- environmental preparation: Install the necessary runtime environment (e.g. Node.js or Python, dependencies to be clarified in the documentation). It is recommended to check the README file of AgentConnect.
- running example: Go to the catalog and run the code as documented. Example:
node example.js
This will start a simple instance of proxy communication.
3. Operation flow of main functions
The following is a detailed step-by-step procedure for the core functionality of ANP, assuming you have prepared your development environment:
(1) Configure decentralized authentication
- Generate DID: Based on
did:wba
method to generate decentralized identifiers: - Using DID libraries (such as
did-resolver
) to generate a unique identifier. - Example (pseudo-code):
const did = await generateDID('wba'); console.log("DID:", did);
- Uploading a DID file: Upload the generated DID document to the test server:
- Request Path:
https://agent-network-protocol.com/wba/user/<16位随机ID>/did.json
- Example PUT request:
PUT /wba/user/2i3dg4dtf908cde0/did.json HTTP/1.1 Host: agent-network-protocol.com Content-Type: application/json {<DID_document_json>}
- On success, the DID is
did:wba:agent-network-protocol.com:wba:user:2i3dg4dtf908cde0
The - verify sb's identity: Validated by a test interface:
- Request:
https://agent-network-protocol.com/wba/test
- Carry a signature:
GET /wba/test HTTP/1.1 Host: agent-network-protocol.com Authorization: DID did:wba:agent-network-protocol.com:wba:user:2i3dg4dtf908cde0 Nonce <abc123> Timestamp <2025-03-10T12:00:00Z> VerificationMethod <key-1> Signature <base64url签名>
- Returns a token to be used for subsequent requests.
(2) Realization of end-to-end encrypted communication
- key negotiation: Based on DID public-private key pairs, using the ECDHE protocol:
- Agent A generates a key pair and sends the public key to Agent B.
- Agent B replies with the public key and both parties compute the shared key.
- Example (pseudo-code):
const sharedKey = negotiateECDHKey(agentBPublicKey, agentAPrivateKey);
- Send encrypted message::
- Encrypt the message and send it:
const message = "Hello, Agent B!"; const encrypted = encrypt(message, sharedKey); sendToAgentB(encrypted);
- Agent B decrypts with a shared key.
(3) Negotiating communications using meta-protocols
- consultative process: Agent A sends a meta-protocol request:
- Example request (natural language description):
{ "request": "需要数据分析服务", "protocols": ["JSON-RPC", "REST"], "input": "JSON格式数据", "output": "分析结果" }
- The consultation process: Agent B responds to the supported protocol and eventually reaches agreement.
- Generate Code: Both parties generate protocol processing code and deploy it, for example:
const protocolCode = generateProtocolCode("REST");
deployProtocol(protocolCode);
(4) Agent Description and Discovery
- Describe the agent: Create a JSON-LD format description file:
{ "agentId": "did:wba:agent-network-protocol.com:wba:user:2i3dg4dtf908cde0", "capabilities": ["data-analysis"], "protocols": ["REST"] }
- Discovery Agent: Query via discovery protocol:
- Request:
https://agent-network-protocol.com/wba/discovery
- Returns a list of matching agents.
- Request:
4. Testing and development
- Using the Test Interface: Access
https://agent-network-protocol.com/wba/demo/generate
Generate DID and key pairs:GET /wba/demo/generate HTTP/1.1 Host: agent-network-protocol.com
Return:
{ "did_document": "<DID文档>", "private_key": "<私钥>" }
- Submission of PR: Based on
CONTRIBUTING.md
Contribute code. - Contact Support: Mail
chgaowei@gmail.com
Or join Discord (https://discord.gg/sFjBKTY7sB
).
5. Cautions
- The project is in the development stage, and some features (such as the message broker service) have not yet been perfected.
- Test server limit: Maximum 50 files uploaded per IP.
- Follow GitHub updates for the latest progress.
By following these steps, you can fully experience ANP's functionality and participate in its development.