Skip to main content

OnDB

The missing infrastructure between proprietary data and AI agents. One API to discover, query, and pay for proprietary data across any provider. Supports automatic per-query payments via x402 and Stripe MPP, with cross-provider joins and automatic revenue splitting.

Data Availability (DA) Layer

The underlying storage layer providing verifiable data persistence. OnDB optionally stores data on a DA layer for immutability and cryptographic verification.

Collection

A logical grouping of documents, similar to a table in traditional databases.

Document

A JSON record stored in a collection.

App Key (X-App-Key)

API key for application-level operations, required for write operations. Sent via X-App-Key header.

Payment Callback

Payment callback pattern where store() receives a callback function that handles payment when the server provides a quote. The caller processes the USDC payment and returns the transaction details.

Index (Required)

Data structure that enables efficient query performance. REQUIRED for production use - every collection MUST have at least one index. Without indexes, queries perform slow full collection scans and collections are not visible in the OnDB dashboard. Supports hash (for equality lookups) and btree (for range queries) index types with optional unique constraints. Always create indexes BEFORE storing data.

Namespace

Logical grouping mechanism in the DA layer that isolates data for different collections.

Payment Proof

Transaction verification required for write operations, containing tx hash, addresses, and payment amount.

Broker

Intermediary service that handles payment processing and revenue distribution for OnDB operations.

PriceIndex

Special index type that changes payment model from data-size-based to field-value-based, enabling revenue-sharing business models for applications built on OnDB. Perfect for building e-commerce platforms, ticketing systems, and marketplace applications.

Auto-Pay

Automatic payment flow available when using an Agent Key (X-Agent-Key). The broker handles USDC payments automatically on behalf of the agent, subject to configured spend limits. No payment callback is needed.

Agent Key (X-Agent-Key)

App Key with the Pay permission. Enables autonomous agents to pay other apps inline using USDC. Supports configurable spend limits and target app whitelisting. Enables Auto-Pay for writes.

Revenue Split

Automatic distribution of payments when using PriceIndex (default: 80% to app owner, 20% to platform). Configurable via PriceConfig when creating a Price index.

HTTP 402 Payment Required

Protocol for paid read operations where queries return a quote before data access, enabling pay-per-query monetization.

X402Quote

Payment quote format passed to the payment callback during store() operations. Contains quoteId, totalCost, brokerAddress, network, chainType, and payment details. Supports multi-chain payments (Cosmos, EVM, Solana).

PaymentRequiredError

SDK error thrown by QueryBuilder.execute() when a query requires payment. Contains a paymentRequired property of type X402PaymentRequiredResponse with an accepts array of payment options. Catch this error to handle payment flows in applications.

Quote ID

Unique identifier for a payment quote that must be included when re-querying after payment.

Task Ticket

Unique identifier for async operations, used to track operation status and completion.

Blob Storage

Binary file storage capability for images, videos, documents up to 2MB with custom metadata.

Query Builder

Fluent API for constructing complex queries with logical operators and field conditions.

Batch Operations

Bulk data operations that process multiple records efficiently with progress tracking.

USDC

Stablecoin used as the payment currency for all OnDB operations.

Data Availability (DA)

Guarantee that published data is available for download and verification. Used when on-chain immutability is enabled.

LogicalOperator

SDK component for combining query conditions using And, Or, and Not operators.

Sharding

Collection partitioning strategy for high-scale datasets. Supports discrete (exact value), time_range (time-based bucketing), and hash_distributed (even spread) shard key types. Configured via syncCollection() or setupSharding().

SQL Interface

Alternative query interface using SQL syntax. Supports SELECT * FROM app::collection WHERE ... format and SQL INSERT statements.

Predefined Queries

Named, parameterized queries that can be executed via public endpoints without authentication. Created with createQuery() and executed with executeQuery().

DatabaseManager

SDK component for managing collections, indexes, relations, and materialized views within an application. Access via client.database(appId).

API Collection

Collection backed by an external API rather than on-chain storage. Supports hybrid collection types that combine local and API data sources.

Materialized View

Pre-computed query result that updates automatically when source data changes. Created via db.createView(name, sourceCollections, query). Use for complex aggregations, JOINs, and dashboard analytics.

Append-Only Storage

Storage model where updates and deletes don’t modify existing data. Instead, new records are appended with updated timestamps. Original data remains immutable.

Soft Delete

Deletion method that appends a record with deleted: true rather than physically removing data. Original data is preserved for audit purposes.