On-Chain Database Layer

Your database. On-chain.

ATSHI Store brings databases, tables, schemas, and queries natively into the blockchain. No external indexer. No off-chain infrastructure. Just declare your data model — the protocol does the rest.

● Public Fields ● Encrypted Fields ● Auto-Purge GDPR

Blockchains Were Never Designed to Manage Data

Every dApp team hits the same wall: the chain stores transactions, not structured data. So you bolt on Postgres, run The Graph, deploy indexers — and suddenly you're maintaining more infrastructure than you're building product.

📦

No Collections

Smart contract state is a single JSON blob. No tables, no schemas, no pagination. You serialize everything yourself and pray it fits.

🔍

No Queries

Want to find all orders above $100 sorted by date? Good luck. You'll need to scan the entire state or build an off-chain indexer from scratch.

🏗

External Infrastructure

The Graph, Alchemy, Infura, Postgres replicas… Every project re-invents the same stack. More points of failure. More trust assumptions. More cost.

🔓

No Access Control

Row-level security? Role-based permissions? On blockchain? You're writing that from scratch in Solidity, for every contract, every time.

ATSHI Store Makes the Blockchain Your Database

Declare your schema. Set your access rules. Let the protocol handle validation, indexing, and querying. Every mutation is a transaction. Every query hits a local index. Zero external dependencies.

🛡

Protocol-Enforced

Schema validation, access control, and foreign keys are checked by the node before consensus — not in your contract code. Reject bad data before it costs gas.

Native Performance

Nodes maintain local indexes (B-tree, full-text) derived deterministically from the chain. Sub-10ms queries on million-document tables. No external indexer.

🔗

Fully On-Chain

Every document is a transaction. Every mutation goes through consensus. The blockchain is the source of truth. Indexes are just caches — any node can rebuild them.

Feels Like Supabase. Runs On-Chain.

Declare. Don't build.

Define your database, tables, schemas, and access control declaratively in your smart contract. The protocol generates the table chains, builds the indexes, and enforces every rule at the node level.

Need custom logic? Add an interceptor to enrich documents before they're written. Need aggregations? Add a trigger — same mechanism as oracle triggers, already battle-tested on ATSHI Network.

  • Typed schemas with constraints (required, unique, min/max, enums)
  • Declarative access control: public, owner_only, allowlist, field-based
  • Foreign keys with cascade/restrict/set_null
  • Triggers for real-time aggregations in contract state
  • GraphQL API for off-chain reads — zero config
traceability_contract.exs
database("traceability",
  access: %{read: :public, write: :allowlist}
)

table("traceability", "batches",
  schema: %{
    id:       {:string,    %{required: true, unique: true}},
    supplier: {:address,   %{required: true}},
    weight:   {:float,     %{required: true, min: 0.0}},
    status:   {{:enum, ["received", "verified"]},
              %{required: true}}
  },
  indexes: [:supplier, :status],
  access:  %{
    insert: :allowlist,
    update: {:field, :supplier},
    delete: :none
  },
  audit:       true,
  versioning:  :full
)

# Automatic aggregation — same as oracle triggers
trigger(data: "batches", on: :insert) do
  doc = Data.document()
  State.stats.total += 1
  State.stats.by_supplier[doc.supplier] += 1
end

Everything You Need. Nothing You Don't.

From schema validation to full-text search, ATSHI Store covers the complete data management lifecycle — enforced by the protocol, maintained by every node.

Core
📐

Typed Schemas

String, integer, float, address, timestamp, enum, map, list — with constraints: required, unique, min/max, pattern. Validated by the protocol before consensus.

Core
🔐

Declarative Access Control

Per-operation granularity: read, insert, update, delete. Five modes: public, owner_only, allowlist, field-based, none. Enforced before WASM execution — zero gas on rejection.

Core
🔗

Foreign Keys

Referential integrity between tables, enforced at the protocol level. On-delete behaviors: restrict, cascade, set_null. No orphan data, ever.

Core

Triggers

Same mechanism as oracle triggers. Intercept writes before consensus (on). React after consensus (trigger). Build reactive pipelines across contracts.

Core
📊

GraphQL Queries

find(), count(), orderBy, limit, offset — all exposed via the node's GraphQL API. Powered by local indexes. No external infrastructure.

Core
🧩

Interceptors

Enrich documents on the fly — auto-set timestamps, compute hashes, validate business rules. Accept or reject before the data hits the chain.

Core
🔒

Per-Field Encryption

AES-256-GCM encryption at the field level — not all-or-nothing. Share compliance fields publicly while keeping proprietary data encrypted in the same record. True mixed visibility.

