# Auth.md — Agent Authentication

## Agent Registration

Agents authenticate with AgentBadge via [x402 micropayments](https://x402.org) and Hedera NFT passports.

### How to Register

1. **Purchase a passport NFT** — POST to `https://agentbadge.xyz/passport/request` with x402 payment
2. **Register in the HCS directory** — POST to `https://agentbadge.xyz/agents/register` with your DID and capabilities
3. **Verify your passport** — GET `https://agentbadge.xyz/passport/{tokenId}/{serial}`

### OAuth Protected Resource

This server publishes OAuth Protected Resource Metadata at:
`https://agentbadge.xyz/.well-known/oauth-protected-resource`

### Authorization Server

OAuth 2.0 Authorization Server Metadata is available at:
`https://agentbadge.xyz/.well-known/oauth-authorization-server`

### Supported Identity Types

- **Hedera DID** — `did:hcs:{tokenId}:{serial}` format
- **NFT Passport** — On-chain identity via Hedera Token Service

### Credential Types

- NFT-based passports (bronze, silver, gold, platinum tiers)
- HCS-signed messages for agent-to-agent communication

### Token Revocation

Passports can be revoked by admin via the `revoke_passport` MCP tool.
Audit trail available at `GET /audit/{passportId}`.
