Laconic Watchers: Ensuring Trustlessness in Web3

09.06.2022-By — Maly Ly
  • Product
post image

Watchers in the Laconic Network are the keystone technology that will scale blockchain data access for the next wave of Web3 adoption. 

The Laconic stack provides a way for DApp developers to retrieve the blockchain data they require in a manner that is efficient, verifiable, and decentralized. The mechanism by which the relevant subset of blockchain data is queried, cached, and delivered, is the Laconic Watcher.

We’ve previously explored how the Laconic Network uses IPLD (“the data model of the content-addressable web”) to keep off-chain data cryptographically verifiable across transformations. The Laconic Watcher is the component that makes that data available for DApps.  You will learn about the role of Watchers within the Laconic Network, how they work, and what you can use a Watcher for.

DApp Developer Challenges

A public, permissionless blockchain is optimized for storing large amounts of data and achieving consensus. A DApp typically needs only a tiny fraction of that data for its operations. Ethereum clients are not designed to serve the data needs of a given DApp, such as reading and linking data from multiple contracts, introducing cross-chain data, or presenting DApp-specific information to users. Existing options for retrieving blockchain data have some drawbacks:

  • Significant effort required: Running an archive node gives access to all of a blockchain’s data.  Structurally, blockchains are write rather than read optimized. Many developers are unable to, unwilling to, or cost-prohibited from, running the infrastructure.

  • Trustlessness broken: Centralized services can provide indexed blockchain data, but  they lack the mechanisms to cryptographically prove their accuracy and provenance. DApp developers and users must trust these services, contrary to the decentralized and trustless promises of Web3.

Our goal is to make DApp development as frictionless as possible. When you build your DApps, Laconic Watchers relieve you of the infrastructure burden and enable you to query and receive trustless, verifiable, off-chain blockchain data.

The Watcher and the Laconic Network

To understand the Watcher’s role and functionality, let's briefly recap how the Laconic solution works.

  • The primary function of the Laconic Network indexing is to keep an up-to-date version of blockchain data in a relational database. 

  • To achieve this, a Laconic Full Index Node fetches the latest blockchain updates and turns them into IPLD blocks with advanced indexing. 

  • Unlike existing ETL (Extract-Transform-Load) solutions that convert blockchain data into a searchable database format, the Laconic Network continuously monitors and evaluates state diffs on the chain, retrieving and indexing relevant tries.

This additional data opens up a new range of opportunities for DApps. This is the first component of the Laconic solution.  However, the database is still too large and too general for DApps to use; raw blockchain data structures are not suitable for DApps.

Enter the Laconic Watcher.

Your DApp’s Personal Data Delivery Service

Watchers are the component that makes DApp development as frictionless as possible. Watchers serve three fundamental purposes:

  1. Query the Laconic Full Index Node for the specific data your DApp needs.

  2. Transform the queried data to make it consumable for your DApp.

  3. Cache the data for fast and inexpensive access.

Watchers run queries relevant to your DApp through a GraphQL interface; you can create precisely the API you need, transforming the data as required. Watchers run as daemons, constantly updating the cache with transactions from the blockchain's head.

Your Watcher is effectively your personal, virtual, read-only blockchain, containing the specific data your DApp needs. You get the same verifiability you would from the source blockchain, without the same burden or overhead.

Where do I find Watchers? How can I write one? Do I have to?

Running Watchers: It is the job of Service Providers on the Laconic Network to run Watchers. One or more Service Providers can run a given Watcher.

Do I have to write my own Watcher? As a DApp developer, you don’t necessarily need to create your own Watcher. Some alternatives:

  • Pay to access a public Watcher API. The fees are split between the Service Provider and the Watcher creator.

  • Check the Watcher Registry: If a Watcher’s creator chooses to make it publically available, they can add the Watcher to the on-chain Watcher Registry for easy discovery. 

  • You don’t have to start from scratch. Watchers are composable. You can build a Watcher on top of one or more existing Watchers found in the Watcher Registry.

  • What about Smart Contracts? As a Smart Contract author, you can auto-generate Watcher code directly from your Smart Contract's Solidity source code. The code generator is capable of generating the Watcher GraphQL API based on eth_calls as well as storage variables in the Smart Contract.

Watchers, in Conclusion

Laconic Watchers allow DApps to cache and query verifiable blockchain data served by a decentralized network of Service Providers. Watchers facilitate the creation of custom APIs suitable for a DApp’s specific needs. 

  • As a developer, you will benefit from the Laconic Network by finding, writing, or combining Watchers to serve the backend data needs of your DApps.

  • As a Laconic Network Service Provider or Validator, you will be part of solving the problems of blockchain data access for the next wave of Web3 adoption. 

Stay up-to-date with Laconic News

Join our Discord server

Subscribe to our Telegram channel

Sign up for our mailing list below