Today, we are excited to introduce a new paradigm for implementing custom logic and functionality in a decentralized database: Kwil Extensions. Extensions vastly expand the features that can be built for your decentralized application, allowing developers to connect to any blockchain, implement any logic, and dramatically improve dApp functionality at the database level.
As a plug-and-play solution, extensions allow developers to easily define and reuse arbitrary logic to be implemented in their database. Databases can support an arbitrary number of extensions, and developers are free to reuse some of their favorite extensions built and released by other teams. In the future, we envision an extension marketplace where teams can openly exchange their extensions and compose on each other’s work.
Connect to any chain. Execute any logic. Welcome to the era of modular database software.
Extensions are stateless applications that connect to and run in parallel to your Kwil database. They allow developers to inject custom functions directly into database queries, allowing the creation of complex logic that cannot be represented in just SQL. With an extension, you can automatically inject data from external sources into your database, push data from your database to external targets (e.g., a smart contract), and implement fine-grained access control and verification mechanisms.
Extensions are run as containerized applications, written in any language, and imported into your Kwil database. When executing queries on the database, action logic is simultaneously executed. The average extension requires only ~100 lines of code.
The short answer: just about anything.
The long answer: Extensions allow you to connect to any external data source and implement logic around that data. Some extensions we already see being built today include:
Extensions must be embedded directly in a deployed Kwil network. In order to deploy a custom extension, you must run a local Kwil node with an extension server. Kwil also provides managed hosting for Kwil nodes with an extension server to run in production (reach out to [email protected] to learn more).
Kwil offers Golang and TypeScript/JavaScript SDKs for creating extensions. Information on how to use each package and code samples are found in the documentation. Once your extension is ready for deployment, you can plug it into the Extension Deployment Script to run your extension on a local Kwil node.
More information on containerizing your extension and deploying it with a Kwil node is found here.
From here, we are excited to see what functionality developers implement on their databases with extensions. We are actively collaborating with our partners on extensions to connect Kwil to other blockchains, making Kwil the first truly cross-chain decentralized database platform.
Do you have an idea for an extension you would like to collaborate on? Reach out to us on Discord or send us a note at [email protected].
We can’t wait to see what you #BuildWithKwil.