This repository is the canonical, versioned source of truth for OIF protocol standards and specifications.
It includes:
- API standards for Quote, Intent submission, and Asset discovery
- Machine-readable OpenAPI schemas
- Language-friendly TypeScript interfaces for client/server implementation
specs/openapi.yaml: OpenAPI 3.0 specification covering Quote, Intent, and Asset discovery endpointsschemas/typescript/types.ts: TypeScript interfaces for all OIF protocol typesschemas/typescript/schemas.generated.ts: Auto-generated Zod schemas from TypeScript typesdocs/references.md: Curated external references to related off-chain APIs and intent protocols
OIF uses CAIP-350 text identifiers for chain-specific addresses in the API. This provides a human-readable, integrator-friendly format that is easy to work with.
All addresses in the API use the ChainAddress object format:
{
"chain": "eip155:8453",
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}- chain: CAIP-2 chain identifier (e.g.,
eip155:1for Ethereum,eip155:8453for Base) - address: Native address format (e.g.,
0x...for EVM chains)
// USDC on Ethereum mainnet
{
"chain": "eip155:1",
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}
// vitalik.eth on Base
{
"chain": "eip155:8453",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}- CAIP-2: Chain identifier format
- CAIP-10: Account identifier format
- CAIP-350: Text identifier for chain-specific addresses
Note: On-chain contracts (oif-contracts) continue to use ERC-7930 binary format for gas efficiency. Solvers and tooling handle the conversion between text (API) and binary (on-chain) representations.
This repository defines the following endpoints:
- Quote: quote generation for requested outputs based on available inputs
- Intent: submit a previously quoted, signed order for execution
- Asset Discovery: discover supported assets and chains
GET /api/tokens: returns all supported assets across all configured blockchain networksGET /api/tokens/{chain}: returns supported assets for a specific chain (e.g.,eip155:1)
Authoritative schema: specs/openapi.yaml
TypeScript-friendly interfaces are provided in schemas/typescript/types.ts
To express user preference for gasless execution and who submits the origin transaction, use originSubmission:
{
"originSubmission": {
"mode": "user", // or "protocol"
"schemes": ["erc-4337", "permit2", "erc20-permit", "eip-3009"]
}
}- mode: who is expected to submit the origin transaction.
- schemes: acceptable signing/authorization schemes for interoperability.
Notes:
- This is orthogonal to
lock(asset state) and focuses on submission responsibility and signing surface.
To discover which assets and chains are supported by a provider, use the asset discovery endpoints:
GET /api/tokens: Returns all supported networks and their assetsGET /api/tokens/{chain}: Returns assets for a specific chain (e.g.,eip155:1)
The response includes asset metadata (address in CAIP-350 format, symbol, and decimals) for each supported network. This enables clients to build asset and chain selection UIs and validate that a provider can theoretically fulfill a given intent before requesting quotes.
Example response:
{
"networks": {
"eip155:1": {
"chain": "eip155:1",
"assets": [
{
"address": { "chain": "eip155:1", "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" },
"symbol": "USDC",
"decimals": 6
}
]
}
}
}The OpenAPI specification is auto-generated from TypeScript types using a TypeScript → Zod → OpenAPI pipeline. To regenerate:
npm install
npm run generate:openapiThe TypeScript types in schemas/typescript/types.ts are the source of truth. The generation process:
ts-to-zodconverts TypeScript types to Zod schemas with validation@asteasolutions/zod-to-openapiconverts Zod schemas to OpenAPI specification- JSDoc annotations (@description, @pattern, @example) are preserved throughout the pipeline
Use any of the following online viewers. After this repo is public, you can point them directly to the raw openapi.yaml URL; until then, copy-paste the YAML content into the viewer.
- Swagger Editor: open
https://editor.swagger.io/and paste the contents ofspecs/openapi.yaml.
No local server is required.
The specs follow semantic versioning at the file level. Backwards-compatible changes (additive fields) will increment the minor version via Git tags/releases. Breaking changes will increment the major version. See Git history and release notes for details.
- Propose changes via pull request with rationale and, where applicable, example payloads.
- Modify TypeScript schemas in
schemas/typescript/types.tsand runnpm run generate:openapito update the OpenAPI spec. - Favor explicit types and self-explanatory naming. Avoid ambiguous or protocol-specific jargon without a definition.
This repository is licensed under the terms of the LICENSE file at the root of the repository.