Off-chain architecture

off chain architecture

The off-chain architecture of the Application consists mainly of plugins. Plugins can run in the same process as the Application, or in a child process, to make use of all hardware resources.

What is a plugin?

Plugins offer useful features to the application and external services, which are part of the off-chain logic of the blockchain application. In other words, a plugin will never change the state of the blockchain itself, in contrary to modules, which hold the on-chain logic of the blockchain application.

Plugins expose an interface, similar to the interface for modules. This interface allows external services to interact with the plugin. More information about the exposed interface can be found in the section about the Communication Architecture.

When to create a custom plugin

Plugins enable to…​

  • search the blockchain data.

  • aggregate the blockchain data.

  • automate the blockchain logic, such as automatically seeding transactions.

  • add a proxy to the application interfaces.

How to create a custom plugin

All custom plugins must extend the BasePlugin exposed by the SDK. The interface for the BasePlugin is described in the Lisk Framework reference.

Plugins and the application can interact with each other by using a channel. Each plugin is given one channel through the load function as shown below:

Example: A timestamp plugin

export class MyPlugin extends BasePlugin {
    static get alias(){ return 'pluginAlias'; }, (1)

    static get info(){ (2)
        return {
            author: '',
            version: '',
            name: '',

    private _knownTimestamps: number[] = [];

    get defaults() { (3)
      return {
        type: 'object',
        properties: {
          enable: {
            type: 'boolean',

    get events() { (4)
      return ['timestamp'];

    get actions() { (5)
        return {
           getKnownTimestamp: () => this._knownTimestamps;

    async load(channel: Channel): Promise<void> { (6)
      // initialize plugin
      if (!this.options.enable) { (7)
      channel.subscribe('app:block:new', ({ data }) => { (8)
        const decodedBlock = this.codec.decodeBlock(data.block); (9)
        this.knownTimestamp.push(decodedBlock.header.timestamp); (10)
        channel.publish('timestamp', { timestamp: decodedBlock.header.timestamp }); (11)

    async unload() { (12)
      this._knownTimestamps = [];
1 The unique plugin identifier for this plugin is pluginAlias.
2 Package meta information.
3 The configuration schema for this plugin. After registering the plugin with the application, it can be configured in the application configuration.
4 The plugin registers the event pluginAlias:timestamp with the application. Other plugins and modules can subscribe to this event.
5 Defines the action pluginAlias:getKnownTimestamp, which can be invoked by other plugins and modules in the application.
6 Method which will be invoked by the controller to load the plugin.
7 Doesn’t load the plugin, if it is disabled in the config.
8 Subscribes to the event app:block:new. For every new block that is forged, it will perform the following commands.
9 Decodes the received block.
10 Pushes the timestamp of the new block into the _knownTimestamps array.
11 Publishes a new event pluginAlias:timestamp with the latest block timestamp to the application.
12 Method to be invoked by controller to perform the cleanup. Deletes all timestamps in the _knownTimestamps array.

Default plugins

Name Description

HTTP API plugin

Provides a RESTful HTTP API for a Lisk node. The API serves information related to accounts, blocks, transactions, node info and more.

Forger Plugin

The forger plugin is mainly responsible for:

  • Enabling and disabling forging

  • Tracking forging and voters information

  • Forger plugin also provides webhook functionality, one could configure a webhook to monitor remote nodes.

PoM (Proof of Misbehavior) Plugin

A plugin that provides automatic detection of delegate misbehavior and sends a reportDelegateMisbehaviorTransaction to the running node.

Monitor Plugin

A plugin that provides network statistics of the running node.