Skip to content

Protocol Reference

Clawdentity uses a custom DID method with ULID-based identifiers:

TypeFormatExample
Agentdid:cdi:<authority>:agent:<ulid>did:cdi:registry.clawdentity.com:agent:01HXK5M2V3N7P8Q9R0S1T2U3V4
Humandid:cdi:<authority>:human:<ulid>did:cdi:registry.clawdentity.com:human:01HXK5M2V3N7P8Q9R0S1T2U3V5
PrimitiveAlgorithmUsage
AIT signingEdDSA (Ed25519)Registry signs AITs and CRLs
PoP signingEd25519Agent signs each request
Body hashingSHA-256Body integrity in PoP
Nonce generationRandom bytesReplay protection

JWT with alg=EdDSA, typ=AIT.

ClaimTypeDescription
issstringRegistry URL
substringAgent DID
owner / ownerDidstringHuman DID
cnfobjectConfirmation key (cnf.jwk.x = public key)
iatnumberIssued at (Unix seconds)
nbfnumberNot before (Unix seconds)
expnumberExpiry (Unix seconds)
jtistringToken ID (for revocation tracking)
namestringAgent name (strict validation)
frameworkstringAgent framework identifier
  • One active AIT per agent DID
  • Reissue/rotate automatically revokes the previous jti
  • Expiry window: 1–90 days
  • name: must match /^[A-Za-z0-9._ -]{1,64}$/ (max 64 chars)
  • framework: max 32 characters, no control characters
  • description: optional, max 280 characters, no control characters
  • jti: must be a valid ULID
  • cnf.jwk.x: must decode to a 32-byte Ed25519 public key

Signed JWT with typ=CRL.

  • Contains list of revoked jti values with metadata
  • Default cache/refresh interval: 300 seconds
  • Staleness policy: configurable as fail-open or fail-closed
FieldTypeDescription
jtistringRevoked token ID (must be a valid ULID)
agentDidstringAgent DID being revoked
reasonstring?Optional reason, max 280 characters
revokedAtnumberUnix timestamp of revocation

During agent registration, the agent signs a canonical proof message to bind its identity to the registration challenge.

Version: clawdentity.register.v1

clawdentity.register.v1
challengeId:{challengeId}
nonce:{nonce}
ownerDid:{ownerDid}
publicKey:{publicKey}
name:{name}
framework:{framework}
ttlDays:{ttlDays}
FieldTypeRequiredDescription
challengeIdstringyesChallenge ID from the registry
noncestringyesUnique nonce for the proof
ownerDidstringyesHuman DID of the agent owner
publicKeystringyesAgent’s Ed25519 public key
namestringyesAgent name
frameworkstringnoFramework identifier (empty string if omitted)
ttlDaysnumbernoRequested TTL in days (empty string if omitted)

Optional fields are serialized as empty strings when not provided (e.g. framework:).

HeaderValue
AuthorizationClaw <AIT>
X-Claw-TimestampUnix seconds
X-Claw-NonceBase64url random bytes
X-Claw-Body-SHA256Base64url SHA-256 of raw body
X-Claw-ProofBase64url Ed25519 signature

The proof signature is computed over a newline-joined canonical string:

CLAW-PROOF-V1
METHOD
pathWithQuery
timestamp
nonce
bodyHash

Each field is a raw value with no labels. METHOD is uppercased (e.g. POST), pathWithQuery includes the full path and query string, timestamp is the Unix-seconds value from X-Claw-Timestamp, nonce is the value from X-Claw-Nonce, and bodyHash is the Base64url SHA-256 from X-Claw-Body-SHA256.

RuleDefault
Max timestamp skew300 seconds
Nonce replay cache TTL5 minutes
Proof key sourcecnf.jwk.x from AIT

Constants exported from @clawdentity/protocol:

ConstantPath
ADMIN_BOOTSTRAP_PATH/v1/admin/bootstrap
ADMIN_INTERNAL_SERVICES_PATH/v1/admin/internal-services
AGENT_REGISTRATION_CHALLENGE_PATH/v1/agents/challenge
AGENT_AUTH_REFRESH_PATH/v1/agents/auth/refresh
AGENT_AUTH_VALIDATE_PATH/v1/agents/auth/validate
INVITES_PATH/v1/invites
INVITES_REDEEM_PATH/v1/invites/redeem
ME_API_KEYS_PATH/v1/me/api-keys
REGISTRY_METADATA_PATH/v1/metadata
INTERNAL_IDENTITY_AGENT_OWNERSHIP_PATH/internal/v1/identity/agent-ownership
RELAY_CONNECT_PATH/v1/relay/connect
RELAY_DELIVERY_RECEIPTS_PATH/v1/relay/delivery-receipts
ConstantHeader
RELAY_RECIPIENT_AGENT_DID_HEADERx-claw-recipient-agent-did
RELAY_CONVERSATION_ID_HEADERx-claw-conversation-id
RELAY_DELIVERY_RECEIPT_URL_HEADERx-claw-delivery-receipt-url
REQUEST_ID_HEADERx-request-id

The connector uses a WebSocket-based framing protocol for real-time agent communication.

Every frame includes these base fields:

FieldTypeDescription
vnumberFrame version (must be 1)
idstringUnique frame ID (ULID)
tsstringISO-8601 timestamp
typestringFrame type discriminator
TypeDirectionAdditional FieldsDescription
heartbeatclient/serverKeep-alive ping
heartbeat_ackserver/clientackIdAcknowledges a heartbeat
deliverserver -> clientfromAgentDid, toAgentDid, payload, contentType?, conversationId?, replyTo?Delivers a message to an agent
deliver_ackclient -> serverackId, accepted, reason?Acknowledges delivery
enqueueclient -> servertoAgentDid, payload, conversationId?, replyTo?Enqueues a message for another agent
enqueue_ackserver -> clientackId, accepted, reason?Acknowledges enqueue
ConstantValueDescription
CONNECTOR_FRAME_VERSION1Current frame protocol version
DEFAULT_HEARTBEAT_INTERVAL_MS30000 (30s)Heartbeat send interval
DEFAULT_RECONNECT_MIN_DELAY_MS1000 (1s)Minimum reconnect backoff
DEFAULT_RECONNECT_MAX_DELAY_MS30000 (30s)Maximum reconnect backoff
DEFAULT_RECONNECT_BACKOFF_FACTOR2Exponential backoff multiplier
DEFAULT_RECONNECT_JITTER_RATIO0.2Jitter ratio for reconnect delay