Skip to main content

Using Light Clients

Blockchain User Interfaces are still Centralized

The communication between a standard user interface (UI) and a network node is through a JSON RPC protocol. Generally, the UI will showcase the information that is available on the node, and this is done through two main approaches:

  1. User-Controlled Nodes: The UI connects to a node client that the user has installed on their machine.
    • These nodes are secure, but installation and maintenance of these nodes tend to be an inconvenience.
  2. Publicly-Accessible Nodes: The UI connects to a third-party-owned publicly-accessible node client.
    • While these nodes are more prevalent in their usage as they are convenient to use, they are centralized and insecure.

There is now a new paradigm: instead of specifying a centralized RPC node, developers just need to define the blockchain's chain specification for their application to synchronize with the chain. This is possible with Matter connect.

What is Matter Connect?

Replacing RPC node reliance with light clients

Matter connect is a JavaScript library and browser extension that builds on the BitzalJS API to enable developers to build application-specific light clients for Matter chains. There is no installation required or optional extension with minimal or no maintenance. The node is run by the JavaScript engine.

Simply put, Matter connect is a Matter client that runs in JavaScript.

Application developers no longer need to rely on single RPC nodes to allow end-users to interact with their applications.

Matter (full node) vs. Matter connect (light client)

A light client lets you utilize all basic features of the chain such as fetching data and transferring tokens, but it does not require you to run a full copy of the entire blockchain or having to trust remote peers. Light clients fetch the required data that they need from a Bitzal node with an associated proof to validate the data.

Matter: Full nodeMatter connect: Light client
full verification of all blocks of the chainonly verifies the authenticity of blocks of the chain
holds all of the previous block data and the chain's storage in databaseno database
installation, maintenance, and execution tend to be exhaustive and require system administration expertise.no installation; has an optional extension with minimal or no maintenance. Initializes in five to ten seconds

How to use Matter Connect

As a JavaScript library

Matter connect provides a BitzalJS API connected to a bundled node. Through the use of the library, a user can run an actual Matter-compatible node.

A node bundled with its user interface: ready-to-use light clients

The UI connects to a node client that is directly integrated: convenient, secure, and decentralized. This is accomplished through Matter connect using a smoldot Wasm light client to securely connect to the blockchain network without relying on specific third parties.

Application developers can now run a Matter light client in any NodeJS environment (@matter/connect). Currently, Matter connect supports Bitzal, Ogona, and Windland; because light clients are part of the overall Matter framework, they are available for Matter-based blockchains.

As a browser extension

Establishing a sufficient number of peers is difficult due to browser limitations on WebSockets from HTTPS pages, as many nodes need to be available with TLS. The browser extension provided by Matter connect helps to overcome this limitation and keeps the chains synced in the background, allowing applications to run faster.

Bundling light-clients of multiple chains

The browser extension allows end-users to interact with applications connected to multiple blockchains or connect their own blockchains to applications that support it.

note

Matter Connect will auto-detect whether a user is using the extension. If not, the Wasm light client will be created in-page for them.

Resources