June 12, 2024

Introducing: SQL Smart Contracts

Kwil Team

Warning to all censors, central bankers, Gary Gensler supporters, authoritarians, fascists, communists, and other evil-doers:

You’re about to have a bad day.

Today, we are excited to announce Kwil v0.8, the SQL Smart Contract release. This release dramatically expands Kwil’s Smart Contract language, Kuneiform, thereby widening the design space for the decentralized internet.

What is a SQL Smart Contract?

A traditional smart contract is self-executing, immutable, and permissionless code on a blockchain. When executing a smart contract, the outcome is stored in a permanent and tamperproof ledger that anyone can openly verify. Smart contracts enable the notion that “Code is Law” and allow us to build trust-minimized applications.

SQL smart contracts extend the concept of traditional smart contracts by applying SQL logic and data structures. Traditionally, smart contracts are limited in how they can store and manage data. This limitation is not a problem for simple use cases (such as cryptocurrencies); however, it is extremely limiting when implementing more sophisticated and data-intensive applications (such as identity platforms and IoT networks). Most Web 2.0 applications are built around SQL databases. Bringing the robustness and flexibility of SQL to the permissionless, self-executing, and immutable nature of smart contracts means that more types of applications, services, and products can become trust-minimized and decentralized.

Why SQL Smart Contracts?

At Kwil, we work with companies that believe decentralization is a competitive advantage for their products and services. These companies deeply understand their respective markets and the products they are building; however, their requirements are often more nuanced than what existing blockchains allow.

Building on a SQL smart contract platform enables these companies to develop decentralized products without sacrificing features, performance, or functionality. Features that previously could not be implemented without a centralized service can now be decentralized and permissionless. 

For example, Truflation, a leading provider of real-world asset metrics and inflation data, is building the Truflation Stream Network (TSN), a decentralized network for managing asset data. With SQL smart contracts, builders on TSN can easily compose across asset datasets, creating new indexes and applications that would not be able to exist otherwise. Although existing smart contract platforms enable a similar level of composability, they cannot handle the relational data structures typically used for asset metrics. Bringing SQL smart contracts to the Truflation Stream Network dramatically expands the types of financial applications, insights, and products that Truflation users can build, opening possibilities for on-chain RWA platforms, lending protocols, and decentralized underwriting.

Next Steps

This release would not have been possible without the close feedback and help from our partners. Special thanks to Truflation, the idOS Network, and PowerPod for their support in iterating on the many features in this release.

You can learn more about Kwil’s new SQL smart contract language here. With the release of Kwil v0.8, there is a new testnet for using Kwil and a new network migration process for upgrading v0.7 networks to v0.8.

Full release notes can be found here, with an upgrade guide from v0.7 to v0.8 found here.

Let’s build.