§ Ayra TRQP Implementers Guide

State: DRAFT

NOTE

See the Profile for the Ayra TRQP Profile

This document is a non-normative guide to help a member Trust Registry expose authorization and recognition information governed by the authority or authorities it serves through the Trust Registry Query Protocol (TRQP). The resulting interface supports direct use by consumers and participation in the Ayra-operated Registry of Registries (RoR) that anchors the Ayra Trust Network (ATN). It is intended as a starting point for bridging existing trust frameworks through a standardized interface; neither the profile nor the RoR becomes the source of a member registry’s authority.

§ Core Principle

The registry informs the decision.

The relying party makes the decision.

TRQP provides authorization and recognition information. It does not make a trust, acceptance, or transaction decision. In this principle, “relying party” is shorthand for any consuming organization or system that uses the information under its own policy, including a verifier, wallet application, agent, or other service.

§ Important Pre-Reads

Before diving into implementation details, we recommend familiarizing yourself with:

§ Source of Truth

This guide is non-normative. Use it for explanation, examples, and implementation patterns.

When this guide appears to conflict with a normative source, use this order:

  1. TRQP v2.0 for the core protocol model, HTTPS binding, and core field names.
  2. W3C DID Core for DID URI, DID method, DID controller, and DID Document semantics.
  3. Ayra TRQP Profile API for the Ayra API surface, request and response schemas, parameters, and status codes.
  4. Ayra TRQP Profile for Ayra conformance policy.

Practical rules to keep in mind:

§ API Specifications

The canonical API specification for Ayra TRQP is maintained as a single OpenAPI file and can be browsed interactively:


§ TRQP Basics: Bridging Your Ecosystem

§ Overview

The Trust Registry Query Protocol (TRQP) is not intended to replace an existing intra-trust framework (such as OpenID Federation, X.509 PKI, EBSI Trust Chains, TRAIN, etc.). Rather, it acts as a bridge across frameworks, answering critical questions about who is authorized to do what under a particular governance framework.

TRQP v2.0 uses the PARC model (Principal, Action, Resource, Context) for all queries:

PARC Element TRQP Field Description
Principal entity_id The entity being tested (e.g. an issuer DID)
Action action What action is being checked (e.g. issue, verify)
Resource resource What the action applies to (e.g. credential:driverlicense)
Context authority_id + context The ecosystem being queried, plus optional parameters like time

TRQP defines two main query types:

  1. Authorization Query (POST /authorization) – “Does Entity X have authorization to perform Action Y on Resource Z, according to Ecosystem W?”
  2. Recognition Query (POST /recognition) – “Does Ecosystem A recognize Ecosystem B for Action Y on Resource Z?”

Within the Ayra Trust Network, conforming to both queries is a minimum requirement to participate.

When bridging into an ecosystem, you may need adapters tailored to that ecosystem’s internal trust framework. The diagram below shows the conceptual architecture:

graph LR subgraph Ayra Trust Network ATN_Registry[Registry of Registries] end subgraph Your Ecosystem Profile[Ayra Profile] Bridge[TRQP v2.0] TR[Trust Registry] SoR[System Of Record] end Profile -->|complies with| Bridge Bridge -->|bridges| TR TR -->|serves| SoR Bridge -->|authorization| Verifier ATN_Registry -->|recognition| Verifier

You can develop or reuse any internal trust model you prefer. The profile requires you to expose the necessary TRQP endpoints so that external consumers can query the authorization and recognition information your registry is governed to provide.

§ Key Participants

Participant Description
TRQP API Provider Vendors that supply a Trust Registry Query Protocol (TRQP) service on behalf of an ecosystem.
Ayra Metaregistry Operators The set of metaregistry operators that serve the Ayra Trust Network state by relaying recognized ecosystems.
TRQP Consumer An organization or system that uses registry information under its own policy. This may be a verifier, wallet application, agent, relying organization, or other service.
Ecosystem Ecosystems leverage TR vendors to manage their authority state. Each authority remains responsible for the information and rules within its domain of control.

§ Key Takeaways

  1. The registry informs the decision; the relying party makes the decision. “Relying party” here includes any consuming organization or system. TRQP supplies authorization and recognition information; the consumer makes or automates its own trust, acceptance, or transaction decision under its applicable policy.
  2. TRQP complements your systems of record, operational processes, and governance frameworks. It provides a simple, consistent way for external systems to query your system for only the answers you are willing to provide.
  3. TRQP is a bridge across frameworks and is agnostic to specific internal trust methods.
  4. You must handle how to map your internal trust model to TRQP’s PARC query structure.
  5. TRQP answers two questions:
    • Is this entity authorized? – “Does Entity X have the right to perform Action Y on Resource Z, in the context of Ecosystem W?”
    • Do you recognize this other ecosystem? – “Does Ecosystem A recognize Ecosystem B for Action Y on Resource Z?”

