[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10605":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":15,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":9,"pushedAt":9,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":15,"starSnapshotCount":15,"syncStatus":37,"lastSyncTime":38,"discoverSource":39},10605,"CovenantSQL","CovenantSQL\u002FCovenantSQL","A decentralized, trusted, high performance, SQL database with blockchain features","https:\u002F\u002Fdevelopers.covenantsql.io",null,"Go",1529,145,71,27,0,54.49,"Apache License 2.0",false,"develop",true,[22,23,24,25,26,27,28,29,30,31,32,33],"bft","blockchain","covenantsql","cql","crypto","database","dbaas","decentralized","p2p","qldb","sql","sql-database","2026-06-12 04:00:51","\u003Cp align=\"center\">\n    \u003Cimg src=\"logo\u002Fcovenantsql_horizontal.png\"\n        width=\"760\">\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fgoreportcard.com\u002Freport\u002Fgithub.com\u002FCovenantSQL\u002FCovenantSQL\">\n        \u003Cimg src=\"https:\u002F\u002Fgoreportcard.com\u002Fbadge\u002Fgithub.com\u002FCovenantSQL\u002FCovenantSQL?style=flat-square\"\n            alt=\"Go Report Card\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fcodecov.io\u002Fgh\u002FCovenantSQL\u002FCovenantSQL\">\n        \u003Cimg src=\"https:\u002F\u002Fcodecov.io\u002Fgh\u002FCovenantSQL\u002FCovenantSQL\u002Fbranch\u002Fdevelop\u002Fgraph\u002Fbadge.svg\"\n            alt=\"Coverage\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Ftravis-ci.org\u002FCovenantSQL\u002FCovenantSQL\">\n        \u003Cimg src=\"https:\u002F\u002Ftravis-ci.org\u002FCovenantSQL\u002FCovenantSQL.png?branch=develop\"\n            alt=\"Build Status\"\u002F>\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fopensource.org\u002Flicenses\u002FApache-2.0\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202.0-blue.svg\"\n            alt=\"License\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgodoc.org\u002Fgithub.com\u002FCovenantSQL\u002FCovenantSQL\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fgodoc-reference-blue.svg\"\n            alt=\"GoDoc\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fformulae.brew.sh\u002Fformula\u002Fcql\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fhomebrew\u002Fv\u002Fcql.svg?color=blue&label=brew%20install%20cql\"\n            alt=\"homebrew\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n[中文简介](https:\u002F\u002Fgithub.com\u002FCovenantSQL\u002FCovenantSQL\u002Fblob\u002Fdevelop\u002FREADME-zh.md)\n\nCovenantSQL(CQL) is a **Byzantine Fault Tolerant** relational database built on SQLite:\n\n- **ServerLess**: Free, High Availabile, Auto Sync Database Service for Serverless App\n- **SQL**: Most SQL-92 support.\n- **Decentralize**: Running on Open Internet without Central Coordination.\n- **Privacy**: Access with Granted Permission and Encryption Pass.\n- **Immutable**: Query History in CQL is Immutable and Trackable.\n- **Permission**: Column Level ACL and SQL Pattern Whitelist.\n\n## What is CQL?\n\n- Open source alternative of Amazon QLDB\n- Low cost DBaaS\n- Just like filecoin + IPFS is the decentralized file system, CQL is the decentralized database\n\n## Quick Start\n\nCQL client supports:\n\n- macOS X 10.9+\n- Linux 2.6.23+ (x86, x86_64, armeabi-v7a, arm64-v8a)\n\n\u003Cdetails>\u003Csummary>Developer Guide\u003C\u002Fsummary>\n\u003Cp>\n\n#### MacOS\n- 🍺 Homebrew users can just run:\n\n    ```bash\n    brew install cql\n    ```\n\n- non-Homebrew users can run:\n    \n    ```bash\n    sudo bash -c 'curl -L \"https:\u002F\u002Fmac.gridb.io\u002Fcql\" | tar xzv -C \u002Fusr\u002Flocal\u002Fbin\u002F --strip-components=1'\n    ```\n\n#### Linux\n\n- Just run：\n\n    ```bash\n    sudo bash -c 'curl -L \"https:\u002F\u002Flinux.gridb.io\u002Fcql\" | tar xzv -C \u002Fusr\u002Flocal\u002Fbin\u002F --strip-components=1'\n    ```\n\n#### To continue: [TestNet Quickstart](https:\u002F\u002Fdevelopers.covenantsql.io\u002Fdocs\u002Fen\u002Fquickstart)\n\n#### SDKs\n\nCovenantSQL Testnet is already released, [have a try](https:\u002F\u002Fdevelopers.covenantsql.io\u002Fdocs\u002Fquickstart).\n\n- [Golang](client\u002F)\n- [Java](https:\u002F\u002Fgithub.com\u002FCovenantSQL\u002Fcql-java-driver)\n- [NodeJS](https:\u002F\u002Fgithub.com\u002FCovenantSQL\u002Fcovenantsql-proxy-js)\n- [Python](https:\u002F\u002Fgithub.com\u002FCovenantSQL\u002Fcql-python-driver)\n- [Microsoft Excel (by community)](https:\u002F\u002Fgithub.com\u002Fmelancholiaforever\u002FCQL_Excel)\n\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n\n## How CQL works\n\n### 3 Layers Arch\n\n![CovenantSQL 3 Layer design](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FCovenantSQL\u002Fdocs@b7143254adb804dff0e3bc1f2f6ab11ad9cd44f5\u002Fwebsite\u002Fstatic\u002Fimg\u002F2layers.svg)\n\n- Layer 1: **Global Consensus Layer** (the main chain, the middle ring in the architecture diagram):\n    - There will only be one main chain throughout the network.\n    - Mainly responsible for database Miner and the user’s contract matching, transaction settlement, anti-cheating, shard chain lock hash and other global consensus matters.\n- Layer 2: **SQL Consensus Layer** (shard chain, rings on both sides):\n    - Each database will have its own separate shard chain.\n    - Mainly responsible for: the signature, delivery and consistency of the various Transactions of the database. The data history of the permanent traceability is mainly implemented here, and the hash lock is performed in the main chain.\n- Layer 3: **Datastore Layer** (database engine with SQL-92 support):\n    - Each Database has its own independent distributed engine.\n    - Mainly responsible for: database storage & encryption, query processing & signature, efficient indexing.\n\n\n\u003Cdetails>\u003Csummary>For more details\u003C\u002Fsummary>\n\u003Cp>\n\n### Consensus Algorithm\n\nCQL supports 2 kinds of consensus algorithm:\n\n1. DPoS (Delegated Proof-of-Stake) is applied in `Eventually consistency mode` database and also `Layer 1 (Global Consensus Layer)` in BlockProducer. CQL miners pack all SQL queries and its signatures by the client into blocks thus form a blockchain. We named the algorithm [`Xenomint`](https:\u002F\u002Fgithub.com\u002FCovenantSQL\u002FCovenantSQL\u002Ftree\u002Fdevelop\u002Fxenomint). \n2. BFT-Raft (Byzantine Fault-Toleranted Raft)\u003Csup>[bft-raft](#bft-raft)\u003C\u002Fsup> is applied in `Strong consistency mode` database. We named our implementation [`Kayak`](https:\u002F\u002Fgithub.com\u002FCovenantSQL\u002FCovenantSQL\u002Ftree\u002Fdevelop\u002Fkayak).  The CQL miner leader does a `Two-Phase Commit` with `Kayak` to support `Transaction`.\u003Csup>[transaction](#transaction)\u003C\u002Fsup>\n\nCQL database consistency mode and node count can be selected in database creation with command  `cql create '{\"UseEventualConsistency\": true, \"Node\": 3}'`\n\n## Comparison\n\n|                              | Ethereum          | Hyperledger Fabric     | Amazon QLDB | CovenantSQL                                                  |\n| ---------------------------- | ----------------- | ---------------------- | ----------- | ------------------------------------------------------------ |\n| **Dev language**             | Solidity, ewasm   | Chaincode (Go, NodeJS) | ?           | Python, Golang, Java, PHP, NodeJS, MatLab                    |\n| **Dev Pattern**              | Smart   Contract  | Chaincode              | SQL         | SQL                                                          |\n| **Open Source**              | Y                 | Y                      | N           | Y                                                            |\n| **Nodes for HA**             | 3                 | 15                     | ?           | 3                                                            |\n| **Column Level ACL**         | N                 | Y                      | ?           | Y                                                            |\n| **Data Format**              | File              | Key-value              | Document    | File\u003Csup>[fuse](#fuse)\u003C\u002Fsup>, Key-value, Structured          |\n| **Storage Encryption**       | N                 | API                    | Y           | Y                                                            |\n| **Data Desensitization**     | N                 | N                      | N           | Y                                                            |\n| **Multi-tenant**             | DIY               | DIY                    | N           | Y                                                            |\n| **Throughput (1s delay)**    | 15~10 tx\u002Fs        | 3500 tx\u002Fs              | ?           | 11065 tx\u002Fs (Eventually Consistency)\u003Cbr\u002F>1866 tx\u002Fs (Strong Consistency) |\n| **Consistency Delay**        | 2~6 min           | \u003C 1 s                  | ?           | \u003C 10 ms                                                      |\n| **Secure for Open Internet** | Y                 | N                      | Only in AWS | Y                                                            |\n| **Consensus**                | PoW + PoS(Casper) | CFT                    | ?           | DPoS (Eventually Consistency)\u003Cbr\u002F>BFT-Raft (Strong Consistency) |\n\n#### FootNotes\n\n- \u003Ca name=\"bft-raft\">BFT-Raft\u003C\u002Fa>: A CQL leader offline needs CQL Block Producer to decide whether to wait for leader online for data integrity or promote a follower node for availability. This part is still under construction and any advice is welcome.  \n\n- \u003Ca name=\"transaction\">Transaction\u003C\u002Fa>: Talking about `ACID`, CQL has full \"Consistency, Isolation, Durability\" and a limited `Atomicity` support. That is even under strong consistency mode, CQL transaction is only supported on the leader node. If you want to do \"read `v`, `v++`, write `v` back\" parallelly and atomically, then the only way is \"read `v` from the leader, `v++`, write `v` back to leader\"\n\n- \u003Ca name=\"fuse\">FUSE\u003C\u002Fa>: CQL has a [simple FUSE](https:\u002F\u002Fgithub.com\u002FCovenantSQL\u002FCovenantSQL\u002Ftree\u002Fdevelop\u002Fcmd\u002Fcql-fuse) support adopted from CockroachDB. The performance is not very ideal and still has some issues. But it can pass fio test like:\n\n  ```bash\n  fio --debug=io --loops=1 --size=8m --filename=..\u002Fmnt\u002Ffiotest.tmp --stonewall --direct=1 --name=Seqread --bs=128k --rw=read --name=Seqwrite --bs=128k --rw=write --name=4krandread --bs=4k --rw=randread --name=4krandwrite --bs=4k --rw=randwrite\n  ```\n\n### Network Stack\n\n[DH-RPC](rpc\u002F) := TLS - Cert + DHT\n\n| Layer              | Implementation |\n|:-------------------|:--------------:|\n| RPC                |     `net\u002Frpc`    |\n| Naming             |      [**C**onsistent **S**ecure **DHT**](https:\u002F\u002Fgodoc.org\u002Fgithub.com\u002FCovenantSQL\u002FCovenantSQL\u002Fconsistent)     |\n| Pooling            |  Session Pool  |\n| Multiplex          |      [smux](https:\u002F\u002Fgithub.com\u002Fxtaci\u002Fsmux)     |\n| Transport Security |      [**E**nhanced **TLS**](https:\u002F\u002Fgithub.com\u002FCovenantSQL\u002Fresearch\u002Fwiki\u002FETLS(Enhanced-Transport-Layer-Security))      |\n| Network            |       TCP or KCP for optional later      |\n\n### Test Tools we use\n  - [**G**lobal **N**etwork **T**opology **E**mulator](https:\u002F\u002Fgithub.com\u002FCovenantSQL\u002FGNTE) is used for network emulating.\n  - [Liner Consistency Test](https:\u002F\u002Fgithub.com\u002Fanishathalye\u002Fporcupine)\n\n## Papers\n\nOur team members published:\n\n- [Thunder crystal: a novel crowdsourcing-based content distribution platform](https:\u002F\u002Fdl.acm.org\u002Fcitation.cfm?id=2736085)\n- [Analyzing streaming performance in crowdsourcing-based video service systems](https:\u002F\u002Fieeexplore.ieee.org\u002Fabstract\u002Fdocument\u002F7114727\u002F)\n- [Performance Analysis of Thunder Crystal: A Crowdsourcing-Based Video Distribution Platform](https:\u002F\u002Fieeexplore.ieee.org\u002Fabstract\u002Fdocument\u002F7762143\u002F)\n\nthat inspired us:\n\n- [Bitcoin: A Peer-to-Peer Electronic Cash System](https:\u002F\u002Fbitcoin.org\u002Fbitcoin.pdf)\n- [S\u002FKademlia](https:\u002F\u002Fgithub.com\u002Fthunderdb\u002Fresearch\u002Fwiki\u002FSecure-Kademlia)\n    - [S\u002FKademlia: A practicable approach towards secure key-based routing](https:\u002F\u002Fieeexplore.ieee.org\u002Fdocument\u002F4447808\u002F)\n- [vSQL: Verifying arbitrary SQL queries over dynamic outsourced databases](https:\u002F\u002Fieeexplore.ieee.org\u002Fabstract\u002Fdocument\u002F7958614\u002F)\n\n\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n## Performance \n\nStrong consistency bench result (2 miners, 8 core aws c5.2xlarge):\n![CovenantSQL bench](logo\u002Fbench.png)\n\nAs seen above, the concurrency pressure on the database increased gradually in the first 5 hours, and the write TPS also increased. When the TPS no longer grows, the concurrent pressure is maintained for 100 hours.\n\n## Demos\n\n- [CovenantForum](https:\u002F\u002Fdemo.covenantsql.io\u002Fforum\u002F)\n- [Weibo Bot @BlockPin](https:\u002F\u002Fweibo.com\u002FBlockPin)\n- [Markdown Editor with CovenantSQL sync](https:\u002F\u002Fgithub.com\u002FCovenantSQL\u002Fstackedit)\n- [Web Admin for CovenantSQL](https:\u002F\u002Fgithub.com\u002FCovenantSQL\u002Fadminer)\n- [How CovenantSQL works(video)](https:\u002F\u002Fyoutu.be\u002F2Mz5POxxaQM?t=106)\n\n## Use cases\n\n\u003Cdetails>\u003Csummary>Traditional App & ĐApp use cases\u003C\u002Fsummary>\n\u003Cp>\n\n### Traditional App\n\n#### Privacy data\n\nIf you are a developper of password management tools just like [1Password](https:\u002F\u002F1password.com\u002F) or [LastPass](https:\u002F\u002Fwww.lastpass.com\u002F). You can use CQL as the database to take benefits:\n\n1. Serverless: no need to deploy a server to store your user's password for sync which is the hot potato.\n2. Security: CQL handles all the encryption work. Decentralized data storage gives more confidence to your users.\n3. Regulation: CQL naturally comply with [GDPR](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FGeneral_Data_Protection_Regulation).\n\n#### IoT storage\n\nCQL miners are deployed globally, IoT node can write to nearest CQL miner directly.\n\n1. Cheaper: Without passing all the traffic through a gateway, you can save a large bandwidth fee. And, CQL is a shared economic database which makes storage cheaper.\n2. Faster: CQL consensus protocol is designed for Internet where network latency is unavoidable.\n\n#### Open data service\n\nFor example, you are the most detailed Bitcoin OHLC data maintainer. You can directly expose an online SQL interface to your customers to meet a wide range of query needs.\n\n1. CQL can limit specific SQL query statements to meet the needs while also balancing data security;\n2. CQL can record SQL query records on the blockchain, which is very convenient for customers to check their bills for long-tail customers and billing, like [this](https:\u002F\u002Fexplorer.dbhub.org\u002Fdbs\u002F7a51191ae06afa22595b3904dc558d41057a279393b22650a95a3fc610e1e2df\u002Frequests\u002Ff466f7bf89d4dd1ece7849ef3cbe5c619c2e6e793c65b31966dbe4c7db0bb072)\n3. For customers with high performance requirements, Slave nodes can be deployed at the customer to meet the needs of customers with low latency queries while enabling almost real-time data updates.\n\n#### Secure storage\n\nThanks to the CQL data history is immutable, CQL can be used as a storage for sensitive operational logs to prevent hacking and erasure access logs.\n\n### ĐApp\n\nStoring data on Bitcoin or Ethereum is quite expensive ($4305 \u002F MB on Ethereum 2018-05-15). Programming is very complicated due to the lack of support for structured data storage. CQL gives you a low-cost structured SQL database and also provides more room for ĐApp to exchange data with real-world.\n\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n\n## TestNet\n\n- [Quick Start](https:\u002F\u002Fdevelopers.covenantsql.io)\n- [MainChain Explorer](http:\u002F\u002Fscan.covenantsql.io)\n- [SQLChain Explorer](https:\u002F\u002Fexplorer.dbhub.org)\n- [Demo & Forum](https:\u002F\u002Fdemo.covenantsql.io\u002Fforum\u002F)\n\n## Contact\n\n- [Blog](https:\u002F\u002Fmedium.com\u002F@covenant_labs)\n- [YouTube](https:\u002F\u002Fwww.youtube.com\u002Fchannel\u002FUCe9P_TMiexSHW2GGV5qBmZw)\n- [Mail](mailto:webmaster@covenantsql.io)\n- [Forum](https:\u002F\u002Fdemo.covenantsql.io\u002Fforum\u002F)\n- \u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fintent\u002Ffollow?screen_name=CovenantLabs\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Furl\u002Fhttps\u002Ftwitter.com\u002Ffold_left.svg?style=social&label=Follow%20%40CovenantLabs\" alt=\"follow on Twitter\">\u003C\u002Fa>\n- [![Join the chat at https:\u002F\u002Fgitter.im\u002FCovenantSQL\u002FCovenantSQL](https:\u002F\u002Fbadges.gitter.im\u002FCovenantSQL\u002FCovenantSQL.svg)](https:\u002F\u002Fgitter.im\u002FCovenantSQL\u002FCovenantSQL?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n- Add `CovenantSQL` to join WeChat group\n    \u003Cp align=\"left\">\n        \u003Cimg src=\"logo\u002Fwechat.jpeg\" height=\"100\">\n    \u003C\u002Fp>\n","CovenantSQL 是一个去中心化、可信且高性能的SQL数据库，具备区块链特性。它基于SQLite构建，支持大部分SQL-92标准，并通过拜占庭容错算法确保数据的一致性和可靠性。CovenantSQL提供无服务器架构下的自动同步数据库服务，适用于需要高可用性与数据隐私保护的应用场景。其独特的不可篡改查询历史功能和细粒度权限控制（列级访问控制及SQL模式白名单）使得该数据库非常适合于对数据安全有严格要求的企业级应用。此外，作为开源项目，CQL还提供了低成本的数据库即服务(DBaaS)解决方案，是亚马逊QLDB的一个开放源代码替代品。",2,"2026-06-11 03:29:19","top_topic"]