Copyright © 2026 Aroha Labs. This document is licensed under the Apache License, Version 2.0.
The Aroha Protocol (Aroha) is an open, decentralized protocol for agent-to-agent communication, discovery, and atomic multi-agent transactions. It defines how AI agents from different organizations discover each other, establish identity and trust, exchange cryptographically signed messages, and coordinate complex multi-step tasks that either fully succeed or fully roll back using a distributed saga pattern. Multi-step coordination (sagas) and preference context are defined as extensions in a companion extensions document.
Aroha is language-agnostic and framework-agnostic. It defines a protocol specification, not an implementation. Any agent that correctly implements these rules can interoperate with any other conformant Aroha agent. The protocol is built on existing W3C standards: Decentralized Identifiers [[did-core]], Verifiable Credentials [[vc-data-model-2.0]], and JSON-LD [[json-ld11]].
This is an unofficial draft. It has not been submitted to
any standards body. It is not a W3C document: no W3C Community Group has
been proposed for it, and it is not a W3C Standard nor on the W3C Standards
Track. The did:aroha DID method has been listed in the W3C
DID Extensions registry since 2026-11-14
(w3c/did-extensions#766).
That is a registry listing, not a W3C endorsement. This draft may be updated, replaced, or made obsolete
at any time.
Status note (2026-10): the reference registry is an HTTP registry; the on-chain registry contracts are not wired into DID resolution in the reference implementation. The post-quantum appendix is non-normative and describes future work.
The Markdown version of this document (aroha-1.0.md) is the
source of truth; this HTML rendering is kept in step with it.
Comments and contributions are welcome at the
GitHub issue tracker.
The source for this
document is available on GitHub.
| Date | Change |
|---|---|
| 2026-10-26 | Appendix A: seven codes added for mandate-chain admission and
task-mandate binding — Aroha_NO_MANDATE,
Aroha_CHAIN_INVALID, Aroha_UNTRUSTED_ROOT,
Aroha_ROOT_KEY_MISMATCH, Aroha_CHAIN_REJECTED,
Aroha_SCOPE_UNKNOWN, Aroha_CONTEXT_MISMATCH —
previously sent by the reference code under a misspelled
ARHOA_ prefix. |
| 2026-10-25 | Scope: the core specification now covers Layers 0–3 (Transport,
Identity, Registry, Messaging). Orchestration (sagas) and
preference context moved unchanged to the extensions document
(extensions.md); their sections remain as pointers.
Conformance items for sagas and preference context now apply to
implementations that adopt those extensions. |
| 2026-10-19 | New section Mandate Presentation: the holder proof that keeps a
mandate from being a bearer token, with the MCP binding
(_meta["aroha/mandate"], previously defined only by
the reference code) and a new plain-HTTP binding
(Aroha-Mandate header) with vectors in
packages/aroha-credentials/test-vectors/http-presentation-v1.json.
Spending mandate format: a body that carries
mandateType is a task mandate and is refused as a
spending mandate. |
| 2026-10-15 | New §12 Conversation and Memory Profile: signed rooms and
membership epochs, person invitations with per-event signed
consent records, turn signatures, the person-DID signing rule
and speaker-kind resolution, the memory record, signed action
receipts v1/v2 (outcome, denied receipts,
presentedHash), and ArohaDisclosure
(optional envelope field). New sections on the task-mandate
token v2 (with onBehalfOf and roomId),
signed revocation status and the governed verifier profile,
previously defined only by the reference code. Schemas in
spec-public/schemas/, vectors in
spec-public/vectors/conversation-v1.json. |
| 2026-10-08 | Registry: the HTTP registry (§5.1a) is the normative baseline;
on-chain registration, staking and slashing are scoped to the
optional blockchain registry (§5.1b). §6.3 envelope validation:
maximum lifetime, created skew,
signature-before-nonce ordering, per-sender nonce keys. §6.4
lists all 19 message types. New §6.5 normative spending-mandate
token format (v2). §9 key rotation is KEL rotation for E-form
DIDs. Appendix A lists all 28 error codes; Appendix B states SDK
status. |
| 2026-10-07 | Identity: rotatable, self-certifying did:aroha:E…
identifiers with Key Event Logs (pre-rotation, person
controllers, controller recovery and revocation, stale-log and
duplicity handling) — see the DID method specification. §4.1
lists the three did:aroha forms; the z
form is marked legacy (non-rotatable) and the named form
registry-trusted. §9 adds the person-root rule for delegation
chains. |
| 2026-07-27 | Private resources: §3.5 aroha-sig caller
authentication (signed material, headers, and the verifier
ordering rules); §5.4 registry visibility levels and access
grants, including the requirement to filter inside the query and
to make an unauthorised viewer indistinguishable from a
non-existent record; §5.1a grant and visibility endpoints. |
| 2026-04-28 | Kernel hardening: auth/ directory removed from
@aroha-sdk/core (dead duplicate of
@aroha-sdk/credentials); WalletService
relocated to @aroha-sdk/settlement/payments;
Ed25519→X25519 key conversion corrected to use
edwardsToMontgomeryPub/Priv; full Vitest suite added
(100+ tests across all 10 packages). |
| 2026-04-21 | @aroha-sdk/commerce extension complete (B2B, B2C,
C2B); @aroha-sdk/credentials extracted from kernel;
IArohaRegistry pluggable backend spec
finalized. |
| 2026-04-14 | Initial draft prepared in W3C CG format (not submitted). |
Section numbers (§) in this table and elsewhere in this document refer to
the numbering of the Markdown source, aroha-1.0.md.
Modern AI systems are built as isolated agents — each lives inside a single application, vendor, or context. There is no interoperable protocol for an agent built by one organization to discover, authenticate, and transact with an agent built by another. Aroha addresses this gap.
Aroha is designed around three principles of separation:
| Layer | Name | Responsibility |
|---|---|---|
| 0 | Transport | HTTPS + WebSocket, TLS 1.3+ |
| 1 | Identity | W3C DIDs, Ed25519 |
| 2 | Registry | Pluggable registry (managed HTTP, self-hosted, or optional blockchain) + IPFS manifests |
| 3 | Messaging | Signed JSON-LD envelopes, 19 message types |
Extensions (pluggable outside the core protocol):
WalletService for invisible Web3CommerceAuditLog
The core protocol kernel (@aroha-sdk/core) MUST NOT import
any extension package. @aroha-sdk/core exports: transport,
identity, crypto primitives, and signed messaging only. Settlement,
credentials, and commerce are injected via the middleware /
settlement constructor parameters — never statically
coupled to the kernel.
The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in [[RFC2119]].
An implementation is conformant if it:
/.well-known/aroha-agent.json/aroha/v1 using the defined envelope formatsagaRole: "participant"), meets that extension's
conformance requirements (extensions document §3)preferenceContext beyond the current request (extensions
document §2.2)endpoint field when registering in any registry (to IPFS
when the registry is the optional blockchain registry, §5.2)@aroha-sdk/credentials), resolves agent roles and verifies
HumanCredential before dispatching any action message;
returns 401 or 403 on failure.In more detail, this specification defines three conformance classes:
A provider agent is conformant if it:
GET /.well-known/aroha-agent.json.POST /aroha/v1.401 for authentication failures and
403 for authorization failures.An orchestrator agent is conformant if it:
A registry is conformant if it:
IArohaRegistry interface defined in
, through one of the HTTP
() or blockchain
() bindings.did:aroha: method, in one of three forms
(see ).did:aroha identifier is derived. Defined in the
Aroha DID Method Specification.person, with no controller. A
person may be named as the controller of an agent, and can then recover
or revoke that agent./aroha/credentials on the same host as
/aroha/v1.Every Aroha agent MUST serve its DID Document at the well-known URI defined in [[RFC8615]]:
GET https://<domain>/.well-known/aroha-agent.json Content-Type: application/json → Response: DID Document (see )
This URI MUST be registered with IANA as specified in [[RFC8615]] §3.1.
All Aroha messages MUST be sent via HTTP POST [[RFC9110]]:
POST https://<domain>/aroha/v1 Content-Type: application/json Body: ArohaEnvelope (see )
A 200 response carries a synchronous reply envelope. A 202 response indicates the request was accepted for asynchronous processing; results will be streamed (see ).
An async capability is one that declares "async": true in
its manifest. Async capabilities MUST use WebSocket at:
wss://<domain>/aroha/stream?cid=<correlationId>
The cid parameter is the correlation ID of the saga
or session. Frames are ArohaStream envelopes (JSON): each WebSocket frame is a
complete message envelope serialized as UTF-8 JSON.
Credential Registry endpoints, previously defined in Layer 0, are now part
of the @aroha-sdk/credentials extension. They are described in
for agents that use that
extension.
aroha-sig)A bearer token proves only that the caller holds a secret; every holder of that token is indistinguishable. An agent that must restrict which agents may invoke it therefore needs caller identity, not a shared secret.
Agents MAY require the aroha-sig scheme. A signed request
carries the caller's DID and an Ed25519 signature that the callee verifies
against the public key published for that DID (§4.2,
).
Signed material. The caller signs the newline-joined concatenation, in exactly this order:
METHOD \n PATH \n TIMESTAMP \n NONCE \n SHA-256(body, hex)
Binding the method and path prevents a captured signature being replayed against a different endpoint; binding a hash of the body prevents alteration of its content.
Headers.
| Header | Value |
|---|---|
X-Aroha-Did | Caller's DID, e.g. did:aroha:planner |
X-Aroha-Timestamp | ISO-8601 instant |
X-Aroha-Nonce | Unique per request |
X-Aroha-Signature | base64url Ed25519 signature over the signed material |
Verifier requirements. A conformant verifier MUST:
X-Aroha-Timestamp differs from local
time by more than the permitted skew (RECOMMENDED default: 5 minutes).
X-Aroha-Did is absent from the
callee's allow-list, before resolving any key. Checking
membership first means an unauthorised DID cannot use response timing
to probe which identities are known.
X-Aroha-Nonce. The nonce MUST be consumed
last — only once the request is otherwise fully valid.
Consuming it earlier would let an attacker burn a legitimate caller's
nonce with an invalid request.
An agent requiring aroha-sig MUST fail closed: a request with a
missing, malformed, or unverifiable signature is rejected, never downgraded
to anonymous access.
This section describes the @aroha-sdk/credentials extension.
It is not part of core Layer 0; its requirements apply only to agents that
host a credential registry.
Agents that host a credential registry MUST expose the following
additional HTTP endpoints at the same host as /aroha/v1:
| Method | Path | Purpose |
|---|---|---|
POST |
/aroha/credentials |
Register a HumanCredential. Body: HumanCredential JSON.
Server verifies the Ed25519 signature before storing.
Returns 201 { credentialId, stored: true }. |
GET |
/aroha/credentials/:id |
Resolve a credential by ID. Returns 200 HumanCredential
or 404. Expired credentials are auto-evicted and
return 404. |
GET |
/aroha/credentials?userId=<id> |
List all active credentials for a user.
Returns 200 HumanCredential[]. |
DELETE |
/aroha/credentials/:id |
Revoke a credential. Requires X-Revoke-Proof header:
a base64url Ed25519 signature by the issuer over
{"action":"revoke","credentialId":"<id>"}
(keys sorted). Returns 200 { credentialId, revoked: true }
or 403 if proof is invalid. |
After revocation, any message bearing that credentialId MUST
be rejected with 401 Aroha_UNAUTHORIZED by any verifier that
consults the credential registry. A verifier that works offline cannot
observe a revocation before the credential expires.
Every agent MUST have a DID:
did:aroha:<unique-id>
Where <unique-id> is globally unique and chosen by the
operator. The did:aroha DID method is defined in the
companion Aroha DID Method Specification.
Three forms of <unique-id> exist, told apart by syntax
(DID Method → Forms):
did:aroha:E<base58btc(sha256(inception))> —
self-certifying and rotatable; the current key is derived from the
identifier's Key Event Log. A person is an E-form identity of
kind person; an agent MAY name a person as its
controller, who can recover or revoke it. New identities SHOULD use
this form.did:aroha:z<base58btc(publicKey)> — legacy.
Self-certifying but not rotatable.The DID Document MUST conform to [[did-core]].
Requirements:
Ed25519VerificationKey2020
verification method.ArohaEndpoint service entry (pointing to
the agent's HTTPS endpoint).The HTTP registry (§5.1a, ) is the normative baseline for registration and key resolution. The blockchain registry (§5.1b) is OPTIONAL; where it is used, "registered" means registered on-chain. For z-form and E-form DIDs the verifying key comes from the DID itself (and, for E-form, its Key Event Log), so a registry record can never substitute a different key for them. The registry smart contracts in Appendix B are not wired into DID resolution in the reference implementation.
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"id": "did:aroha:expedia-flights-v2",
"verificationMethod": [{
"id": "did:aroha:expedia-flights-v2#key-1",
"type": "Ed25519VerificationKey2020",
"controller": "did:aroha:expedia-flights-v2",
"publicKeyMultibase": "z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK"
}],
"authentication": ["did:aroha:expedia-flights-v2#key-1"],
"service": [{
"id": "did:aroha:expedia-flights-v2#aroha",
"type": "ArohaEndpoint",
"serviceEndpoint": "https://agents.expedia.com/aroha/v1"
}]
}
Agents MAY carry W3C Verifiable Credentials (VCs) to prove claims [[vc-data-model-2.0]]:
| VC Type | Purpose | Required at Trust Level |
|---|---|---|
CorporateIdentityCredential |
Proves corporate operator | 2 |
ComplianceCertificationCredential |
Proves regulatory compliance | 2 |
CapabilityAuthorizationCredential |
Authorizes specific capabilities | 3 |
VCs MUST be signed by a recognized trust anchor's Ed25519 key.
| Level | Requirements | Permitted Operations |
|---|---|---|
| 0 | None | Read manifests, query registry |
| 1 | Registered with a Layer 2 registry (plus a stake only where an optional blockchain registry requires one, §5.1b) | Search, negotiate |
| 2 | VC from trust anchor | Reserve (low-value) |
| 3 | Reputation ≥ 8000 | Reserve + commit (high-value) |
| 4 | Explicit user authorization | Full access + payments |
See the @aroha-sdk/credentials extension for details on how
human users authenticate to their Personal Agent out-of-band and receive a
signed HumanCredential. This section summarises that
extension; its requirements apply only to agents that use it.
Human users are not DID-bearing agents. They authenticate to their Personal Agent out-of-band (password, OAuth, passkey) and receive a signed HumanCredential. That credential is carried in the body of any Aroha message the user triggers.
{
"credentialId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"userId": "user-alice",
"email": "alice@example.com",
"roles": ["human:user"],
"issuedAt": "2026-04-16T00:00:00Z",
"expiresAt": "2026-04-23T00:00:00Z",
"issuerDID": "did:aroha:personal-agent-alice",
"signature": "<base64url-Ed25519-sig-over-canonical-credential-body>"
}
The signature MUST be the Ed25519 signature by the
issuerDID agent over the canonical JSON of the credential
with the signature field omitted and all keys sorted
lexicographically — identical to the envelope proof canonicalization
rule (see ).
Messages from human-triggered flows MUST carry one of:
GET /aroha/credentials/:id. Preferred for repeated
calls; allows immediate revocation.If both are present, credentialId takes precedence.
See the @aroha-sdk/credentials extension for details on the
standard role system that governs which principals may invoke which
message types. This section summarises that extension (RBAC).
Aroha defines a standard role system that governs which principals may invoke which message types. Roles are additive: a principal with multiple roles has the union of all their permissions.
| Role | Type | Permitted Actions |
|---|---|---|
human:admin | Human | query, reserve, commit, cancel, delegate, negotiate, admin |
human:user | Human | query, reserve, commit, cancel, negotiate |
human:readonly | Human | query |
agent:orchestrator | Agent | query, reserve, commit, cancel, delegate, negotiate |
agent:provider | Agent | receives only — does not initiate |
agent:observer | Agent | query |
| Action | Message Types |
|---|---|
query |
ArohaRequest, ArohaStream |
reserve | ArohaReserve |
commit | ArohaCommit |
cancel | ArohaCancel |
delegate | ArohaDelegate |
negotiate |
ArohaNegotiate, ArohaCounterOffer, ArohaAccept |
admin | All of the above |
403 Aroha_FORBIDDEN.401 Aroha_UNAUTHORIZED.Applications MAY define custom role strings beyond the built-in set. The permission matrix is injected at server configuration time and can be overridden per deployment.
A web identity is an HTTPS URL that names a party to a mandate
and serves a document publishing that party's signing key. A party that
already publishes an OAuth Client ID Metadata Document
(draft-ietf-oauth-client-id-metadata-document) at a URL can sign and
hold mandates under that URL, with no did:aroha identifier.
That draft defines the document for OAuth clients only; using it to name
a mandate party is defined here, and no OAuth flow is involved. Support
for this section is OPTIONAL. A verifier that does not support it, and has not pinned a key for that identity itself, cannot resolve a key for a web identity and therefore rejects the mandate.
Where it may appear. A web identity MAY be the
grantor or grantee of a spending mandate (§6.5)
or a task mandate (§6.6), and the holder of a mandate
presentation (§6.9). One chain MAY mix web identities and DIDs. Where
§6.5, §6.6 and §6.9 say that a key is resolved from a DID, the key of a
web identity is resolved as this section defines, and never taken from
the token or the presentation. A web identity is not an Agent DID
(§4.1): message envelopes (§6.1) and registry records (§5) name agents
by DID. A verifier applying the governed profile (§6.8) MUST reject a
chain whose root grantor is a web identity, because that profile
requires an E-form person root.
Identifier. A web identity MUST match the grammar below. Identifiers are compared as strings, character for character; a verifier MUST NOT normalise a web identity before comparing it.
identity = "https://" host [ ":" port ] path host = label 1*( "." label ) label = 1*63( %x61-7A / DIGIT / "-" ) ; not starting or ending with "-" port = 1*5DIGIT path = 1*( "/" segment ) [ "/" ] segment = 1*( unreserved / sub-delims / ":" / "@" / "%" HEXDIG HEXDIG )
The following rules also apply. The host is in lower case and at most
253 characters long, and its last label is either 2 to 63 letters or a label beginning xn--. A label beginning xn-- MUST be a valid A-label: decoding it and encoding it again gives the same label. An IP address literal is not a host,
and neither is localhost or a name ending in
.localhost. The port has no leading zero, is
at most 65535 and is not 443. No segment is . or
.., also when a dot is written %2e or
%2E. A web identity is at most 2048 characters long. It
follows that a web identity has no user information, no query and no
fragment, and that its path is never /.
Identity document. A web identity resolves only if a GET request to it returns status 200 and a JSON object, the identity document, that meets every rule in this list:
client_id member is a string equal to the web
identity.jwks and
jwks_uri is present. jwks is a JWK Set
(RFC 7517). jwks_uri is an HTTPS URL that follows the
host, port and segment rules above; its path may be /
and it may have a query. A GET request to jwks_uri
returns status 200 and a JWK Set.client_secret nor
client_secret_expires_at is present.d,
p, q, dp, dq,
qi, oth or k, which carry
private or symmetric key material.A verifier MUST ignore members of the identity document that this section does not name.
Signing key. The key of a web identity is the first
entry of the JWK Set's keys array that meets all of these
conditions: kty is OKP; crv is
Ed25519; x is 43 base64url characters that are
the canonical encoding of 32 bytes (RFC 8037); use, if
present, is sig; key_ops, if present, contains
verify; and alg, if present, is
EdDSA or Ed25519. If no entry meets them, the
web identity does not resolve. A publisher SHOULD set kid
to the key's JWK thumbprint (RFC 7638). To replace its key, a publisher
lists the new key first; mandates signed with the earlier key then stop
verifying and are issued again, as after an E-form key rotation.
Fetching. A verifier that resolves web identities MUST
follow these rules for the identity document and for a
jwks_uri:
Cache-Control header has a max-age, for no longer than that; a ceiling of 5 minutes is RECOMMENDED. It MUST NOT reuse a key from a response marked no-store or no-cache. It MAY remember a failure for no longer than 30 seconds, and it SHOULD share concurrent requests for one identity and limit concurrent requests to one host.
A verifier SHOULD send the request header
Accept: application/json. For local development only, a
verifier MAY also accept identities of the form
http://localhost[:port]/path and
http://127.0.0.1[:port]/path.
Trust (non-normative). A z-form or E-form DID commits
to its own key, so a verifier needs no network access and trusts no
third party to learn it. A web identity is as trustworthy as HTTPS to
its origin: whoever controls the host, its DNS records or a certificate
for it can publish a key, and the key in force is the one published when
the verifier looks. Verifiers that need offline verification, or
protection against a compromised web host, use DIDs. Pinning the
expected root grantor (§6.5, rule 2) limits which web identities can
start a chain. For fetching rule 3, the reference implementations resolve
the host name before each request and refuse the request if any of its
addresses is special-use, on Node.js and in Python. They do not pin the
connection to the address they checked, and a runtime with no resolver
to ask, such as a Cloudflare Worker or a browser, cannot make the check
at all. Such deployments rely on the allowHost option, a
network egress policy, or a client that pins the connection, as the
address-vetting fetch of the reference MCP server does.
The conformance vectors are in
packages/aroha-credentials/test-vectors/web-identity-v1.json
in the reference repository. The reference implementations are
createWebIdentityResolver in
@aroha-sdk/credentials and
create_web_identity_resolver in the Python SDK. Related
documents: the OAuth Client ID Metadata Document draft
[[?OAUTH-CIMD]], JSON Web Key [[?RFC7517]], JWK Thumbprint
[[?RFC7638]], OKP keys for JOSE [[?RFC8037]] and special-purpose
address registries [[?RFC6890]].
Any conformant registry implementation MUST satisfy the following logical interface (shown in TypeScript; equivalent interfaces exist in all SDK languages):
interface IArohaRegistry {
register(did: string, manifestCID: string, publicKey: Uint8Array,
options?: RegisterOptions): Promise<void>;
deactivate(did: string): Promise<void>;
updateManifest(did: string, newCID: string): Promise<void>;
resolveByDID(did: string): Promise<AgentRecord | null>;
queryByCapability(capabilityIds: string[]): Promise<AgentRecord[]>;
}
Three conformant implementations are defined by this specification:
| Implementation | Backend | Use case |
|---|---|---|
| Managed HTTP Registry | REST API (SaaS or self-hosted) | Enterprise default. No blockchain required. Subscription-based. |
| Self-hosted HTTP Registry | REST API (operator-run) | Regulated industries (healthcare, finance, government) that cannot use external services. |
| Blockchain Registry | EVM smart contract (optional) | Trustless, permissionless deployments. Useful for open ecosystems with no trusted operator. |
Implementations are interchangeable at the SDK level.
Application code depends only on IArohaRegistry, not on
any specific backend.
An HTTP registry MUST expose the following REST endpoints:
| Method | Path | Purpose |
|---|---|---|
POST | /v1/agents |
Register an agent. Body: { did, manifestCID, publicKeyB64 } |
DELETE | /v1/agents/:didHash |
Deactivate an agent |
PUT | /v1/agents/:didHash/manifest |
Update capability manifest CID |
GET | /v1/agents/:didHash |
Resolve agent record by DID |
GET | /v1/agents?capabilities=a,b |
Query agents by capability ID list |
A registry supporting visibility and access grants (§5.4, ) MUST additionally expose:
| Method | Path | Purpose |
|---|---|---|
PATCH | /v1/agents/:didHash/visibility |
Set public | unlisted | private |
POST | /v1/grants |
Grant a party access to a resource |
GET | /v1/grants?resource=:didHash |
List live grants on a resource |
DELETE | /v1/grants/:id |
Revoke a grant |
All four are restricted to the owner of the resource.
Authentication is via Authorization: Bearer <api-key>
header. Endpoints that read records MUST accept the header as OPTIONAL,
since visibility filtering (§5.4.3, )
requires serving anonymous callers the public view rather than rejecting
them. Sybil resistance is enforced by the registry operator through
subscription tiers, org verification, or rate limiting — not by
cryptocurrency staking.
For trustless deployments, the following Solidity interface defines a conformant on-chain registry. Use of a blockchain backend is OPTIONAL.
interface IArohaRegistry {
function register(
bytes32 didHash,
string calldata manifestCID,
bytes calldata publicKey
) external payable; // payable = staking optional
function deactivate(bytes32 didHash) external;
function updateManifest(
bytes32 didHash,
string calldata newCID
) external;
function updatePublicKey(
bytes32 didHash,
bytes calldata newPublicKey,
bytes calldata rotationProof
) external;
function resolveByDID(bytes32 didHash)
external view returns (AgentRecord memory);
function queryByCapability(bytes32[] calldata capabilityHashes)
external view returns (AgentRecord[] memory);
}
updatePublicKey enables key rotation while preserving the
DID and on-chain reputation. The rotationProof is an
Ed25519 signature by the current private key over
SHA-256("aroha-key-rotation:" || didHash || newPublicKey).didHash = keccak256(didString);
capabilityHash = keccak256(capabilityId)payable) is OPTIONAL. Registry operators MAY
require a minimum stake for Sybil resistance; they MAY also set
minimum stake to zero.The manifest MUST be signed by the agent. With the optional blockchain registry (§5.1b), the manifest MUST be published to IPFS and its CID stored on-chain. An HTTP registry (§5.1a) MAY store the signed manifest directly or reference it by CID.
{
"aroha": "1.0",
"did": "did:aroha:<id>",
"name": "<string>",
"version": "<semver>",
"endpoint": "https://<domain>/aroha/v1",
"capabilities": [ /* CapabilityDefinition[] */ ],
"protocols": ["aroha/1.0"],
"signature": "<base64url-Ed25519-signature-over-manifest-body>"
}
The endpoint field is the authoritative Aroha message URL
for this agent. Discovering agents MUST use the endpoint
value from the verified manifest as the target for all Aroha messages.
This field MUST be present and MUST be an HTTPS URL (or
wss:// for streaming-only agents). Because the manifest is
Ed25519-signed by the agent operator and verified against the agent's
registered public key (§4.2), the endpoint value is trusted without a separate DID
Document resolution step.
Capability Definition:
{
"id": "<string>",
"version": "<semver>",
"inputSchema": { /* JSON Schema */ },
"outputSchema": { /* JSON Schema */ },
"async": false,
"maxResponseMs": 5000,
"requiredTrustLevel": 1,
"pricing": { "model": "free" | "per-transaction" | "subscription" },
"sagaRole": "none" | "participant",
"reserveCapabilityId": "<id>",
"cancelCapabilityId": "<id>"
}
Requirements:
signature MUST be verified against the
agent's registered public key (§4.2) before use.
{
"aroha": "1.0",
"did": "did:aroha:expedia-flights-v2",
"name": "Expedia Flight Search",
"version": "2.1.0",
"endpoint": "https://agents.expedia.com/aroha/v1",
"capabilities": [
{
"id": "search-flights",
"version": "1.0.0",
"description": "Search available flights between two airports",
"inputSchema": {
"type": "object",
"properties": {
"origin": { "type": "string" },
"destination": { "type": "string" },
"date": { "type": "string", "format": "date" }
},
"required": ["origin", "destination", "date"]
},
"outputSchema": {
"type": "object",
"properties": {
"flights": { "type": "array" }
}
},
"async": false,
"maxResponseMs": 3000,
"requiredTrustLevel": 1,
"pricing": { "model": "per-transaction" },
"sagaRole": "participant",
"reserveCapabilityId": "reserve-flight",
"cancelCapabilityId": "cancel-reservation"
}
],
"protocols": ["aroha/1.0"],
"signature": "<base64url-Ed25519-signature-over-manifest-body>"
}
Reputation scores (0–10000) are maintained by the
ArohaReputation oracle contract using an exponential moving
average (EMA):
newScore = floor(oldScore × 0.85 + signal × 0.15) signal values: SUCCESS = 10000 COMPENSATED = 3000 FAILURE = 1000 DISPUTE_LOST = 0
Default score for new agents: 5000 (neutral).
Not every agent, MCP server, or skill is meant to be public. A registry MUST support restricting discovery of a record, and this is distinct from restricting invocation of the agent it describes.
Every agent, MCP, and skill record has a visibility field:
| Level | Appears in capability queries | Resolvable by didHash |
|---|---|---|
public | Yes | Yes |
unlisted | No | Yes |
private |
Only for the owner and holders of a live grant | Only for the owner and holders of a live grant |
public is the default, so an implementation adding
visibility does not change the behaviour of existing records.
unlisted is obscurity, not access control: anyone
who learns the didHash can resolve the record. It is
appropriate for records that are simply not worth listing, and MUST NOT
be relied on to protect anything.
An access grant records that the owner of a resource has granted a named party access to it. A grant identifies its grantee in one of two ways, because discovery and invocation authenticate differently:
A grant MAY carry an expiry and MAY be limited to a subset of the resource's capability identifiers; an absent capability list means the whole resource. Revocation MUST be a soft delete so the audit trail survives, and MUST take effect immediately for subsequent requests.
A registry MUST enforce that at most one live grant exists per (resource, grantee) pair, while still permitting a grantee to be re-granted access after revocation.
A conformant registry MUST apply visibility filtering inside the query that retrieves records, not by post-filtering results. Post-filtering leaks existence through result counts, pagination boundaries, and timing.
A viewer is entitled to a record when any of the following holds:
public (for capability queries), or
public/unlisted (for direct resolution);
Requests presenting no credential MUST be treated as an anonymous viewer
that satisfies only condition 1. An anonymous viewer MUST NOT be
distinguishable, in status code or timing, from an authenticated viewer
who simply lacks access — both MUST receive the same "not found"
response. Returning 403 for a private record confirms that
it exists.
Credentials presented for discovery MUST NOT be used to probe: an invalid or unrecognised credential MUST degrade to the anonymous view rather than producing an authentication error, so that the presence of a record cannot be inferred from the difference.
Visibility and grants govern the registry only. Marking
a record private conceals it from discovery; it does not
prevent invocation by a party that already knows the endpoint.
An agent that must restrict who may invoke it MUST enforce that itself,
by requiring aroha-sig (§3.5,
) and checking the caller's DID
against its own allow-list. Implementations MUST NOT present registry
visibility as an invocation control.
All Aroha messages MUST use this envelope (JSON-LD):
{
"@context": ["https://aroha-labs.com/contexts/v1",
"https://w3id.org/security/suites/ed25519-2020/v1"],
"id": "urn:uuid:<uuid-v4>",
"type": "<ArohaMessageType>",
"from": "did:aroha:<sender>",
"to": "did:aroha:<recipient>",
"created": "<ISO8601>",
"expires": "<ISO8601>",
"nonce": "<random-hex-32>",
"correlationId": "<string>",
"body": { },
"proof": {
"type": "Ed25519Signature2020",
"created": "<ISO8601>",
"verificationMethod": "did:aroha:<sender>#key-1",
"proofPurpose": "authentication",
"proofValue": "<base64url-Ed25519-signature>"
}
}
An envelope MAY also carry an optional disclosure member
(an ArohaDisclosure, see the Conversation and Memory
Profile). Like every other member except proof, it is
covered by the signature.
For example:
{
"@context": [
"https://aroha-labs.com/contexts/v1",
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"id": "urn:uuid:550e8400-e29b-41d4-a716-446655440000",
"type": "ArohaRequest",
"from": "did:aroha:personal-agent-alice",
"to": "did:aroha:expedia-flights-v2",
"created": "2026-04-14T10:00:00Z",
"expires": "2026-04-14T10:05:00Z",
"nonce": "a3f2b1c4d5e6f7a8b9c0d1e2f3a4b5c6",
"correlationId": "corr-8f3a2b1c4d5e",
"body": {
"capability": "search-flights",
"params": { "origin": "JFK", "destination": "NRT", "date": "2026-05-01" }
},
"proof": {
"type": "Ed25519Signature2020",
"created": "2026-04-14T10:00:00Z",
"verificationMethod": "did:aroha:personal-agent-alice#key-1",
"proofPurpose": "authentication",
"proofValue": "z4oey8BqNfCLFMmoF..."
}
}
proof.proofValue MUST be the Ed25519 signature over:
canonicalJSON = JSON.stringify(messageWithoutProof, keysLexicographicallySorted)
That is, the Ed25519 [[RFC8032]] signature over the canonical form of the message, computed as follows:
proof field from the message object.A receiving agent MUST reject any message where:
from DID (§4.1–§4.2): derived from the
DID for z-form, from the Key Event Log for E-form, from the registry
for named DIDs.expires timestamp is in the past.nonce has been seen before (nonce replay attack
prevention).to does not match the receiving agent's DID.created or expires is missing or cannot be
parsed.created is more than the allowed clock skew in the
future (default 30 seconds).expires - created exceeds the maximum envelope lifetime
(default 5 minutes).verificationMethod names a DID other than
from.Ordering. A receiver MUST perform the stateless checks (recipient, timestamps, lifetime, nonce present) and the signature check before it consults or writes the nonce store. Only an envelope whose signature verifies may record its nonce; otherwise an unauthenticated client could fill the store, or consume a legitimate sender's nonce in advance so that the real message is later rejected as a replay.
Nonce scope. Nonces MUST be tracked per sender: the
replay key is the pair (from, nonce), so one
sender's nonce can never collide with another's. A recorded nonce MUST
be retained at least until expires plus any expiry clock
tolerance the receiver applies.
A receiver that raises the maximum lifetime SHOULD use a nonce store that survives restarts and is shared by every instance that accepts messages for the same DID, because an envelope's replay window is its whole lifetime.
The first 15 types are shared by every reference SDK; the last four are implemented in the TypeScript reference only (Appendix B).
credentialId and credentialToken are mutually
exclusive; credentialId takes precedence when both are
present. They are required only when the receiving agent enforces an RBAC
policy (see §4.6, ). Agent-to-agent messages where the
sender's DID already carries a known role do not need to include them.
A spending mandate (ArohaSpendingMandate) is a
signed, narrowing grant of spending authority
from a grantor to a grantee. Mandates form a chain: a human (or
organisation) issues a root intent mandate, and each
delegate may issue a narrower cart or payment
mandate to the next agent. This section defines the wire format that
every implementation MUST produce and accept; the conformance vectors are
in packages/aroha-credentials/test-vectors/mandate-v2.json in the
reference repository.
Mandate body. Each link's body has the fields
mandateTier (intent | cart | payment), constraints, grantee, grantor,
issuedAt, expiresAt, parentMandateId (null for a root) and mandateId.
issuedAt is REQUIRED.
A body that carries mandateType is a task mandate and MUST
be rejected as a spending mandate.
Signature. A v2 link signature is the Ed25519 signature,
by the link's grantor, over the UTF-8 bytes of the [[RFC8785]] (JCS)
canonicalisation of the object {"mandate": <body>, "v": 2},
encoded as base64url without padding.
Token. A token is base64url(JSON) of
{ "v": 2, "mandate": <leaf body>, "signature": <leaf
signature>, "chain": [ … ] }. chain lists every
ancestor link, root first, excluding the leaf; each entry is
{ "v": 1 | 2, "mandate": <body>, "signature": <sig> }.
A root mandate carries an empty chain. A token without
v is a legacy v1 token, which never carries a chain; a token
with a chain but no v: 2 MUST be rejected as
malformed.
Chain verification. Before acting on a token to move money, a verifier MUST check every link, root first, and MUST reject the token if any check fails:
grantor. The key for an ancestor link MUST be resolved
from the grantor's DID (derived from a z-form DID, from the Key Event
Log for an E-form DID, or from a trusted registry for a named DID) —
never taken from the token. A key the caller supplies for the leaf
grantor applies to the leaf link only, by position; if the leaf
grantor's DID is self-certifying, the supplied key MUST equal the key
derived from that DID.parentMandateId null and tier
intent; if the verifier expects a particular root, the
root's grantor equals it.grantor equals its parent's
grantee, its parentMandateId equals its
parent's mandateId, its tier is not broader than its
parent's (intent → cart →
payment), and its expiresAt is not later
than its parent's.spendLimitUsd is not greater; and every optional limit
the parent sets (sessionLimitUsd,
requireHumanApprovalAboveUsd,
allowedMerchants, merchantCategory,
validFrom, validUntil,
currency) is also set by the child, to an equal or
narrower value. A child that omits a limit its parent sets is a
widening and MUST be rejected.issuedAt, expiresAt, validFrom, validUntil), its expiresAt is not before its issuedAt, and, when a revocation source is configured, it is not revoked. Amounts are at most 2^53 − 1.grantee equals it.Issuers MAY fill an omitted optional limit from the parent when they attenuate (so that honest callers produce valid children); verifiers MUST NOT.
Acting-for side. A mandate body MAY carry
actingFor (payer | payee),
declaring which side of a payment the chain acts for. When a parent sets
it, a verifier MUST reject a child whose actingFor is absent
or different. The field is part of the signed body only when present.
A legacy v1 token proves only that its immediate grantor signed it. A verifier MUST NOT treat a v1 token that is not itself a root as authority traceable to a human.
Revocation and redemption (optional registry extensions). A registry MAY expose GET /v1/mandates/:id/revoked so verifiers can check every link's mandateId for revocation, and MAY offer payment-mandate redemption tracking so the cumulative amount redeemed against a payment mandate never exceeds min(spendLimitUsd, sessionLimitUsd). Both are extensions to the HTTP registry of §5.1a (). A verifier that uses a revocation source MUST treat an unreachable source as a failure. Without redemption tracking, a payment mandate is a bearer authorisation that could be presented more than once. A registry that records revocations or redemption totals MUST key them by the pair (grantor, mandateId), where grantor is the mandate's own grantor, because a mandateId is chosen by whoever mints the mandate and does not by itself identify one.
The reference registry implements these extensions as follows (non-normative):
| Method | Path | Auth | Purpose |
|---|---|---|---|
POST | /v1/mandates/:mandateId/revoke |
none (rate limited); signed | Body { token, revokedAt, revoker, signature }.
token's leaf is :mandateId and verifies;
revoker is the grantor of the leaf or of any ancestor;
signature is Ed25519 by the revoker over JCS
{ mandateId, purpose: "aroha.mandate.revoke/v1", revokedAt }.
Revocations are permanent and first-wins. |
GET | /v1/mandates/:mandateId/revoked?grantor=<DID> |
public | { mandateId, grantor, revoked, revokedAt? } |
POST | /v1/mandates/:mandateId/redeem |
API key | Body { token, amountMicros, merchant, redemptionId? }.
The registry verifies the chain itself, requires a payment mandate
and an allowed merchant, derives the limit from the verified leaf,
and adds atomically: 200 { accepted: true, … } or
409 { accepted: false, redeemedMicros, limitMicros }. |
GET | /v1/mandates/:mandateId/redemptions?grantor=<DID> |
API key | { mandateId, grantor, redeemedMicros } (integer micro-USD) |
The @aroha-sdk/credentials clients are
revokeMandate, httpRevocationCheck and
httpRedemptionStore.
A task mandate (ArohaTaskMandate, §6.4) grants non-monetary authority: which capabilities a grantee may invoke and under which task constraints. It narrows along a chain the same way as a spending mandate.
Signature. A v2 task-mandate signature is the Ed25519 signature, by the mandate's grantor, over the UTF-8 bytes of the JCS canonicalisation of {"mandate": <body>, "purpose": "aroha.task-mandate/v2", "v": 2}, encoded as base64url without padding. The purpose tag keeps a task-mandate signature from verifying as any other Aroha object.
Token. A token is base64url(JSON) of { "v": 2, "mandate": <body>, "signature": <sig> }. A token without v is a legacy v1 token, signed over the key-sorted JSON of the body. A verifier MUST reject any other value of v.
Body. mandateType (task | hybrid), mandateTier (intent | cart | execution), allowed (capability ids), blocked?, taskConstraints, spendingConstraints? (REQUIRED when mandateType is hybrid), invariants?, grantee, grantor, issuedAt, expiresAt, parentMandateId, mandateId. taskConstraints has the optional members actionLimits, computeLimit, dataAccess, outputHandling, reversibleOnly, humanGates, checkpointIntervalMs, requireSandbox, maxDelegationDepth, onBehalfOf and roomId.
Narrowing. A verifier of a task-mandate chain MUST reject a child that is not equal to or narrower than its parent. For every constraint the parent sets, the child MUST set it too, to an equal or narrower value; a child that omits a constraint its parent sets is a widening. In particular: allowed is a subset of the parent's; blocked is a superset; each actionLimits and computeLimit value is not greater; dataAccess grants no right the parent lacks; reversibleOnly and requireSandbox stay true once set; humanGates keeps every gate on a capability the child still allows; onBehalfOf and roomId, when the parent sets them, are kept with the same value; expiresAt is not later than the parent's.
Enforcement. Before executing a capability under a task mandate, a receiver MUST check the request against the mandate: the capability is allowed and not blocked; reversibleOnly refuses an irreversible capability; a capability in humanGates runs only after a human approval; action, compute and data-access limits hold. When taskConstraints.roomId is set, the receiver MUST refuse a request that does not come from that room, and when taskConstraints.onBehalfOf is set, it MUST refuse a request made for any other member, including a request that names no room or member. The receiver takes the room and member from its own records, never from the request body.
The vector taskMandateV2 in spec-public/vectors/conversation-v1.json covers a guest grant with onBehalfOf and roomId.
A registry that answers the revocation query of §6.5 SHOULD sign every answer. A signed answer carries statusSignature, statusKeyId and checkedAt beside mandateId, grantor, revoked and, when revoked, revokedAt.
Signature. statusSignature is the Ed25519 signature by a registry key over the UTF-8 bytes of the JCS canonicalisation of { "purpose": "aroha.revocation-status/v1", "mandateId", "grantor", "revoked", "revokedAt"?, "checkedAt" }, base64url without padding; revokedAt is present only when revoked is true.
Keys. The registry publishes its keys at /.well-known/aroha-registry-keys.json. A key's keyId is the first 16 hex characters of the SHA-256 of its 32-byte public key. A key marked retired MUST NOT be accepted for revocation status.
Verification. A verifier configured with registry keys MUST reject an answer that is unsigned, signed by an unknown or retired key, names a different mandate or grantor, or whose checkedAt is older than its freshness limit (60 seconds in the reference) or in the future beyond its clock-skew allowance. Such an answer MUST be treated as a failure, never as "not revoked", even when the verifier is otherwise configured to tolerate an unreachable registry.
The governed verifier profile is the set of mandate checks a production payment or action gate SHOULD apply. A verifier claiming the governed profile MUST:
did:aroha:E… identity whose Key Event Log verifies, is not revoked and has kind person;A verifier that cannot meet one of these prerequisites MUST NOT report a verification as governed. In the reference implementation, governedVerification() in @aroha-sdk/credentials builds these options and refuses to build them when a prerequisite is missing.
A mandate token is a bearer credential: anyone holding a copy can present it. A receiver MUST NOT act on a mandate token that arrives without a holder proof. A holder proof is an Ed25519 signature by the holder (the leaf grantee of the token) that binds the token to one receiver, one request and one use. It covers a hash of the token itself, because a mandateId is chosen by whoever mints the mandate and does not identify one token. This section defines two bindings, one for MCP tool calls and one for plain HTTP requests. Both share these rules:
expires has passed, or whose expires lies more than 5 minutes plus a clock-skew allowance (30 seconds in the reference) in the future.An MCP tools/call request carries its presentation in the request _meta under the key aroha/mandate, as the object { "token", "holder", "nonce", "expires", "proof" }. proof is the holder's Ed25519 signature, base64url without padding, over the UTF-8 bytes of the JCS canonicalisation of { "purpose": "aroha.mcp-mandate-presentation/v2", "audience", "tool", "argsSha256", "mandateId", "tokenSha256", "holder", "nonce", "expires" }, where audience is the receiving agent's DID, tool the tool name, argsSha256 the lower-case hex SHA-256 of the UTF-8 JCS canonicalisation of the call arguments ({} when there are none), mandateId the token's leaf mandateId, and tokenSha256 the lower-case hex SHA-256 of the UTF-8 bytes of the token string. The reference implementation is presentMandate() and verifyPresentation() in @aroha-sdk/mcp-bridge.
A plain HTTP request carries its presentation in the Aroha-Mandate request header. The header value is the base64url encoding, without padding, of the UTF-8 bytes of the JCS canonicalisation of an object with exactly the members token, holder, nonce, expires and proof, each a non-empty string. A verifier MUST reject a value that does not decode to such an object, including one with any other member. A verifier MAY refuse a value longer than 32 768 characters.
nonce is 16 to 128 characters from the base64url alphabet (A–Z a–z 0–9 - _). It MUST be unpredictable; 16 random bytes are RECOMMENDED.expires is a UTC instant in exactly the form YYYY-MM-DDTHH:mm:ss.sssZ; a verifier MUST reject any other form.proof is the holder's Ed25519 signature, base64url without padding, over the UTF-8 bytes of the JCS canonicalisation of the signed object below.{ "purpose": "aroha.http-mandate-presentation/v2",
"audience": <the receiving server's identifier>,
"method": <request method, ASCII upper-case>,
"target": <request target, see below>,
"bodySha256": <lower-case hex SHA-256 of the exact body bytes>,
"mandateId": <the token's leaf mandateId>,
"tokenSha256": <lower-case hex SHA-256 of the exact token string>,
"holder", "nonce", "expires" }
Audience. The audience is the identifier the server is configured with (its DID or its origin, such as https://api.example.com). A verifier MUST use its own configured value, never one taken from the request.
Method. The method is an HTTP method token, upper-cased in ASCII only.
Target. The target is the path and query of the request exactly as sent on the wire (the origin-form request target): for an absolute http or https URL, everything after the authority; for an origin-form URL, the URL itself. The fragment is dropped, an empty path is /, and a query is kept with its leading ?. Percent-escapes are kept exactly as sent and are never decoded or re-encoded. A client MUST refuse to sign, and a verifier MUST refuse to verify, a target that contains a character outside the RFC 3986 unreserved and reserved sets and %, a % not followed by two hex digits, a . or .. path segment in any percent-encoded spelling, or user information in the authority, because an HTTP client or proxy can rewrite such a target in transit.
Body. The body hash covers the exact bytes of the request body as sent. An empty or absent body hashes as SHA-256 of the empty string. A client MUST sign the bytes it sends, and a verifier MUST hash the bytes it received before any parsing; a body that is parsed and re-serialised will not verify.
Verification. A verifier MUST compute the method, target and body hash from the request it received, never from the presentation, and MUST apply the shared rules above. A server SHOULD answer a missing or invalid presentation with status 401 and a valid presentation of a mandate that does not authorise the request with status 403.
Spending. A presentation authorises a request, not an amount. A server whose request spends money under the presented mandate checks the amount against the constraints of every link of the verified chain and keeps a running total for every link, keyed by the pair (grantor, mandateId) and capped at min(spendLimitUsd, sessionLimitUsd) as for redemption (§6.5), so that sibling mandates cannot together spend more than their common parent.
Enrollment (informative). A server that pins each request to the root DID of one of its customer accounts needs a binding from account to DID. One way to establish it, used by the reference implementation, is: the server issues a fresh, single-use, expiring challenge bound to the account the customer is signed in to; the customer's device signs, with the DID's key, the JCS canonicalisation of { "purpose": "aroha.enrollment/v1", "audience", "accountId", "did", "challenge" } (Ed25519, base64url without padding); the server spends the challenge whatever the outcome, checks that it was issued to the signed-in account and has not expired, resolves the key from the DID as for a holder, verifies the signature, and records the binding, replacing any earlier one. This note adds no requirement. The reference implementation is issueEnrollmentChallenge(), completeEnrollment(), enrolledDid() and signEnrollment() in @aroha-sdk/credentials and the same names in snake case in the Python SDK's aroha.enrollment; the vectors are in packages/aroha-credentials/test-vectors/enrollment-v1.json.
The reference implementation is presentMandateHttp(), verifyHttpPresentation(), verifyHttpMandateRequest() and verifyHttpSpendRequest() in @aroha-sdk/credentials, and present_mandate_http(), verify_http_presentation(), verify_http_mandate_request() and verify_http_spend_request() in the Python SDK's aroha.http_mandate. The conformance vectors are in packages/aroha-credentials/test-vectors/http-presentation-v1.json and packages/aroha-credentials/test-vectors/http-spend-v1.json in the reference repository.
A mandate can be issued in a second form in which each link is a JSON Web Token, so that a service with a general JWT library can read a link and verify its signature. The form changes how a link is written and signed. It does not change the mandate body or any rule of §6.5, §6.6 or §6.9. Support for this section is OPTIONAL. A verifier that does not support it rejects a token in this form as malformed.
Link. A link is a JWS in compact serialisation (RFC 7515) whose payload is a JWT claims set (RFC 7519).
alg and typ, optionally kid, and no other member. alg is EdDSA; a verifier MUST also accept Ed25519. typ is aroha-mandate+jwt; a verifier MUST also accept application/aroha-mandate+jwt. kid, when present, is a non-empty string; an issuer SHOULD set it to the JWK thumbprint (RFC 7638) of its key.iss, sub, jti, iat, exp and authorization_details. iss is the mandate's grantor, sub its grantee and jti its mandateId, each a non-empty string. iat and exp are the mandate's issuedAt and expiresAt as whole, non-negative numbers of seconds since the Unix epoch.authorization_details is an array that holds exactly one object. Its type is https://aroha-labs.com/mandates/spending or https://aroha-labs.com/mandates/task. Its other members are the members of the mandate body (§6.5 or §6.6) other than grantor, grantee, mandateId, issuedAt and expiresAt, with the names and values they have in the body.The mandate body of a link is recovered by reversing that mapping; issuedAt and expiresAt are the instants iat and exp written in the form YYYY-MM-DDTHH:mm:ss.000Z.
header { "alg": "EdDSA", "typ": "aroha-mandate+jwt", "kid": <key id> }
claims { "iss": <grantor>, "sub": <grantee>, "jti": <mandateId>,
"iat": <issuedAt, seconds>, "exp": <expiresAt, seconds>,
"authorization_details": [ { "type": "https://aroha-labs.com/mandates/spending",
"mandateTier", "constraints", "parentMandateId" } ] }
Signature. The signature is the Ed25519 signature, by the link's grantor, over the JWS signing input: the ASCII bytes of the encoded header, a full stop and the encoded payload. Verification follows RFC 8032 strictly, and a verifier MUST reject a small-order public key; this applies to every mandate signature.
Token. A spending mandate token is its link JWTs joined by the character ~, root first, the leaf last. A root mandate is a single JWT. A task mandate token is one link JWT; a task-mandate chain is a list of such tokens, as in the native form. A token is in this form if and only if it contains a full stop. A link is expired at the instant exp, as RFC 7519 defines, not after it.
Verification. A verifier MUST reject a link if any of the following holds:
alg, typ and kid, or its alg or typ is not one of the values above.iat or exp is above 253402300799 (the end of the year 9999).authorization_details does not hold exactly one object of a mandate type, or that object has a member that §6.5 or §6.6 does not define for that type, which includes grantor, grantee, mandateId, issuedAt and expiresAt. The same applies to the members of constraints, spendingConstraints and taskConstraints.iss or sub contains a colon and is not a URI.validFrom or validUntil is not an instant in exactly the form YYYY-MM-DDTHH:mm:ss.sssZ.A verifier MUST then apply to the recovered bodies every check that §6.5, for a spending token, or §6.6, for a task token, requires of a v2 token. It resolves each grantor's key as those sections and §4.7 define. A verifier MUST NOT use kid, or any key carried in a token, to choose the key a signature is checked against. A verifier MAY refuse a link longer than 16 384 characters.
Unknown members. A verifier MUST reject an unknown header member, an unknown claim or an unknown member of authorization_details, and MUST NOT ignore it. A claim such as nbf or aud that a general JWT library enforces and a mandate verifier does not would let the two reach different verdicts on one token, and a member such as locations, which RFC 9396 defines, could mean something to one consumer and nothing to another.
General JWT verification. A receiver MUST NOT authorise an action on the result of general JWT verification alone.
One form per chain. A mandate is issued in one form, because its signature covers different bytes in each. An issuer that attenuates a mandate in this form MUST issue the child in this form. A spending mandate token in this form contains only links in this form, and a verifier MUST reject a task-mandate chain that mixes the two forms.
Presentation. A token in this form is presented as §6.9 defines, unchanged: it is the token member of the presentation, and the mandateId in the holder proof is the jti of its last link.
What a JWT library does not check (non-normative). A general JWT library verifies one link: its signature, its issuer and its expiry. It does not check that a child narrows its parent, that the links join into a chain, or that the chain starts at a root the verifier trusts. It also does not read validFrom or validUntil, may accept an iat in the future, and may accept a link signed by any key in the set whose kid matches, where a mandate verifier uses only the identity's first eligible key. Those are the checks of §6.5 and §6.6, and a service that acts on a mandate needs them. This form carries no audience, no key binding inside the token and no status list: the holder is bound by the presentation of §6.9, and revocation is §6.7. The separator ~ also appears in SD-JWT, which this form is not: the first link is the root, the widest authority, and a consumer that splits a token and reads the first part reads the wrong link.
The conformance vectors are in packages/aroha-credentials/test-vectors/mandate-jwt-v1.json in the reference repository. The reference implementations are issueIntentMandate and issueTaskMandate with format: "jwt", verifyMandateChain and verifyTaskMandate in @aroha-sdk/credentials, and the same functions in the Python SDK. Related documents: JSON Web Signature [[?RFC7515]], JSON Web Token [[?RFC7519]], JWT best current practices [[?RFC8725]] and OAuth 2.0 Rich Authorization Requests [[?RFC9396]].
Orchestration primitives (sagas: reserve, commit, cancel, idempotency,
compensation order and hold duration), formerly Layer 4, are specified in
§1 of the extensions document (extensions.md). The rules are
unchanged.
Preference context (format, provider obligations and satisfaction
signals), formerly Layer 5, is specified in §2 of the extensions document
(extensions.md). The rules are unchanged.
| Requirement | Specification |
|---|---|
| Transport | TLS 1.3+ required. mTLS recommended for providers. |
| Message integrity | Ed25519 signature on every message. |
| Replay prevention | Envelope lifetime capped (default 5 minutes), created
checked against clock skew, signature verified before the nonce
store is touched, nonces keyed per sender and retained until
expires (). |
| Encryption | DIDComm v2 JWE for sensitive body fields. |
| Key storage | Private keys MUST be stored in HSM or secure enclave. |
| Key rotation | E-form DIDs rotate by appending a rotation event to their Key
Event Log, using the pre-committed next key
(DID Method); z-form DIDs
cannot rotate (migrate to E-form); named DIDs rotate through
their registry. With the optional blockchain registry,
updatePublicKey ()
also applies. |
| Sybil resistance | HTTP registries (§5.1a): operator controls (org verification, subscription tiers, rate limits). Optional blockchain registry (§5.1b) only: a minimum stake MAY be required. |
| Bad actor penalties | Optional blockchain registry (§5.1b) only: stake slashing via a dispute contract. Otherwise, registry de-listing and reputation (). |
| Access control | RBAC enforced at transport layer before application dispatch (§4.6, ). |
| Caller identity | Agents restricting who may invoke them MUST verify
aroha-sig (§3.5, )
and fail closed on a missing or unverifiable signature. |
| Discovery privacy | Registries MUST filter by visibility inside the retrieval query, and MUST NOT distinguish "no access" from "does not exist" (§5.4.3, ). |
| Human credential integrity | Ed25519 signature over canonical credential body; expiry checked on every use. |
| Credential revocation | Revoked credentials (DELETE /aroha/credentials/:id)
MUST be rejected on the next use by any verifier that consults
the credential registry. A verifier that works offline cannot
observe a revocation before the credential expires. |
| Mandate revocation | Implementations MUST check a revocation source when one is
configured, for every mandate in a delegation chain, and MUST
reject a chain containing a revoked mandate. When no revocation
source is configured, a mandate remains valid until it expires.
(The reference mandate-chain verifier accepts an
isRevoked hook for this.) |
| Identity revocation (E-form) | A verifier holding a Key Event Log source MUST reject a delegation chain in which any E-form grantor or grantee, or its controller, is revoked, and MUST verify each E-form grantor's signature against its current key (DID Method → Delegation roots). |
| Delegation root | A verifier MAY require the root grantor of a delegation chain to
be a person (an unrevoked E-form identity of kind
person). |
| Key Event Log freshness | Verifiers SHOULD retain the longest verified KEL per identifier, MUST NOT accept a shorter one as current, and MUST treat two different events at one sequence number as duplicity. |
Aroha agents SHOULD advertise protocol compatibility in their manifest:
{ "protocols": ["aroha/1.0", "mcp/2024-11", "a2a/1.0"] }
| External Protocol | Integration Method |
|---|---|
| MCP (Model Context Protocol) | Wrap capabilities as MCP tools via bridge package |
| A2A (Agent2Agent, Linux Foundation) | Map A2A message fields to Aroha envelope fields |
| OpenAPI / REST | Convert OpenAPI spec to capability manifest via adapter |
| LangChain (Python) | aroha.bridges.langchain_bridge — ArohaCapabilityTool extends BaseTool |
| CrewAI (Python) | aroha.bridges.crewai_bridge — ArohaCrewTool extends CrewBaseTool |
| AutoGen (Python) | aroha.bridges.autogen_bridge — aroha_tools_for_autogen() returns FunctionTool list |
| LangChainGo (Go), Spring AI / LangChain4j (Java) | Coming soon, with the Go and Java SDKs |
The preference context may contain sensitive personal information: financial budget, accessibility requirements, dietary constraints, and other user-specific data. Implementers MUST treat this data as personal data under applicable privacy regulations (e.g., GDPR, CCPA).
The protocol enforces minimum data exposure through two mechanisms:
A registry record is itself disclosure: its existence, its owning organisation, and its capability list reveal what a party is building before that party may wish it known. Visibility levels and access grants exist to bound that disclosure.
The privacy property depends on how a registry filters, not merely that it filters. An implementation that retrieves records and then removes the ones the viewer may not see still leaks their existence through result counts, pagination boundaries, and response timing. Filtering MUST therefore happen inside the retrieval query.
Status codes leak in the same way. Answering 403 Forbidden for
a private record confirms that the record exists — an oracle an attacker
can use to enumerate DIDs. A viewer without access MUST receive the same
response as a viewer asking about a record that does not exist.
Credentials presented for discovery are themselves a probing channel: if an unrecognised credential produces an authentication error while a valid one produces "not found", the difference discloses record existence. An invalid credential MUST degrade to the anonymous view instead.
unlisted withholds a record from capability queries but leaves
it resolvable to anyone who learns its didHash. It is
obscurity, and implementers MUST NOT describe it to users as a privacy
guarantee.
Agent DIDs are persistent identifiers. The use of a stable DID across multiple transactions enables correlation of agent behavior by any party that observes the blockchain or HTTPS traffic. Implementers should be aware that:
from and to DID fields
in plaintext.ArohaSatisfactionSignal messages reveal the user's satisfaction with provider agents. These messages MUST remain private to the orchestrating agent and MUST NOT be transmitted to third parties without explicit user consent.
For capabilities that transmit sensitive data (e.g., medical records,
financial details), implementers SHOULD encrypt the body
field using DIDComm v2 JWE [[DIDComm]] with the recipient's public key.
Encryption prevents intermediary infrastructure (TLS terminators, load
balancers) from observing payload content.
Every Aroha message carries an Ed25519 [[RFC8032]] signature over its canonical form. Receivers MUST verify this signature against the sender's public key, resolved for its DID as described in , before processing the message. Unsigned messages MUST be rejected.
The canonical form excludes the proof field and sorts all
object keys lexicographically. This prevents malleability attacks that
add or reorder fields without invalidating the signature.
Each message carries a random 32-byte nonce. Recipients MUST
maintain a nonce registry and reject any message whose nonce was seen
within the message's validity window (the period between created
and expires). The validity window MUST be enforced: messages
with an expires timestamp in the past MUST be rejected
regardless of signature validity.
The window is bounded (a maximum lifetime and a created
skew check), nonces are scoped per sender, and the nonce store is
written only after the signature verifies — see
for the normative rules. An in-memory
nonce store protects only the process that holds it; a deployment with
several instances for one DID needs a shared store.
An attacker who does not possess an agent's Ed25519 private key cannot produce valid signatures for that agent's DID. The Layer 2 registry binds public keys to DIDs, preventing an attacker from substituting their own key; an E-form DID is self-certifying and binds its keys through its Key Event Log. Key rotation requires authorisation by the previous key holder (a transition message signed by the old key, or, for an E-form DID, the pre-committed next key), preventing unilateral key replacement.
With the optional blockchain registry, registration can require staking a minimum amount of cryptocurrency. This raises the cost of creating large numbers of fake agent identities, and agents that behave maliciously can have their stake slashed via the dispute contract, providing an economic disincentive for misbehavior. HTTP registries enforce Sybil resistance through subscription tiers, org verification, or rate limiting instead.
If an orchestrator crashes after sending ArohaReserve but before
sending ArohaCommit or ArohaCancel, provider agents will
auto-cancel after holdDurationMs. Implementations SHOULD
persist saga state to durable storage before sending each reserve, to
enable recovery and explicit cancellation on restart.
Private keys MUST be stored in a Hardware Security Module (HSM) or secure enclave in production deployments. Software-only key storage is permissible for development and testing environments only.
A bearer token authenticates the credential, not the caller.
Every holder of a leaked token is indistinguishable from its owner, so a
token alone cannot answer "which agent is calling?" — the question an agent
restricting its callers actually needs answered. The
aroha-sig scheme answers it by having the caller sign the
request with the private key behind its DID.
Ordering within verification is itself a security property, not an implementation detail:
Registry visibility is not an invocation control. A record marked
private is concealed from discovery, but an endpoint URL that
has already been observed, logged, or shared remains reachable. Agents that
must restrict invocation MUST enforce it themselves and MUST fail closed.
When an RBAC policy is configured, it is enforced at the transport layer before the message reaches application code. This prevents privilege escalation attacks where a low-trust sender crafts a message type it is not permitted to send.
The enforcement model distinguishes two failure modes:
Aroha_UNAUTHORIZED.Aroha_FORBIDDEN.
Credential revocation takes effect on the next use for any verifier that
consults the credential registry: once a credentialId is deleted
via DELETE /aroha/credentials/:id, a subsequent message
bearing that ID is rejected by such a verifier. A verifier that works
offline cannot observe a revocation before the credential expires.
HumanCredential objects carry an Ed25519 signature over their canonical body (identical canonicalization to the message envelope proof). A receiving agent MUST verify this signature before trusting the roles listed in the credential. This prevents a sender from fabricating or tampering with credentials to elevate their own permissions.
Credentials include an expiresAt timestamp that MUST be
checked on every use. Short-lived credentials (24–168 hours) are
RECOMMENDED to limit the window of exposure if a credential is
compromised before explicit revocation.
This profile defines how a shared conversation (a room with more than one person, and possibly more than one agent) carries authority and attribution as signed data, so that an implementation can enforce who may read, write, approve and remember outside the model. It adds no message type: its objects are stored by the runtime and carried inside existing bodies (for example a capability: "invite" request). The JSON Schemas are in spec-public/schemas/ and the conformance vectors in spec-public/vectors/conversation-v1.json.
All signatures in this section are Ed25519 over the UTF-8 bytes of an RFC 8785 (JCS) canonical form, encoded as base64url without padding. Each signed object carries a purpose tag inside the signed bytes, so a signature made for one kind of object never verifies as another.
A signature proves possession of a key that the signer's Key Event Log names. When a runtime holds a person's key and signs on their behalf, the signature does not prove that the person was present.
A room is a signed record held by its host:
{
"v": 1, "purpose": "aroha.room/v1",
"roomId": "<string>", "threadId": "<string>", "ownerDid": "did:aroha:E…",
"epoch": 2,
"members": [{ "did": "<DID>", "kind": "person | agent", "principalId?": "<string>",
"displayName": "<string>", "role": "host | guest | own | invited | delegated",
"joinedEpoch": 0, "leftEpoch?": 3, "consentRef?": "<recordId>" }],
"historyVisibility": "joined | shared", "invocation": "explicit | implicit",
"memoryPolicy": { "personalRead": false, "personalWrite": false,
"roomMemory": "off | consented", "agentRead?": "none | members" },
"disclosure": { "…": "ArohaDisclosure, §12.7" },
"updatedAt": "<ISO8601>", "signature": "<base64url>"
}
Signature. signature is made by the current key of ownerDid over JCS of the record with signature removed. ownerDid MUST resolve, through its Key Event Log, to an identity of kind person; a verifier MUST reject a room signed by any other key.
Rules. Exactly one member has role host, and that member is ownerDid with kind person. Member DIDs are unique. joinedEpoch is not greater than epoch; leftEpoch, when present, is greater than joinedEpoch and not greater than epoch. A person with role guest MUST have a consentRef. A verifier MUST reject a record that has a field this section does not define.
Epochs. The host MUST increment epoch and re-sign the record on every membership change. A member is a member at epoch e when joinedEpoch ≤ e < leftEpoch (or leftEpoch is absent). Turns and facts from a member are bounded by that interval.
Defaults. A host SHOULD create rooms with historyVisibility: "joined" (a late guest sees nothing before their join), invocation: "explicit" (the agent answers only turns whose addressedTo includes it) and a memoryPolicy with every member off.
A person DID (an E-form DID whose Key Event Log inception has kind: "person") MAY sign chat turns, consent records and approvals. A person DID MUST NOT be the from of an ArohaRequest carrying a capability request it did not author; an agent that acts on a person's words sends the request under its own DID and carries the person's authority as a mandate or a signed approval.
Speaker kind. A verifier MUST resolve the kind of a signer (person or agent) from the signer's verified Key Event Log, and MUST NOT take it from the signed object or from the message that carries it. A DID whose kind cannot be resolved that way (a z-form or named DID, an unavailable or invalid log) MUST be treated as agent, because the lesser authority is the safe default. A receiver resolves a person's log from the registry's KEL endpoint or from a log the person supplied, verified as in the DID method specification.
A person invitation is a capability: "invite" request whose invitee is a person DID. It MUST NOT be accepted automatically: it stays pending until the invitee accepts with their own person key, and the acceptance carries a consent record shaped after ISO/IEC TS 27560:
{
"v": 1, "purpose": "aroha.consent/v1",
"recordId": "<string>", "subjectDid": "<person DID>", "roomId": "<string>",
"purposes": ["transcript_retention", "agent_use_of_messages", "memory_write", "provider_processing"],
"withdrawalRoute": "<URL or instruction>",
"events": [{ "event": "given | withdrawn", "purposes": ["…"], "at": "<ISO8601>",
"actorDid": "<DID>", "epoch": 1, "sig": "<base64url>" }]
}
Event signatures. Each event is signed by its own actorDid. The signature covers JCS of { "purpose": "aroha.consent-event/v1", "recordId", "subjectDid", "roomId", "purposes", "withdrawalRoute", "index", "prevHash", "entry" }, where index is the event's position, entry is the event without sig, and prevHash is the lowercase hex SHA-256 of JCS of the previous event including its sig (null for the first event). Because every event is bound to its actor, its position and its predecessor, nobody who appends an event can alter, insert or remove an earlier one.
Rules. A verifier MUST check every event's signature against the current key of that event's actorDid, and every actor MUST resolve to a person. The first event MUST be given. A given event MUST be signed by subjectDid. Any current room member MAY record a withdrawn event for any purpose. When any event's actor is not the subject, the verifier MUST have the room record and MUST reject the consent record unless that actor was a room member at the event's epoch; a member who has left cannot withdraw on someone's behalf. Event purposes are a subset of the record's purposes; at and epoch do not decrease.
Effect. The purposes in force are those given and not later withdrawn, replayed in order. When agent_use_of_messages is not in force for a member, that member's turns MUST be shown to people only and MUST NOT be passed to an agent. When memory_write is not in force, nothing that member says may be written to room memory.
A turn is one message in a room. An authored turn is:
{ "threadId": "<string>", "roomId": "<string>", "epoch": 2, "at": "<ISO8601>",
"contentHash": "<sha256 hex>", "addressedTo": ["<DID>"],
"authorDid": "<DID>", "content": "<text>", "authorSignature": "<base64url>" }
contentHash is the lowercase hex SHA-256 of the UTF-8 bytes of content. authorSignature is made by the author's current key over JCS of { "purpose": "aroha.turn/v1", "threadId", "roomId", "epoch", "at", "contentHash", "addressedTo" }.
A verifier MUST reject a turn whose contentHash does not match its content, whose signature does not verify, or (when it holds the room record) whose author was not a member at the turn's epoch. The runtime sets a turn's author from the authenticated caller, never from the request body. A turn from a guest is untrusted input for gating purposes: an action it leads to requires an approval bound to the host, or to the member who holds the relevant mandate, never to the guest.
A memory record (MemoryFact) has the fields v (1), factId, text, speakerDid, speakerKind (person | agent), subjectDid (self, room, or a member's DID, person or agent), scope (private or room:<roomId>), audience (host | persons | members), epoch, origin (the hash of the signed turn or envelope the fact came from), derivedFrom (the factIds it was derived from), status (fact | claim), consentRef? and createdAt.
speakerKind MUST be resolved as in §12.2 at write time. A fact whose speaker is an agent MUST be stored with status: "claim" and MAY become a fact only through an approval bound to the person it concerns. In a room whose memoryPolicy.personalWrite is false, nothing said in the room may be written to a personal scope. Recall MUST return a fact only when its scope is the asker's private scope or a room the asker is a member of at the current epoch. A fact derived from others MUST carry the strongest taint among its derivedFrom set. When a member leaves, withdraws consent or is deleted, facts with that member as speakerDid or subjectDid in room scope, and facts derived from them, MUST be deleted.
This profile defines the record and these rules; it does not define storage or retrieval structure.
An action receipt is a statement, signed by the acting agent's key, of what it did (or refused to do) and under which approval and mandate. The signature covers JCS of the receipt with signature removed. It proves the agent made these claims; it does not prove they are true.
v1 ("v": 1, "purpose": "aroha.action-receipt/v1"): agentDid, action, argsSha256 (lowercase hex SHA-256 of JCS of the action's arguments), at, tainted, provenance?, approval? (approverDid, approvedAt, approvalId), mandateId?, mandateGrantor?, correlationId?, signature.
v2 ("v": 2, "purpose": "aroha.action-receipt/v2"): every v1 field, plus requesterDid? (who asked), principalDid? (whose authority it ran under), executorDid? (who executed or refused it), presentedHash?, traceparent? (W3C Trace Context), outcome (executed | denied), denialReason?, roomId?, onBehalfOf?; approval gains presentedHash? and approverSignature?.
A verifier MUST accept both versions, and MUST reject a receipt that carries a field its version does not define, a denied receipt without a denialReason, or an executed receipt with one. An implementation SHOULD issue a receipt for a refused action as well as for an executed one.
Presented hash. presentedHash is the lowercase hex SHA-256 of JCS of exactly what was shown to the approver. A UserApproval that carries presentedHash MUST have its userSignature made over JCS of { "invariants", "presentedHash", "purpose": "aroha.user-approval/v2" }; one without it is a legacy approval signed over the key-sorted invariants. A party holding the presented content checks a verified receipt by recomputing the hash; a verifier MUST treat a mismatch with any presentedHash in the receipt as a failure.
An ArohaDisclosure states that a message comes from an AI agent and names the principal it acts for:
{ "v": 1, "agentDid": "<DID>", "principalDid": "<DID>",
"principalKind": "person | organization", "purpose": "<text, at most 512 characters>",
"hop": 0, "aiGenerated": true }
hop is 0 for the agent its principal addressed directly and increases by one per delegation. An envelope MAY carry a disclosure in its optional disclosure field; it is then covered by the envelope signature (§6.2). A receiver MUST reject an envelope whose disclosure is malformed or whose agentDid differs from from. A room carries its agent's disclosure (§12.1), and an implementation SHOULD show it to every member on joining. A disclosure is a statement by the agent; that the principal authorised the agent is shown by a mandate chain rooted in that principal, not by the disclosure.
Aroha is a machine-to-machine protocol with no direct user interface surface. The protocol itself does not create accessibility barriers. However, implementers of agent applications built on Aroha SHOULD ensure that:
wheelchairAccess,
screen reader compatibility) so providers can accommodate them.name, capability
description) MAY contain any Unicode characters.2026-04-14T10:00:00Z)."USD", "EUR").This specification requests registration of the following well-known URI suffix in the IANA Well-Known URI Registry [[RFC8615]]:
aroha-agent.jsonArohaEndpoint service entry.| Code | HTTP | Meaning |
|---|---|---|
Aroha_INVALID_SIGNATURE | 401 | Ed25519 signature verification failed |
Aroha_EXPIRED_MESSAGE | 401 | Message expires is in the past |
Aroha_REPLAY_DETECTED | 401 | Nonce has been seen before |
Aroha_UNAUTHORIZED | 401 | Credential missing, malformed, expired, or from unknown issuer |
Aroha_FORBIDDEN | 403 | Principal is authenticated but lacks the required action permission |
Aroha_UNKNOWN_CAPABILITY | 400 | Capability ID not recognized |
Aroha_TRUST_LEVEL_INSUFFICIENT | 403 | Sender's trust level too low for this operation |
Aroha_RESERVATION_FAILED | 409 | Could not reserve the resource |
Aroha_RESERVATION_EXPIRED | 410 | Reservation hold window has passed |
Aroha_COMMIT_FAILED | 409 | Could not commit the reservation |
Aroha_CANCEL_FAILED | 409 | Could not cancel (operation non-reversible) |
Aroha_INVALID_TOKEN | 404 | Unknown reservation token |
Aroha_NO_INVENTORY | 409 | Resource not available |
Aroha_CAPACITY_EXCEEDED | 503 | Agent capacity limit reached; retry later |
Aroha_SERVICE_UNAVAILABLE | 503 | Agent temporarily unavailable |
Aroha_INTERNAL_ERROR | 500 | Unspecified internal error |
Aroha_INVALID_PARAMS | 400 | Request parameters failed schema validation |
CSN_NO_STRUCTURAL_MATCH | 404 | No capability matched the request's structure (CSN extension;
note: no Aroha_ prefix) |
Aroha_ACTION_LIMIT_EXCEEDED | 403 | Invocation count exceeds the task mandate's actionLimits |
Aroha_COMPUTE_LIMIT_EXCEEDED | 403 | Compute budget (tokens, requests, time) exhausted |
Aroha_REVERSIBILITY_VIOLATION | 403 | Capability is irreversible but the mandate requires reversible actions only |
Aroha_HUMAN_GATE_REQUIRED | 403 | Capability requires human approval before execution |
Aroha_DATA_ACCESS_VIOLATION | 403 | Access to a data resource beyond the mandate's scope |
Aroha_SANDBOX_REQUIRED | 403 | Code execution attempted outside a declared sandbox |
Aroha_DELEGATION_DEPTH_EXCEEDED | 403 | Delegation chain deeper than allowed |
Aroha_CAPABILITY_NOT_PERMITTED | 403 | Capability not in the mandate's allowed list |
Aroha_SETTLEMENT_RAIL_MISMATCH | 409 | Requester's and provider's settlement rails have nothing in common |
Aroha_COMMIT_DISPUTED | 409 | Commit result disputed in the challenge window (ArohaDispute), or resolved against the provider (ArohaDisputeResolution) |
Aroha_NO_MANDATE | 400 | No delegation envelope, and the receiver requires a mandate chain (added 2026-10-26) |
Aroha_CHAIN_INVALID | 400 | Root mandate token of the delegation envelope is malformed (added 2026-10-26) |
Aroha_UNTRUSTED_ROOT | 403 | Root grantor of the mandate chain is not a trusted issuer (added 2026-10-26) |
Aroha_ROOT_KEY_MISMATCH | 403 | Envelope's root key does not match the trusted key for the root grantor (added 2026-10-26) |
Aroha_CHAIN_REJECTED | 403 | Mandate chain failed verification (added 2026-10-26) |
Aroha_SCOPE_UNKNOWN | 403 | Receiver could not determine what the request does, so cannot check it against the mandate (added 2026-10-26) |
Aroha_CONTEXT_MISMATCH | 403 | Request's room or principal differs from the task mandate's roomId / onBehalfOf (added 2026-10-26) |
The code string in the ArohaError body is
normative; the HTTP status is a recommendation for HTTP transports. The
first 17 codes are shared by every reference SDK; the remaining 18 are
implemented in the TypeScript reference only, and a receiver MUST treat an
unknown code as a generic, non-retryable error unless retryable says
otherwise.
Reference SDKs implement the protocol in four languages. Their use is optional — any software that correctly implements the rules in this document is a conformant Aroha implementation.
@aroha-sdk/*)Organized to mirror the protocol layers exactly:
@aroha-sdk/core → Layers 0–3 (transport, identity, crypto, messaging)
@aroha-sdk/core/identity — DID generation (z-form, E-form, named), Key Event
Logs (inception, rotation, recovery, revocation),
z→E migration linkage, W3C VP issuance
@aroha-sdk/core/crypto — Ed25519 sign/verify, RFC 8785 JCS, DIDComm v2 JWE
@aroha-sdk/core/messages — Envelope build/validate (§6.3 rules), nonce
registry, the 19 message types, error codes
@aroha-sdk/core/transport — HTTPS + WebSocket server and client
(the package root re-exports all of these; the subpaths let runtimes without
Node APIs, such as edge workers, import identity/crypto/messages alone)
@aroha-sdk/credentials → Spending mandates (v2 tokens, §6.5: issue, attenuate,
verifyMandateChain, redemption), task mandates, RBAC,
Human Credentials, auth middleware
@aroha-sdk/delegation → Multi-hop delegated serving: attenuated task-mandate
chains verified against trust anchors at every hop
@aroha-sdk/settlement → Extension: ApiKey, Quota, Escrow Settlement
@aroha-sdk/commerce → Extension: B2B, B2C, C2B Commerce Agreements
@aroha-sdk/registry → Layer 2 (HTTP client, discovery; subpaths
/contract, /ipfs, /discover, /server, /sar,
/personal-name)
@aroha-sdk/orchestrator → Extension: orchestration (saga engine, agent selector, negotiator)
@aroha-sdk/preferences → Extension: preference context (profile, filter, scorer, satisfaction)
@aroha-sdk/mcp-bridge → MCP interoperability adapter
@aroha-sdk/a2a-bridge → A2A interoperability adapter
The v2 mandate token format (),
the envelope validation rules of and
E-form DID / Key Event Log verification are implemented in TypeScript,
Python, Go and Java, each tested against the shared vectors in
packages/aroha-credentials/test-vectors/mandate-v2.json.
aroha on PyPI)aroha.identity → DID generation, Ed25519 keys, multibase encoding aroha.crypto → Sign/verify/canonicalize, AES-256-GCM encryption aroha.messages → Envelope build/validate, nonce registry aroha.transport → FastAPI server, httpx client aroha.orchestrator → SagaEngine, AgentSelector aroha.bridges.langchain_bridge → ArohaCapabilityTool (LangChain BaseTool) aroha.bridges.crewai_bridge → ArohaCrewTool (CrewAI BaseTool) aroha.bridges.autogen_bridge → aroha_tools_for_autogen() (AutoGen FunctionTool)
Install extras: pip install aroha[langchain],
[crewai], [autogen]
Partial Go and Java implementations exist in the reference repository
(sdks/go, sdks/java). They cover the envelope,
signature validation, v2 mandate chains, E-form DID verification and sagas,
but not the full protocol surface. Neither is published as a stable artifact yet.
Status of the non-TypeScript SDKs: Python, Go and Java
implement v2 mandate tokens (issue, attenuate, chain verification), the
envelope rules and E-form DID / Key Event Log verification. Their
did:aroha-web support still follows the earlier schema, and
they do not implement the four TypeScript-only message types or the 11
TypeScript-only error codes; see each SDK's README.
Nothing in this specification depends on either. The normative requirements are language agnostic, so an implementer in any language can conform today by following the protocol directly — the conformance matrix, not any particular codebase, is the definition of correctness.
contracts/ArohaRegistry.sol → Agent registration, capability indexing, staking, key rotation contracts/ArohaEscrow.sol → Payment escrow for saga transactions contracts/ArohaReputation.sol → Outcome recording, reputation oracle (EMA scoring)
These contracts are not wired into DID resolution in the reference implementation; see the implementation note in .
This appendix is non-normative and describes future work. No reference implementation supports post-quantum keys today. RFC 2119 keywords in this appendix describe intended future requirements, not requirements of Aroha 1.0 conformance.
This appendix defines how implementations transition from Ed25519 to post-quantum (PQ) signature schemes without a protocol flag-day or breaking change.
Ed25519 (128-bit classical security) is vulnerable to Shor's algorithm on a sufficiently powerful quantum computer. NIST has standardized three post-quantum signature schemes:
| Algorithm | Standard | Public key | Signature | Notes |
|---|---|---|---|---|
| ML-DSA-44 (Dilithium2) | FIPS 204 | 1,312 bytes | 2,420 bytes | Recommended for most Aroha deployments |
| SLH-DSA-128s (SPHINCS+) | FIPS 205 | 32 bytes | 7,856 bytes | Conservative / hash-based; largest signatures |
| FN-DSA-512 (Falcon-512) | FIPS 206 | 897 bytes | ~666 bytes | Compact signatures; complex implementation |
All three are supported as primary or additional keys in did:aroha DID Documents.
The entire signing surface in the Aroha TypeScript SDK is isolated to two files:
packages/aroha-core/src/crypto/signing.ts — exports
sign(message, privateKey),
verify(message, sig, publicKey),
canonicalize(obj). Replace the
@noble/ed25519 import here.packages/aroha-core/src/identity/did.ts — generates
keypairs; update to produce PQ keys and the correct multibase
prefix.
All callers — buildEnvelope, validateEnvelope,
or issueHumanCredential/verifyHumanCredential
(if using @aroha-sdk/credentials) — are unaffected.
Add a second verificationMethod entry for the PQ key. The
existing Ed25519 entry remains valid during the hybrid period:
{
"verificationMethod": [
{
"id": "did:aroha:example#key-1",
"type": "Ed25519VerificationKey2020",
"publicKeyMultibase": "z6Mk..."
},
{
"id": "did:aroha:example#key-pq",
"type": "Mldsa44VerificationKey2025",
"publicKeyMultibase": "u<base64url-1312-bytes>"
}
],
"authentication": [
"did:aroha:example#key-1",
"did:aroha:example#key-pq"
]
}
Supported type strings:
| Algorithm | verificationMethod.type |
Multibase prefix |
|---|---|---|
| ML-DSA-44 | Mldsa44VerificationKey2025 |
u (base64url) |
| SLH-DSA-128s | SlhDsa128sVerificationKey2025 |
u (base64url) |
| FN-DSA-512 | FnDsa512VerificationKey2025 |
u (base64url) |
The proof.verificationMethod field in each message
envelope specifies which key was used. Receivers MUST support any
key type listed in the sender's DID Document.
The hybrid period allows Aroha agents to accept both Ed25519 and PQ signatures simultaneously. Four steps, zero downtime:
proof.verificationMethod.
proof.verificationMethod field tells the receiver exactly
which key to use.
updatePublicKey(),
replacing the 32-byte Ed25519 public key with the PQ public key.
Sign the rotation proof with the Ed25519 private key one final
time.
The ArohaRegistry contract stores
bytes calldata publicKey without type annotation.
For PQ keys, pass the full serialized public key bytes (e.g.,
1,312 bytes for ML-DSA-44). The contract requires no modification.
Key rotation follows the same updatePublicKey flow — sign
the rotation message with the current key (whether Ed25519 or PQ) and
provide the new PQ public key.
Implementations SHOULD add PQ key support before quantum computers capable of breaking 128-bit elliptic curve keys become publicly available. Aroha Working Group estimates this as a 10–15 year horizon from the date of this specification.
A Aroha agent that supports only Ed25519 remains conformant with Aroha 1.0. Support for at least one NIST-standardized PQ scheme will be REQUIRED in Aroha 2.0. The Aroha Working Group will publish a migration deadline notice at least 24 months before Aroha 2.0 becomes the required version.