§ Ayra Profile at a Glance

Ayra-conformant Trust Registries:


§ Conformance Checklist

The following table maps TRQP v2.0 conformance requirements to what an Ayra implementer must provide. This is a summary; refer to the TRQP v2.0 specification and Ayra Profile for normative requirements.

Requirement TRQP v2.0 Ayra Profile
Query types MUST support at least one (authorization OR recognition) MUST support BOTH /authorization AND /recognition
HTTP method POST with JSON body POST with JSON body
Request Content-Type MUST be application/json MUST be application/json
Required query fields entity_id, authority_id, action, resource entity_id, authority_id, action, resource
Identifier format RFC 3986 URI strings DID URI strings; supported DID methods are discoverable via /lookups/didMethods; did:webvh is preferred for higher assurance levels
DateTime format RFC 3339, Z offset only RFC 3339, Z offset only
Error format RFC 7807 Problem Details using application/problem+json RFC 7807 Problem Details using application/problem+json
HTTP status codes 200, 400, 401, 404, 500 Core endpoints additionally support profile-defined 429; core endpoints MUST NOT return 501; unsupported optional extension endpoints return 501
Response signing Not required by TRQP core SHOULD return JWS signed by the Trust Registry controller or operator
Metadata endpoint Not defined in TRQP core OPTIONAL: GET /metadata (Ayra extension); response shape is defined by the OpenAPI
Lookup endpoints Not defined in TRQP core OPTIONAL: assurance levels, authorizations, DID methods (Ayra extensions)
Ecosystem/authority ID RFC 3986 string; globally unique for authority_id DID URI string; globally unique for authority_id; supported DID methods are defined by the authority and may carry assurance limits
Trust Registry ID Not prescribed DID URI string; supported DID methods are defined by the registry and may carry assurance limits

§ Core Requirements for the Ayra Trust Network

To be a compatible Trust Registry for Ayra, your registry must support the Ayra TRQP Profile.

Your implementation MUST:

Your implementation SHOULD sign responses with JWS using the Trust Registry controller’s or operator’s keys where supported.

This means your ecosystem must track and provide the state of who is authorized to do what, and publish that data via a TRQP-enabled endpoint.

sequenceDiagram participant Verifier participant TrustRegistry Verifier->>TrustRegistry: POST /authorization {entity_id, authority_id, action, resource} TrustRegistry->>Verifier: {authorized: true/false, time_evaluated, ...}
NOTE

One key concept of the TRQP and Ayra is the concept of Ecosystems. This conceptual pattern is very important and by designing things with it in mind, you may save significant time integrating.


§ Request and Response Examples

§ Authorization Query

Request:

POST /authorization
Content-Type: application/json

{
  "entity_id":    "did:webvh:example.com:issuer-123",
  "authority_id": "did:webvh:example-ecosystem.org",
  "action":       "issue",
  "resource":     "credential:driverlicense",
  "context": {
    "time": "2026-02-17T12:00:00Z"
  }
}

Success Response (200):

{
  "entity_id":      "did:webvh:example.com:issuer-123",
  "authority_id":   "did:webvh:example-ecosystem.org",
  "action":         "issue",
  "resource":       "credential:driverlicense",
  "authorized":     true,
  "time_evaluated":  "2026-02-17T12:00:00Z",
  "time_requested":  "2026-02-17T12:00:00Z",
  "message":        "Entity is authorized to issue credential:driverlicense"
}

Error Response (404):

HTTP/1.1 404 Not Found
Content-Type: application/problem+json

{
  "type":   "https://example.com/problems/entity-not-found",
  "title":  "Entity not found",
  "status": 404,
  "detail": "Entity did:webvh:example.com:issuer-123 is not registered in this ecosystem."
}

§ Recognition Query

Request:

POST /recognition
Content-Type: application/json

{
  "entity_id":    "did:webvh:partner-ecosystem.org",
  "authority_id": "did:webvh:ayra.forum",
  "action":       "recognize",
  "resource":     "ecosystem"
}

Success Response (200):

{
  "entity_id":      "did:webvh:partner-ecosystem.org",
  "authority_id":   "did:webvh:ayra.forum",
  "action":         "recognize",
  "resource":       "ecosystem",
  "recognized":     true,
  "time_evaluated":  "2026-02-17T12:00:01Z",
  "message":        "Ecosystem is recognized by the Ayra Trust Network"
}

§ Registering Your Ecosystem with Ayra

Joining the Ayra Trust Network involves:

  1. Providing a valid DID for your ecosystem.
  2. Completing the Ayra Trust Network governance process (review, approval, etc.).

