Note: This is a prototype and is not production ready. It is for testing purposes only and should not be used with real funds. There will be bugs.
SyndDB enables developers to build high-performance blockchain applications using any programming language with SQLite bindings. Applications import a lightweight client library that automatically captures SQL operations and sends them to a sequencer service for publishing to data availability layers.
SyndDB consists of three main components:
- Your Application - Uses SQLite as normal (any language, any framework), runs inside a TEE
- SyndDB Client Library - Embedded in your application, captures changesets and sends them to the sequencer
- SyndDB Sequencer Service - Receives changesets from clients and publishes to data availability layers
- SyndDB Validator - Verifies SQL operations and signs for settlement
All components run inside TEEs (Google Cloud Confidential Space) with hardware-backed attestation.
- SPEC.md - Complete technical specification covering architecture, terminology, and design decisions
- PLAN_SEQUENCER.md - Sequencer implementation details
- PLAN_VALIDATOR.md - Validator implementation details
- PLAN_BRIDGE.md - Bridge contract and message passing
SyndDB/
├── crates/
│ ├── synddb-client/ # Client library (Rust + FFI for Python/Node.js)
│ ├── synddb-sequencer/ # Sequencer service
│ ├── synddb-validator/ # Validator service
│ ├── synddb-storage/ # Storage layer abstractions (GCS, local)
│ ├── synddb-chain-monitor/ # Blockchain event monitoring
│ ├── synddb-shared/ # Shared types and utilities
│ ├── synddb-relayer/ # Message relayer service
│ ├── synddb-bootstrap/ # TEE bootstrap and attestation
│ ├── synddb-benchmark/ # Orderbook simulator for testing
│ ├── synddb-fuzzer/ # Fuzzing infrastructure
│ └── gcp-attestation/ # GCP Confidential Space attestation
├── contracts/ # Solidity contracts (Bridge, attestation verification)
├── examples/
│ ├── price-oracle/ # Python price oracle example
│ └── prediction-market/ # Rust prediction market example
├── deploy/terraform/ # GCP infrastructure as code
├── docker/ # Dockerfiles for services
└── tests/ # E2E and integration tests
# Rust (via rustup)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup toolchain install nightly # Required for formatting
# Command runner
brew install just
# Solidity development
curl -L https://foundry.paradigm.xyz | bash
foundryupAdditional CI tools (for running full checks locally)
brew install taplo
cargo install cargo-machete cargo-nextestPrimary workflow: Most development relies on CI and auto-deploys to staging. Push to a branch and CI will:
- Run all tests and lints
- Build reproducible Docker images
- Deploy to staging (GCP Confidential Space)
This is the preferred approach since it tests the actual TEE environment and ZK proofs.
Local development is supported for individual components:
# Clone & build
git clone https://github.com/SyndicateProtocol/synddb
cd synddb
cargo build --workspace --release
# Run all CI checks locally
just check
# Run tests
just test
# See all commands
justFor quick local testing without TEE features:
# Start sequencer + validator + sample app
docker compose up --build
# Test endpoints
curl http://localhost:8433/health # Sequencer
curl http://localhost:8080/health # ValidatorCheck workflow status after pushing:
gh run list --limit 5 # Recent runs
gh run watch <run-id> # Watch in progress
gh pr checks # PR status- Language Agnostic: Works with any language that has SQLite bindings (Python, JavaScript, Go, Rust, etc.)
- High Performance: Sub-millisecond writes, 50,000-100,000+ ops/sec throughput
- TEE Security: Hardware-backed attestation via GCP Confidential Space
- Deterministic Replication: SQLite Session Extension changesets for validators
- CBOR/COSE Wire Format: Efficient binary encoding with cryptographic signatures
Embedded in applications to capture SQL changes:
- Captures changesets via SQLite Session Extension
- Batches and sends to sequencer via HTTP
- Creates periodic snapshots and schema-triggered snapshots
- Includes TEE attestation tokens
Receives changesets from clients and publishes to storage:
- HTTP API for receiving changesets/snapshots
- Batches and signs with TEE-protected keys
- Publishes to GCS (with Celestia, EigenDA planned)
- CBOR/COSE message format
Verifies SQL operations before settlement:
- Syncs from sequencer or storage layers
- Replays changesets to rebuild state
- Verifies signatures and invariants
- Signs valid states for settlement
Solidity contracts for on-chain settlement:
- Bridge.sol - Cross-chain message passing and withdrawals
- Attestation verification - TEE attestation via RISC Zero ZK proofs
A price oracle that fetches prices from external APIs and publishes them on-chain.
A prediction market demonstrating full SyndDB integration.
Infrastructure is managed via Terraform:
# See deploy/terraform/environments/ for staging/prod configs
cd deploy/terraform/environments/staging
terraform init
terraform planFor TEE attestation, binaries must be reproducible:
cargo build --profile reproducibleApplication (TEE #1) Sequencer (TEE #2) Validators (TEE)
│ │ │
│ SQLite + Client Library │ │
├────────────────────────────▶ Batch & Sign │
│ HTTP + Attestation │ │ │
│ │ ▼ │
│ │ Storage (GCS/DA) │
│ │ │ │
│ │ └───────────────────▶ Verify & Sign
│ │ │
│ │ ▼
│ │ Bridge.sol
TEE Isolation: Application and sequencer run in separate TEEs. This prevents the application from accessing signing keys.
- Rust 1.90.0+ with nightly toolchain
- just command runner
- Docker (for local testing)
- Foundry (for contract development)
- Terraform (for infrastructure deployment)
MIT License - see LICENSE file for details