
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@agentcommercekit/ack-id
Advanced tools
Verifiable Identity for Agent Interactions
The Agent Commerce Kit Identity Protocol (ACK-ID) TypeScript SDK provides tools for establishing verifiable relationships between AI agents and their controlling entities using W3C Verifiable Credentials.
ACK-ID is part of the Agent Commerce Kit.
npm i @agentcommercekit/ack-id
# or
pnpm add @agentcommercekit/ack-id
import { createControllerCredential } from "@agentcommercekit/ack-id"
import { createDidWebUri } from "@agentcommercekit/did"
// Create DIDs for agent and controller
const controllerDid = createDidWebUri("https://controller.example.com")
const agentDid = createDidWebUri("https://agent.example.com")
// Create a credential establishing the controller relationship
const credential = createControllerCredential({
subject: agentDid,
controller: controllerDid,
// Optional id and issuer can be provided
id: "urn:uuid:123e4567-e89b-12d3-a456-426614174000",
issuer: controllerDid // Defaults to controller if not provided
})
import { getControllerClaimVerifier } from "@agentcommercekit/ack-id"
import { getDidResolver } from "@agentcommercekit/did"
import { verifyParsedCredential } from "@agentcommercekit/vc"
// Get the verifier for controller credentials
const verifier = getControllerClaimVerifier()
const resolver = getDidResolver()
// Verify the credential using verification logic from vc package.
try {
await verifyParsedCredential(controllerCredential, {
resolver,
verifiers: [verifier],
trustedIssuers: [controllerDid] // Optional: list of trusted issuers
})
console.log("Credential verified successfully")
} catch (error) {
console.error("Verification failed:", error)
}
import {
isControllerCredential,
isControllerClaim
} from "@agentcommercekit/ack-id"
// Check if a credential is specifically a controller credential
isControllerCredential(credential)
// Check if a credential subject has the controller claim structure
isControllerClaim(credential.credentialSubject)
createControllerCredential(params: CreateControllerCredentialParams): W3CCredential
- Creates a verifiable credential that establishes a controller relationshipisControllerCredential(credential: unknown): credential is ControllerCredential
- Type guard for controller credentialsisControllerClaim(credentialSubject: CredentialSubject): boolean
- Type guard for controller claimsgetControllerClaimVerifier(): ClaimVerifier
- Returns a verifier that can validate controller claims// Zod v4 schema
import { controllerClaimSchema } from "@agentcommercekit/ack-id/schemas/zod/v4"
// Zod v3 schema
import { controllerClaimSchema } from "@agentcommercekit/ack-id/schemas/zod/v3"
// Valibot schema
import { controllerClaimSchema } from "@agentcommercekit/ack-id/schemas/valibot"
This package includes utilities for building secure, mutually authenticated agent-to-agent (A2A) flows using DIDs and JWTs, as demonstrated in the demo-identity-a2a.
@agentcommercekit/ack-id/a2a
createA2AHandshakeMessage
– Create a signed handshake message (JWT in A2A message body) for authentication.verifyA2AHandshakeMessage
– Verify a handshake message and extract the payload.createSignedA2AMessage
– Sign any A2A message, embedding a JWT signature in the metadata.verifyA2ASignedMessage
– Verify the signature of a signed A2A message.generateRandomNonce
, generateRandomJti
– Generate secure random values for nonces and JWT IDs.createAgentCardServiceEndpoint
– Helper for DID service endpoints.import {
createA2AHandshakeMessage,
generateRandomNonce
} from "@agentcommercekit/ack-id/a2a"
const handshake = await createA2AHandshakeMessage(
"user", // role
"did:web:bank.example.com", // recipient DID
{
did: "did:web:customer.example.com" // sender DID
// ...
}
)
// Send handshake message to the other agent
import { verifyA2AHandshakeMessage, createA2AHandshakeMessage } from "@agentcommercekit/ack-id/a2a"
// On receiving handshake message from customer
const payload = await verifyA2AHandshakeMessage(handshake.message, {
did: "did:web:bank.example.com",
counterparty: "did:web:customer.example.com"
})
// payload.nonce is the customer's nonce
// Respond with a handshake message including the received nonce
t const response = await createA2AHandshakeMessage(
"agent",
"did:web:customer.example.com",
{
did: "did:web:bank.example.com",
requestNonce: payload.nonce,
// ...
}
)
// Send response to the customer
import {
createSignedA2AMessage,
verifyA2ASignedMessage
} from "@agentcommercekit/ack-id/a2a"
// To send a signed message:
const signed = await createSignedA2AMessage(
{
role: "user",
parts: [
{ type: "text", text: "Please check the balance for account #12345" }
]
// metadata will be filled in
},
{
did: "did:web:customer.example.com"
// ...
}
)
// Send signed.message
// To verify a signed message:
const verified = await verifyA2ASignedMessage(signed.message, {
did: "did:web:bank.example.com",
counterparty: "did:web:customer.example.com"
})
// verified.payload.message matches the message content
generateRandomNonce()
– Generate a secure random nonce for challenge/response.generateRandomJti()
– Generate a secure random JWT ID.createAgentCardServiceEndpoint(did, url)
– Create a DID service endpoint for agent discovery.These methods enable robust, replay-resistant, mutually authenticated A2A flows using DIDs and JWTs. See the identity-a2a demo for a full walkthrough.
This SDK supports Agent Commerce Kit version 2025-05-04
.
See the ACK Versioning documentation for more information.
Copyright (c) 2025 Catena Labs, Inc.
FAQs
> Verifiable Identity for Agent Interactions
The npm package @agentcommercekit/ack-id receives a total of 339 weekly downloads. As such, @agentcommercekit/ack-id popularity was classified as not popular.
We found that @agentcommercekit/ack-id demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.