§ Creating an Identifier for Your Registry

  1. Prepare Your Trust Registry Keys – Generate cryptographic keys for your Trust Registry identifier when the identifier method supports controller keys.

  2. Create Your Trust Registry ID – Use a globally unique DID for the registry. The DID method you choose may affect the assurance level the registry can claim. did:webvh is preferred and may be required for higher assurance levels, while other DID methods may be acceptable according to authority policy. The DID Document should include at least one service endpoint referencing a TRQP profile at https://ayra.forum/profiles/trqp/tr/v2.

§ Creating an Identifier for Your Ecosystem

  1. Prepare Ecosystem Keys – Generate cryptographic keys for your ecosystem identifier when the identifier method supports controller keys.

  2. Generate Your Ecosystem/Authority ID – The ecosystem DID is normally used as the TRQP authority_id. The DID Document should make the ecosystem governance framework and authoritative Trust Registry endpoint(s) discoverable.

  3. Provide Your Ecosystem/Authority ID to Ayra – Complete the governance review and register your ecosystem identifier with Ayra.


§ Performing Authority Queries as a Verifier

Below is a step-by-step process for how a verifier would make TRQP queries.

§ Step 1: Check Ecosystem Recognition

  1. Resolve Ayra’s DID – Retrieve Ayra’s DID document (did:webvh:ayra.forum) to find its TRQP endpoints.

  2. Query the Ayra Trust Network for Recognition:

POST /recognition
Content-Type: application/json

{
  "entity_id":    "{target_ecosystem_id}",
  "authority_id": "did:webvh:ayra.forum",
  "action":       "recognize",
  "resource":     "ecosystem"
}

If the target ecosystem is recognized, the response indicates recognized: true.

§ Step 2: Check Entity Authorization

  1. Resolve the Target Ecosystem’s DID – Extract the TRQP endpoint from the ecosystem DID’s service endpoints.

  2. Query the Ecosystem’s Trust Registry:

POST /authorization
Content-Type: application/json

{
  "entity_id":    "{entity_id}",
  "authority_id": "{target_ecosystem_id}",
  "action":       "issue",
  "resource":     "credential:driverlicense"
}

The response indicates whether the entity is authorized: true or authorized: false.

§ Full Verification Flow

sequenceDiagram participant Verifier participant DIDRes as DID Resolver participant AyraTR as Ayra Trust Registry participant EcoTR as Ecosystem Trust Registry Note over Verifier: Step 1 - Recognition Verifier->>DIDRes: Resolve did:webvh:ayra.forum DIDRes->>Verifier: DID Document Verifier->>Verifier: Extract Ayra TR endpoint Verifier->>AyraTR: POST /recognition AyraTR->>Verifier: {recognized: true/false} Note over Verifier: Step 2 - Authorization Verifier->>DIDRes: Resolve Target Ecosystem DID DIDRes->>Verifier: DID Document Verifier->>Verifier: Extract Trust Registry DID or TRQP service endpoint Verifier->>DIDRes: Resolve TR DID DIDRes->>Verifier: DID Document with TRQP endpoint Verifier->>Verifier: Extract authorization endpoint Verifier->>EcoTR: POST /authorization EcoTR->>Verifier: {authorized: true/false} Note over Verifier: Make trust decision

§ Bridge Case Studies

Detailed bridge case studies demonstrating how to connect specific trust frameworks to TRQP are planned for a future iteration. Target frameworks include:


§ Ayra Extension Endpoints

The Ayra Trust Network defines additional endpoints on top of TRQP core. These endpoints enable discovery of ecosystem-specific data beyond basic authorization and recognition. They are optional. Registries that do not implement an extension endpoint return HTTP 501 with a Problem Details response.

Endpoint Description Use Case
GET /metadata Retrieve Trust Registry metadata Initial discovery of a registry’s identity and published metadata; response shape is defined by the OpenAPI
GET /entities/{entity_id} Retrieve entity information Look up details about a specific entity in the registry
GET /entities/{entity_id}/authorizations List authorizations for an entity Discover all authorizations an entity holds
GET /ecosystems/{ecosystem_id} Retrieve ecosystem information Look up details about a specific ecosystem
GET /ecosystems/{ecosystem_id}/recognitions List recognized ecosystems Discover which ecosystems are recognized under a governance framework
GET /lookups/assuranceLevels Discover assurance levels Understand what assurance levels (e.g. LoA2, LoA3) are supported
GET /lookups/authorizations Discover available authorizations Learn what action+resource pairs are valid in an ecosystem
GET /lookups/didMethods Discover supported DID methods Determine which DID methods are accepted and whether assurance-level limits apply

See the Ayra TRQP Profile API for full details on request parameters, response schemas, and error codes.


§ Error Handling

All error responses MUST conform to RFC 7807 Problem Details and use Content-Type: application/problem+json. The OpenAPI specification defines the status codes for each endpoint. The most common statuses are:

