ATSHI Store · On-Chain Database No external indexer · No off-chain infra
On-Chain Database Layer

Structured
Data
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.

table · traceability.batches Fig. · structured
idsupplierweightstatus
batch_001 0x18c4…3F2a enc verified
batch_002 0x208c…14e7 enc received
batch_003 0xa11b…d6ff enc verified
Public Encrypted Auto-Purge GDPR
The Problem

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.

The Solution

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.

01

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.

02

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.

03

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.

Developer Experience

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
Capabilities

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.

01Core

Typed Schemas

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

02Core

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.

03Core

Foreign Keys

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

04Core

Triggers

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

05Core

GraphQL Queries

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

06Core

Interceptors

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

07Core

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.

08Core

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.

09Core

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.

10Phase 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.

11Phase 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.

12Phase 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.

13Phase 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.

14Phase 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.

15Phase 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.

How It Compares

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 (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
Use Cases

Built for Real Applications.

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

01

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.

schemasFKversioningauditRBAC
02

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 atomicpartial indextriggerssubscriptions
03

Enterprise ERP

Inventory, HR, procurement

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

RBACcomputedwebhookswallets
04

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_onlyTTLencryptionsoft delete
05

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-textpartitioningsubscriptionspublic
06

Institutional Registries

Land, identity, certifications

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

versioningcross-DB FKcomposite PKaudit
0
External dependencies
< 10ms
Query latency (indexed)
12
Access control modes
100%
On-chain audit trail
Build product, not infrastructure

Stop Building Infrastructure. Start Building Product.

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