Cover photo

Introducing Kwil Extensions: Revolutionizing Custom Logic in Decentralized Databases

We're thrilled to unveil a groundbreaking way to integrate custom logic and functionality into decentralized databases—introducing Kwil Extensions. These extensions significantly enhance the capabilities of decentralized applications, enabling developers to connect to any blockchain, execute any logic, and drastically boost dApp functionality at the database level.

Kwil Extensions offer a plug-and-play solution, making it easier for developers to define, implement, and reuse custom logic within their databases. Each database can support multiple extensions, and developers can even incorporate extensions created by other teams. Our vision includes an extension marketplace where teams can collaborate, share, and build upon each other’s work.

Seamless Integration. Boundless Logic. Welcome to the Modular Database Era.

What are Kwil Extensions?

Kwil Extensions are stateless applications that run alongside your Kwil database, giving you the ability to inject custom logic directly into database queries. This allows you to create complex functions that go beyond the scope of traditional SQL. With extensions, you can pull data from external sources, push data to other systems (like smart contracts), and implement detailed access control mechanisms.

These extensions are containerized applications, meaning they can be written in any programming language and easily integrated into your Kwil database. When a database query is executed, the extension’s logic runs simultaneously, typically requiring only about 100 lines of code to function effectively.

What Can You Build with Kwil Extensions?

In short, almost anything.

Kwil Extensions allow developers to connect to external data sources and implement custom logic. Some examples of current use cases include:

  • Token Gating: Restrict access to database content based on an on-chain asset, such as requiring users to hold specific tokens or NFTs.

  • Token Incentives: Automatically distribute token rewards for data creation, allowing projects to incentivize users to share valuable data (like IoT or financial data) and earn rewards in return.

  • Access Control: Securely manage database access by connecting to external authentication systems and verifying credentials before query execution.

  • Stateless Functions: Create intermediary functions that manipulate data before it’s stored in the database, such as cryptographic operations.

How to Get Started with Kwil Extensions

To deploy custom Kwil Extensions, you'll need to run a local Kwil node with an extension server. Kwil also offers managed hosting solutions for production environments—reach out to help@kwil.com for more details.

For building extensions, Kwil provides SDKs in Golang and TypeScript/JavaScript, complete with documentation and code examples. Once your extension is ready, you can deploy it using the Extension Deployment Script, connecting it to your local Kwil node.

For more guidance on containerizing and deploying your extension, check out the detailed documentation.

What's Next?

We’re excited to see how developers use Kwil Extensions to enhance their databases. As we collaborate with our partners to connect Kwil to multiple blockchains, Kwil is on track to become the first truly cross-chain decentralized database platform.