Architecture
Kurabase combines a relational execution layer with canonical EVM state.
REST request
-> relational execution
-> read: current projection snapshot
-> write: deterministic WritePlan
-> verified identity + RLS checks
-> gateway-attested account transaction
-> Privy / ZeroDev user operation
-> canonical chain state
Reads
The gateway may maintain a relational projection for joins, CTEs, views, aggregates, and window functions. The projection is rebuildable. A normal read must not intentionally return an older projection when the current chain head is known.
Writes
For a production application write, the gateway constructs a deterministic
WritePlan, validates the caller's identity and applicable relational policy,
and signs a five-minute GatewayPlan attestation. The attestation binds the
gateway delegation epoch, the exact account, identity context, current
revision, every encoded operation, a nonce, and expiry.
It also binds the digest of the exact authenticated session. This makes an
individual session revocation invalidate a pending plan before execution.
The gateway returns calldata for executeGatewayPlan; it does not submit
that calldata. Privy sends it from the user's connected external wallet or
embedded wallet, normally through a ZeroDev smart account. The contract
requires msg.sender to equal the account named in the attestation, so the
gateway EOA cannot replay its own signature as a user write. A user-approved,
scoped ZeroDev session key may send the same call only through that account.
KURA_AA_ENABLED defaults to true for a gateway deployment. A new local
kura start instance begins with direct commits so SQL-first development works
without an account provider. Configure a public Privy App ID in Dashboard
Authentication to switch that local instance to account-owned plans
immediately. The local operator stores only public provider IDs; Privy
verification secrets, sponsor credentials and session keys remain outside the
gateway/Dashboard boundary. See Privy and account abstraction
for the execution and credential boundary.
SQL semantics
ISO SQL:2023 is a semantic reference, with necessary PostgreSQL and Supabase-style extensions. It is not a claim of complete standards conformance.
Representative expected coverage includes relational queries, mutations, constraints, RLS, returning and upsert, selected views, and SQL-language RPC. Unsupported behavior returns an explicit error. There is no PostgreSQL wire protocol.