TAP JSON Schemas
This directory contains JSON Schema definitions for all Transaction Authorization Protocol (TAP) message types and data structures.
Overview
The schemas are organized into three main categories:
/common
- Base type definitions (CAIP types, DID types, base structures)/data-structures
- Reusable data structures (Party, Agent, Policy, etc.)/messages
- Message type schemas for all TAP messages
All schemas are publicly accessible via GitHub Pages at:
- Base URL:
https://taips.tap.rsvp/schemas/
- Example:
https://taips.tap.rsvp/schemas/messages/transfer.json
Schema Standards
All schemas follow:
- JSON Schema draft 2020-12
- Use
$id
for unique identification - Include detailed descriptions
- Reference common definitions to avoid duplication
Message Types
The following TAP message types have schemas defined:
Transaction Messages
transfer.json
- Initiates a virtual asset transferpayment.json
- Payment request with optional invoice
Authorization Flow
authorize.json
- Authorization request/responsesettle.json
- Settlement confirmationreject.json
- Transaction rejectioncancel.json
- Transaction cancellationrevert.json
- Transaction reversal request
Agent Management
update-agent.json
- Update agent detailsupdate-party.json
- Update party informationadd-agents.json
- Add new agentsreplace-agent.json
- Replace existing agentremove-agent.json
- Remove agent from transaction
Relationship & Policy
confirm-relationship.json
- Confirm party-agent relationshipupdate-policies.json
- Update agent policies
Connection Management
connect.json
- Establish TAP connectionauthorization-required.json
- Request authorizationout-of-band-invitation.json
- Out-of-band connection invitation
Validation
To validate test vectors against schemas:
# Install dependencies
npm install
# Run validation
npm run validate
The validation script will:
- Load all schemas
- Validate test vectors from
/test-vectors
- Report validation results
Usage Example
const Ajv = require('ajv');
const addFormats = require('ajv-formats');
const transferSchema = require('./messages/transfer.json');
const ajv = new Ajv();
addFormats(ajv);
const validate = ajv.compile(transferSchema);
const valid = validate(transferMessage);
if (!valid) {
console.log(validate.errors);
}
Schema Development
When creating or modifying schemas:
- Follow the existing pattern and structure
- Use
$ref
to reference common definitions - Include comprehensive descriptions
- Test against relevant test vectors
- Ensure TypeScript types match the schema