Back to Blog

Introducing OnchainDB: The Database That Lives On-Chain

We're excited to announce OnchainDB, a revolutionary blockchain-backed database built on Celestia's Data Availability layer.

Introducing OnchainDB: The Database That Lives On-Chain

We’re thrilled to introduce OnchainDB, a pay-for-access on-chain database that enables developers to monetize their data. By combining the familiarity of traditional databases with blockchain technology, OnchainDB lets you build applications where every data access generates revenue.

If Ethereum is a World VM, OnchainDB is a Collective Intelligence Database.

Why OnchainDB?

Traditional databases have served us well, but they come with inherent limitations: centralized control, opaque data handling, and no built-in way to monetize your data. OnchainDB addresses these challenges by storing your data directly on Celestia’s Data Availability layer with native payment integration.

Built for Vibe Coders

OnchainDB’s unique architecture enables developers to build truly serverless applications. No backend servers to manage, no database infrastructure to maintain, no DevOps headaches. Just write your frontend code, connect to OnchainDB, and ship. Your data lives on-chain, payments are handled automatically, and revenue flows directly to your wallet. Perfect for solo developers, weekend projects, and anyone who wants to focus on building rather than infrastructure.

Key Features

  • Pay-for-Access Model: Monetize your data with every read and write operation
  • Automatic Revenue Sharing: 70% goes to your app, 30% to the platform
  • Blockchain-Native Storage: All data is stored on-chain with cryptographic verification
  • Materialized Views: Pre-computed query results for lightning-fast reads
  • Cross-App Joins: Query and join data across multiple collections and apps from the OnchainDB marketplace
  • Prisma-Like SDK: Familiar API for developers coming from traditional databases
  • HTTP 402 Payment Protocol: Industry-standard payment integration
  • No Infrastructure Required: No need to run your own blockchain nodes

Cross-App Data Joins

What makes OnchainDB unique is its ability to join data across different applications. Imagine querying user profiles from one app, transaction history from another, and inventory data from a third - all in a single query. The OnchainDB marketplace creates a global data layer where apps can share and monetize their data while maintaining ownership. This cross-app interoperability turns siloed databases into a unified Collective Intelligence Database where everyone benefits.

How It Works

Here’s how OnchainDB processes your data:

sequenceDiagram participant User participant App participant OnchainDB participant Celestia rect rgb(230, 245, 230) Note over User,Celestia: Write Operation User->>App: Write data request App->>OnchainDB: API call with data OnchainDB-->>App: HTTP 402 Payment Required App->>OnchainDB: Payment (TIA tokens) OnchainDB->>OnchainDB: Verify & split revenue (70/30) OnchainDB->>Celestia: Submit data blob Celestia-->>OnchainDB: Block height confirmed OnchainDB->>OnchainDB: Update materialized views OnchainDB-->>App: Success + block reference App-->>User: Data stored on-chain end rect rgb(230, 240, 255) Note over User,Celestia: Read Operation User->>App: Read data request App->>OnchainDB: Query (can join across apps) OnchainDB-->>App: HTTP 402 Payment Required App->>OnchainDB: Payment (TIA tokens) OnchainDB->>OnchainDB: Query materialized views OnchainDB-->>App: Data from index App-->>User: Display results end

The architecture ensures every operation is:

  1. Paid - HTTP 402 protocol handles micropayments with TIA tokens for both reads and writes
  2. Verified - Payment proofs are validated before processing
  3. Permanent - Write data is stored on Celestia’s DA layer with block confirmation
  4. Fast - Read queries hit materialized views and indexes, not raw blockchain data
  5. Monetized - Revenue automatically splits between your app and the platform

Getting Started

Getting started with OnchainDB is as simple as installing our SDK:

npm install @onchaindb/sdk

Then initialize your client:

import { createClient } from '@onchaindb/sdk';

const db = createClient({
  endpoint: 'https://api.onchaindb.io',
  appId: 'your-app-id',
  apiKey: 'your-api-key'
});

// Store data
await db.store({
  collection: 'messages',
  data: [{ message: 'Hello OnchainDB!', author: 'alice' }]
});

// Query data
const result = await db.queryBuilder()
  .collection('messages')
  .whereField('author').equals('alice')
  .selectAll()
  .limit(10)
  .execute();

See It In Action

We’ve built several demo applications to showcase what you can build with OnchainDB:

  • Todo App - A task management application demonstrating CRUD operations with on-chain data persistence
  • Store - An e-commerce platform with product listings, inventory management, and blockchain-verified transactions
  • Social Feed - A decentralized social platform with posts, follows, and engagement tracking

Each demo app earns revenue from data access through the HTTP 402 payment protocol. When users interact with the data, payments are automatically processed and split between the app developer (70%) and the platform (30%).

What’s Next?

We’re just getting started. In the coming weeks, we’ll be releasing:

  • Comprehensive documentation and tutorials
  • Additional demo applications
  • Enhanced query capabilities
  • Community tools and integrations

Stay tuned for more updates, and join us in building the future of monetized, decentralized data!


Follow us on Twitter and GitHub for the latest updates.