Core
📜

GDPR Auto-Purge

Hash preserved for proof of existence, payload destroyed after retention period. Retention policies enforced at the protocol level — compliance by default, not by afterthought.

Core
🔄

Safe Migrations

Dry-run validation before deploy, automatic snapshots, instant rollback, and auto-generated TypeScript/Java/Python types from on-chain schemas. Zero-risk schema evolution.

Phase 2
👥

Role-Based Access (RBAC)

16 built-in roles evaluated at consensus level — unauthorized calls pay zero gas. Five policy effects (allow, deny, audit, require MFA, require approval) with deny-overrides-allow conflict resolution, same model as AWS IAM. Contextual conditions on time, geography, and on-chain state.

Phase 2
📜

Version History & Audit

Full document versioning with diff tracking. Structured audit log queryable by author, date, operation. The chain remembers everything — now you can query it.

Phase 2

TTL, Soft Delete & Archival

Auto-expire documents. Mark as deleted without losing history. Archive old data to cold tables. Manage the full document lifecycle declaratively.

Phase 2
🔄

Atomic Multi-Table Batches

Update orders, insert trades, modify balances — all in one atomic transaction. If any operation fails, everything rolls back. Built for DeFi and ERP.

Phase 2
🔍

Full-Text Search

Inverted indexes on string fields. Relevance scoring. Highlighted snippets. Search your on-chain data like you'd search a document database.

Phase 2
📡

Real-Time & Webhooks

GraphQL subscriptions for live data feeds. Webhooks for off-chain integration. Server-Sent Events for lightweight streaming. Your chain talks to the world.

ATSHI Store vs. the Alternatives

Not a bolt-on. Not an indexer. A protocol-native data layer that combines the best of Supabase with the trust guarantees of blockchain.

Capability Supabase The Graph Solidity/EVM ATSHI Store
Typed schemas SQL DDL GraphQL schema Struct (limited) Declarative + constraints
Access control RLS policies None Manual (require) Declarative, per-operation
Queries Full SQL GraphQL (indexed) Key-value only GraphQL + on-chain find()
Foreign keys ✓ Native ✗ Manual ✗ Manual ✓ Protocol-enforced
Triggers / Hooks PL/pgSQL Mapping handlers Events (off-chain) on() + trigger() (on-chain)
Real-time ✓ Native ✗ Polling ✗ Log parsing ✓ Subscriptions + Webhooks
Per-field encryption ✗ Column-level (pgcrypto) ✗ None ✗ None ✓ AES-256-GCM native
GDPR purge Application-level Impossible Impossible ✓ Protocol-level auto-purge
Auth JWT (GoTrue) None msg.sender Transaction signatures
Trust model Trust operator Trust indexers Trust protocol Trust protocol
External infra Managed server Subgraph nodes None None — built into nodes
Immutable audit trail ✗ Mutable DB ✓ On-chain source ✓ On-chain ✓ On-chain + structured audit API

Built for Real Applications

ATSHI Store isn't a toy. It's designed for production workloads — from supply chain traceability to decentralized finance.

🐄

Supply Chain & Traceability

Agri-food, pharma, luxury

Track every batch, every analysis, every handover — with foreign keys, versioning, and audit trails. Compliance-ready by design.

schemas FK versioning audit RBAC
💱

DeFi & DEX

Order books, AMM, lending

Atomic multi-table transactions for trade execution. Partial indexes on active orders. Real-time subscriptions for price feeds.

batch atomic partial index triggers subscriptions
🏢

Enterprise ERP

Inventory, HR, procurement

Role-based access for departments. Computed fields for derived data. Webhooks to sync with existing systems. Hierarchical wallet integration.

RBAC computed webhooks wallets
📋

Consent & Data Governance

GDPR, health data, privacy

One contract per data subject. Owner-only write access. TTL for automatic consent expiration. Field-level encryption for sensitive data.

owner_only TTL encryption soft delete
🌐

Decentralized Social

Forums, feeds, content

Public insert, author-only update, no delete. Full-text search on content. Table partitioning for scalable history. Real-time feeds via subscriptions.

full-text partitioning subscriptions public
🏛

Institutional Registries

Land, identity, certifications

Immutable records with full version history. Cross-contract references between registries. Composite keys for natural identifiers.

versioning cross-DB FK composite PK audit
0 External dependencies
<10ms Query latency (indexed)
12 Access control modes
100% On-chain audit trail

Stop Building Infrastructure. Start Building Product.

ATSHI Store is part of the ATSHI Network protocol. Every node is your database.