WeaveDB Documentation

website·Indexed 33 days ago

https://docs.weavedb.dev

A decentralized, modular database protocol designed as a Layer-0 data hub for blockchains. It features a decentralized Log-Structured-Merge engine, optimistic ZK rollup mechanisms, and support for NoSQL and Relational models using JSON. The ecosystem includes FPJSON for functional programming, ARJSON for optimized encoding, zkJSON for zero-knowledge provable data, and various node types including Rollup, Validator, and ZK Prover nodes.

Tokens
38.7K
Snippets
190
Records
246
Agent score
63%

What's inside WeaveDB

  1. Overview of Protocol-Owned AI Agent (PoAIA)

    The Protocol-Owned AI Agent (PoAIA) is a rule-based autonomous controller that replaces static over-provisioned liquidity with reactive, minimal buybacks. It observes real-time flow and executes the minimum base purchase needed to restore price floors, provided the action is within available budget constraints. This approach reduces USDC requirements by approximately 70% compared to static liquidity provisioning while ensuring treasury floors (T ≥ T_min) and protocol invariants are never violated.
  2. Overview of WeaveDB Decentralized Database Protocol

    WeaveDB is a decentralized, general-purpose modular database protocol designed as a Layer-0 data hub. It provides a universal off-chain data layer that allows various blockchains (EVM, Solana, Bitcoin, etc.) to access data with cryptographic proofs. It is built on Arweave for permanent storage and the AO Core Protocol for verifiable compute. Key features include full mathematical provability via the Lean theorem prover, succinct ZK verifiability, and support for multiple paradigms including NoSQL, Relational, and Vector databases using JSON as a universal format.
  3. Overview of the WDB20 Fungible Token Standard

    WDB20 is a database-native fungible token standard designed to provide ERC20-like functionality directly within WeaveDB and other database systems. Unlike traditional blockchain tokens, WDB20 tokens are implemented as structured data within the database, allowing them to integrate seamlessly with standard database operations while maintaining a fungible token interface. Note that the WDB20 specification is currently under active development.
  4. Overview of FPJSON in WeaveDB

    FPJSON (Functional Programmable JSON) is a domain-specific language (DSL) used by WeaveDB to enable decentralized database functionality. It allows for advanced, composable functional programming within a JSON format, enabling the definition of data ownership, programmable data manipulations, and access control rules. FPJSON powers several core WeaveDB features:

    • Crypto Account Authentication for data access and ownership.
    • Data Schemas to constrain stored data formats.
    • Access Control Rules for managing write permissions.
    • Crons for periodic query execution (Note: Not yet implemented on HyperBEAM).
    • Triggers for chaining queries with pre-defined logic.
    • Verifiable Relayers for importing external data (Note: Not yet implemented on HyperBEAM).
  5. Overview of zkJSON (Zero Knowledge Provable JSON)

    zkJSON is a deterministic encoding format that makes arbitrary JSON data provable using zero-knowledge proofs (ZKP). This allows off-chain JSON data to be verified both off-chain and on-chain (e.g., within Solidity smart contracts on EVM blockchains). It serves as the foundation for a hyper-scalable NoSQL database extension for blockchains, enabling direct queries from smart contracts to off-chain databases.
  6. Overview of FPJSON

    FPJSON is a programming language agnostic, JSON-based functional programming language designed for building pure data manipulation logic. Because the code is represented as a JSON array, it eliminates programming language implementation overhead and can be ported to any environment.
  7. Overview of zkJSON (Zero Knowledge Provable JSON)

    zkJSON is a specialized encoding format that makes arbitrary JSON data provable using zero-knowledge proofs. It converts JSON into a sequence of integers that can be processed by zk circuits (like Circom) and Solidity smart contracts, which cannot natively handle stringified JSON. The encoding is designed to be extremely efficient, allowing large JSON structures to be compressed into a small number of uint256 values in Solidity. When querying a specific path in the JSON, only the bits for that path and its value are passed to Solidity as public signals, keeping the rest of the JSON private.
  8. Overview of WeaveDB Database Launch Architecture

    The WeaveDB launch mechanism allows developers to create new databases with their own token economies. The system uses $DB tokens as collateral to fund database operations and reward users. Users lock $DB to earn veDB (voting-escrowed DB), which generates daily emissions of the database's native token (dbX). This creates a dual-flow economy: databases receive $DB for infrastructure costs, and users receive dbX tokens as rewards.
  9. Overview of ARJSON encoding

    ARJSON is a high-performance JSON encoding and compression algorithm designed for speed and efficiency. It outperforms traditional byte-level serialization formats like MessagePack and CBOR by utilizing bit-level optimizations and columnar restructuring. It is particularly effective for structured data with repetitive patterns, achieving up to 95% better compression rates than MessagePack in some cases. Key features include:

    • Bit-level optimization: Uses variable-length data units to eliminate wasted bits common in byte-aligned formats.
    • Columnar reorganization: Dynamically reorganizes JSON data into a columnar structure during scanning to increase redundancy and compression efficiency.
    • Delta packing: Encodes differences between consecutive values to reduce storage for sequential or repetitive data.
    • Deterministic encoding: Applies optimizations in a single scan without requiring complex heuristics or extensive metadata.
    • Incremental updates: Supports minimum, append-only bit-level updates to immutable data, making it suitable for permanent databases.
  10. Understand the WDB64 deterministic timestamp system

    WDB64 is a deterministic timestamp system used by WeaveDB to generate unique 64-bit timestamps for transactions. It solves the problem of duplicate timestamps and ambiguous sorting that occurs when multiple transactions happen within the same millisecond, especially in high-throughput scenarios. By combining millisecond precision with a transaction counter, it ensures every document has a distinct timestamp and a deterministic order.
    64 bits = Milliseconds × 1000 + Transaction Counter
  11. Understand WeaveDB's Decentralized LSM Engine Architecture

    WeaveDB emulates a Log-Structured-Merge (LSM) engine to achieve cloud-grade performance (10ms-200ms query responses) while maintaining decentralization. It maps traditional LSM components to decentralized infrastructure:

    • MemTable: Handled by Rollup nodes for instant responses.
    • Write-Ahead Log (WAL): Handled by HyperBEAM using cryptographic hashpaths.
    • SSTables: Handled by Arweave for permanent, immutable storage.
    • Compaction: Achieved via ARJSON bit-level optimization.
  12. Implement Access Control Rules with FPJSON

    WeaveDB uses an extended version of FPJSON for access control. Rules are defined as a list of operations and their corresponding logic. The logic is evaluated using a point-free functional style, augmented with side-effect variables and imperative features like if-else statements.