Skip to content
Layer-1 developer tooling and infrastructure

SmartDB: query Cardano eUTXO state like a database

Cardano's extended UTXO (eUTXO) model gives the chain its determinism and parallelism, but it makes application state awkward to read. A dApp's balances, orders, or NFT listings are scattered across many unspent outputs rather than sitting in a queryable account record, so teams end up writing their own indexing and aggregation code before they can build features.

Under a Project Catalyst grant in the Cardano Open Developers category (Fund 11), Protofire built SmartDB, an open-source library that mirrors on-chain eUTXO data into a relational database and exposes it through familiar queries. It maps outputs to records and datums to table columns, distinguishes UTXOs being read from those being consumed to reduce transaction collisions, and serves reads from the mirror to cut repeated calls to indexing services. Protofire also shipped a scaffold and code generator and a reference dApp so teams can start from a working example.

Snapshot
Client
Project Catalyst (Cardano Open Developers, Fund 11)
Sector
Layer-1 developer tooling and infrastructure
Chains
Cardano
Engagement type
Project Catalyst grant (Fund 11, Cardano Open Developers)

Teams wrote repeated calls to indexing services, built manual aggregation logic, and kept custom code in sync with the chain.

01

Why building on Cardano's eUTXO model is hard to query

Cardano uses an extended UTXO ledger. State lives in unspent transaction outputs and their attached datums rather than in mutable account balances, which is what gives the chain deterministic fees and parallel transaction validation. The trade-off falls on application developers.

To show something as basic as a user's balance or a set of open positions, a dApp has to collect and interpret many separate outputs, because there is no single account row to read.

In practice teams solved this each on their own. They wrote repeated calls to indexing services such as Blockfrost, built manual aggregation logic, and kept custom code in sync with the chain. That work sat between them and the product, and concurrent spends of the same output could collide, so two users acting at once could produce failed transactions. The pattern repeated across DeFi and NFT projects in the Cardano ecosystem, which is the gap the Catalyst grant set out to close.

02

How Protofire built the SmartDB abstraction layer

Protofire built SmartDB as a middleware library that keeps a relational mirror of on-chain state. It maps outputs to records and datums to table columns, so a developer can read and filter application state with ordinary database queries instead of reconstructing it from raw outputs each time.

The library supports both MongoDB and PostgreSQL backends and stays in sync with the chain through indexing services after each confirmed transaction.

Two design choices address the specific eUTXO pain points. Its UTXO management distinguishes outputs being read from those being consumed and applies a selection algorithm that minimizes conflicts when several users transact at once. A caching layer serves repeated reads from the mirror rather than re-querying the chain, cutting redundant indexing calls.

Around the core library, Protofire published a scaffold and code generator that produce the schema and boilerplate for a new project, plus a reference marketplace dApp that exercises the library end to end with token and NFT flows.

03

What Protofire delivered

The work is open source under the Protofire GitHub organization. The core library is Cardano-SmartDB, with the Cardano-SmartDB-Scaffold code generator and the Cardano-Simple-Marketplace reference marketplace dApp built on top of it.

The grant itself is public on Project Catalyst. Together they give a Cardano team a working pattern for querying application state without writing indexing and aggregation from scratch.

Technology stack

Cardano eUTXOSmartDB (TypeScript)MongoDB / PostgreSQLGraphQLBlockfrost

FAQ

What is UTXO abstraction on Cardano?
It is a data layer that mirrors on-chain eUTXO state into a relational database so a dApp can read balances, orders, or listings with ordinary queries, instead of collecting and interpreting many separate unspent outputs. Protofire's implementation is the open-source SmartDB library.
Did Protofire build this for the Cardano core protocol?
No. This was an application-layer library funded by a Project Catalyst grant in the Cardano Open Developers category. Protofire built SmartDB and the surrounding tooling for developers on Cardano; it does not change the Cardano ledger or its eUTXO model.
Is the code open source?
Yes. The SmartDB library, its scaffold and code generator, and a reference dApp are published under the Protofire GitHub organization, and the grant is listed on Project Catalyst.

Book a call with Alejandro Losa

Schedule a call with our Web3 Solution Architect to receive practical recommendations and a prompt proposal for upgrading your solution.

Protofire 2026. All rights reserved

Message us on Telegram