RFC 7807 remains the applicable requirement because this Ayra profile targets TRQP v2.0. RFC 9457 has obsoleted RFC 7807 at the IETF level, but it is only a forward-compatibility consideration for Ayra unless a future TRQP version and corresponding Ayra profile version expressly adopt it. Both versions use application/problem+json; clients cannot infer the governing RFC from the media type or the core Problem Details members.

Status Code Meaning When to Use
200 Success Query processed successfully; check authorized or recognized field for result
400 Bad Request Invalid JSON, missing required fields, malformed identifiers
401 Unauthorized Missing or invalid bearer token (when authentication is required)
404 Not Found Entity, authority, action, or resource not recognized by this registry
429 Too Many Requests Request rate limit exceeded; no authorization or recognition result was returned
500 Internal Server Error Unexpected server failure
501 Not Implemented Optional Ayra extension endpoint is not implemented
NOTE

A 200 response with authorized: false or recognized: false is not an error – it means the query was processed successfully and the answer is negative. Use 404 only when the registry does not recognize the identifiers or query terms at all. Core /authorization and /recognition endpoints are mandatory for Ayra and should not use 501 to signal non-support.

§ Rate Limiting

Registries may apply rate limits to any core or extension endpoint. If a registry returns a response because a rate limit was exceeded, it uses HTTP 429 with an RFC 7807 Problem Details body:

HTTP/1.1 429 Too Many Requests
Content-Type: application/problem+json
Retry-After: 60
Cache-Control: no-store

{
  "type": "about:blank",
  "title": "Too Many Requests",
  "status": 429,
  "detail": "The request rate limit has been exceeded."
}

Retry-After should be included when useful retry timing is available. A consumer should honor it; if it is absent, use bounded exponential backoff with jitter according to local policy. Do not parse title or detail for retry timing.

The about:blank type is sufficient for the standard HTTP 429 meaning. A registry may instead use a stable, documented problem type URI and may add extensions such as documentation or contact. Consumers must ignore extensions they do not recognize.

A 429 response means that the registry did not answer the authorization or recognition question. Never interpret it as authorized: false or recognized: false, and never store it as a negative result. Responses with status 429 must not be stored by a cache.

This response shape conforms to RFC 7807 and is also compatible with RFC 9457. Supporting it does not adopt RFC 9457 as the normative error specification for this profile.


§ Security Considerations

§ Key Security Takeaways


§ Smoke Testing

This repository includes a lightweight smoke test at tests/api_conformance_test.py. Use it to check that a registry exposes the expected endpoint shape and returns profile-shaped JSON for implemented endpoints.

The smoke test is not a certification suite. It does not prove full protocol, governance, credential-flow, or interoperability conformance.

Example:

python tests/api_conformance_test.py --base-url https://example-trust-registry.com

§ Q&A

§ What is an Ecosystem Governance Framework (EGF)?

An EGF is the overarching governance model for a digital trust ecosystem. It may incorporate policies, credential rules, or references to other frameworks. In practice, it is typically a set of documents published at an HTTP-resolvable URI describing how the ecosystem operates, its rules, and its participants’ obligations.

The Ayra Profile requires the EGF URI to be discoverable through the Ecosystem DID’s service endpoints.

§ How should I think about authorizations?

An authorization represents a set of privileges granted to an entity – an “official” sanction to perform a cryptographic function or other sensitive activity. (Source: NIST SP 800-57 Part 2 Rev.1)

In TRQP v2.0, an authorization is expressed as an action + resource pair (e.g. action=issue, resource=credential:driverlicense). Your internal authorization models are entirely up to you. External consumers will query with these parameters and receive a boolean authorized response.

§ What types of entries can I support?

TRQP is not prescriptive about your internal model. As long as you can map (entity_id, authority_id, action, resource) to a boolean authorization state, you can use TRQP.

§ What is the difference between recognition and authorization?

§ Does this work offline?

You can cache recognition and authorization data locally, but it may become stale. Whether you allow offline checks depends on your ecosystem’s tolerance for stale information. There are no specific requirements for caching behavior.

§ What about “phone home”?

The TRQP HTTPS binding requires real-time HTTP calls to the registry. Future bindings (e.g. DIDComm, TSP) may offer alternatives that reduce or eliminate the need for real-time connectivity.

§ Is a query to the Ayra Trust Network private?

No Personally Identifiable Information is shared when making a query. Queries are formed only using DIDs and action/resource strings. However, correlation risks exist at the network level (IP addresses combined with query patterns).

§ How does this fit with regulatory requirements?

Local ecosystems must ensure compliance with their regulatory obligations. Ayra’s governance process includes regulatory and policy alignment at the network level. Consult the Ayra governance documentation for specific requirements.

✕
Table of Contents ✕