Урок 2

Architecture Elements

This module goes into the architectural components of Lisk, detailing its main elements, consensus mechanism, and scalability features. It aims to provide a thorough understanding of how Lisk's structure supports its functionality and development goals.

Core Components of Lisk

Lisk Core

Lisk Core manages all blockchain operations, including transaction processing, block creation, and network synchronization. It ensures the integrity and security of the blockchain. Key modules include the network module for peer-to-peer connections, the consensus module for agreement on the blockchain state, and the API module for blockchain interaction.

Core runs on nodes operated by network participants who validate transactions and secure the network. The software is updated regularly to include new features and improvements. It is written in JavaScript and TypeScript, aligning with Lisk’s goal of making blockchain development accessible to a broader audience. The move to TypeScript enhances code maintainability and reduces the likelihood of bugs. The core includes several key subsystems:

  • Transaction Pool: Manages pending transactions before they are included in a block.
  • Block Pool: Handles blocks that have been received but not yet processed.
  • Forger: The module responsible for creating new blocks. In Lisk, block creation is delegated to a set of elected delegates.
  • Consensus: Ensures all nodes in the network agree on the state of the blockchain.
    The Lisk Core update process involves regular releases that incorporate protocol improvements, security patches, and performance enhancements, which are thoroughly tested in testnet environments before being deployed to the mainnet.

Lisk SDK

The Lisk SDK (Software Development Kit) is a toolkit for building custom blockchain applications The SDK enables developers to create sidechains, which are independent blockchains connected to the main Lisk blockchain. These sidechains can be customized for specific use cases and operate independently without affecting the main network’s performance.

Lisk Framework

It provides modular architecture that developers can extend through plugins and custom modules. It manages the lifecycle of the application and the interaction between different modules.

Lisk Elements

A set of libraries that provide tools for interacting with the Lisk blockchain. These include cryptographic functions, transaction creation tools, and utilities for managing accounts and keys. The use of JavaScript and TypeScript makes these libraries accessible to a wider range of developers.

Lisk Commander

A command-line tool that simplifies the development and management of blockchain applications. It includes commands for setting up a development environment, creating new blockchain applications, and deploying them to a network. It also provides tools for managing nodes and interacting with the blockchain.

The SDK also includes support for developing smart contracts, which can be deployed on Lisk sidechains. These contracts are written in JavaScript, making them accessible to a broad range of developers.

Lisk Service

Lisk Service acts as a middleware between the blockchain and user interfaces like Lisk Desktop and Lisk Mobile. It aggregates blockchain data and provides APIs for accessing this information. Key functionalities include data aggregation, API endpoints for querying blockchain data, and enhanced data access features. Lisk Service ensures that applications and wallets can interact with the blockchain efficiently, providing real-time data access and improving user experience.

Lisk Service includes:

  • Gateway: Manages API requests and routes them to the appropriate service.
  • Data Aggregator: Collects and processes data from the blockchain, making it available through APIs.
  • Indexer: Indexes blockchain data to enable fast and efficient querying.
  • Cache: Stores frequently accessed data to improve performance.

These components work together to provide a seamless experience for developers and users. The service is designed to be highly scalable, allowing it to handle large volumes of data and high traffic loads.

Sidechain and Mainchain Architecture

Lisk uses sidechains to enhance scalability and flexibility. The mainchain handles essential operations and secures the network, while sidechains handle their own transactions and operations, a separation which enables:

  • Scalability: Sidechains process transactions independently, reducing the mainchain’s load.
  • Customization: Developers can create sidechains tailored to specific applications.
  • Interoperability: Sidechains can communicate with the mainchain and other sidechains through cross-chain messaging, enabling data and value transfer across the network.

How Sidechains Work

Sidechains in Lisk are fully independent blockchains that can operate with their own set of rules and consensus mechanisms. They are connected to the main Lisk blockchain, which provides security and coordination. Sidechains can be used for a variety of purposes, such as running dApps, managing digital assets, or implementing specialized blockchain solutions.

To create a sidechain developers use the Lisk SDK to create and configure sidechains. It provides tools for defining the sidechain’s consensus mechanism, transaction types, and other parameters. Once created, the sidechain is connected to the mainchain through a set of interoperability protocols.

In terms of Lisk’s interoperability solution, it enables sidechains to communicate with each other and with the mainchain effectively. This is achieved through cross-chain update (CCU) transactions, which carry state changes and data between chains. For example, a sidechain can send a CCU to the mainchain to update its state or to transfer assets. The mainchain validates the CCU and applies the changes.

Sidechains inherit security from the mainchain through the use of cryptographic proofs and validation mechanisms, ensuring that sidechain operations are secure and tamper-proof. The mainchain also provides a finality layer, ensuring that transactions on sidechains cannot be reversed once they are confirmed.

Consensus Mechanism: Delegated Proof of Stake (DPoS)

Lisk uses a Delegated Proof of Stake (DPoS) consensus mechanism, where stakeholders (LSK token holders) vote for delegates who validate transactions and create new blocks. Features of Lisk’s DPoS system include:

  • Delegates: 101 active delegates are elected by stakeholders to maintain the blockchain.
  • Voting Power: Stakeholders vote for delegates by locking their LSK tokens.
  • Incentives: Delegates earn rewards for validating transactions, which are often shared with their voters.

How DPoS Works

In DPoS, the power to create blocks and validate transactions is delegated to a set of trusted nodes known as delegates, who are elected by LSK token holders through a voting process. Each LSK token represents one vote, and token holders can distribute their votes among multiple delegates.

Election of Delegates

The election process is continuous, with token holders able to change their votes at any time. The top 101 delegates with the most votes are responsible for creating blocks and validating transactions. This ensures that the network remains decentralized and that power is distributed among multiple participants.

Block Creation

Delegates take turns creating blocks in a round-robin fashion. Each delegate is assigned a time slot during which they can create a block. If a delegate fails to create a block within their slot, the next delegate in line takes over. This process ensures that blocks are created regularly and that the network remains efficient.

Validation

Once a block is created, it is broadcast to the network and validated by other nodes. If the block is valid, it is added to the blockchain. If not, it is rejected, and the delegate responsible for creating it may be penalized. This validation process ensures that only legitimate transactions are included in the blockchain.

Byzantine Fault Tolerance (BFT)

Lisk incorporates Byzantine Fault Tolerance (BFT) to ensure network reliability and security. BFT addresses the challenge of achieving consensus in a distributed system with potentially faulty nodes. Lisk’s BFT implementation ensures finality, consistency and resilience. Once a block is added, it is considered final and cannot be reverted and all honest nodes agree on the blockchain’s state.

The network can tolerate a certain number of faulty nodes without compromising security and functionality.

How BFT Works

BFT in Lisk is achieved through a process known as pre-voting and pre-commitment. This process involves multiple stages of validation to ensure that a block is accepted by the network.

Pre-Voting: When a block is proposed, nodes in the network cast pre-votes to indicate whether they believe the block is valid. These pre-votes are collected and counted. If a sufficient number of pre-votes are received, the block moves to the next stage.

Pre-Commitment: Nodes that have pre-voted for the block then cast pre-commitments. These pre-commitments are also collected and counted. If a sufficient number of pre-commitments are received, the block is considered finalized and is added to the blockchain.

Finality: Once a block is finalized, it cannot be reverted. This ensures that transactions are permanent and that the blockchain remains consistent. The use of pre-voting and pre-commitment ensures that consensus is achieved even in the presence of faulty nodes.

Scalability Features

Lisk’s architecture addresses scalability challenges with features like:

  • Sidechains: Allow independent transaction processing.
  • Efficient Consensus: DPoS and BFT ensure quick and secure transaction validation.
  • Interoperability: Facilitates communication between sidechains and the mainchain.

Improving Performance

Lisk has implemented several features to improve the performance and scalability of the network. Transaction fees are dynamically adjusted based on network conditions, helping to prevent congestion and ensuring that transactions are processed efficiently.

Lisk has enhanced its peer-to-peer layer to handle a higher volume of connections and data throughput. This optimization improves the network’s ability to process transactions quickly and efficiently. The modular design of the Lisk SDK allows developers to create customized blockchain applications. Each application can operate independently, reducing the load on the mainchain and enhancing overall network performance.

Interoperability Solutions

Lisk’s interoperability framework is designed to facilitate communication between different blockchains. This is achieved through several mechanisms:

Cross-Chain Messages (CCMs): CCMs are used to transfer data and state changes between sidechains and the mainchain. This allows for seamless interaction between different chains within the Lisk ecosystem.

Federated 2-Way Peg: This mechanism enables token transfers between sidechains and the mainchain. A federation of trusted intermediaries manages the minting and burning of tokens, ensuring secure and efficient transfers.

General Cross-Chain Messaging: Lisk’s interoperability solution supports the transfer of various types of data, not just tokens. This flexibility allows for a wide range of applications, from token transfers to more complex data interactions.

Future Roadmap and Updates

Lisk’s roadmap includes several key milestones aimed at enhancing the platform’s capabilities and expanding its ecosystem. Upcoming developments include plans to launch a Layer 2 Testnet connected to the Ethereum Sepolia Testnet. This Testnet will serve as a proving ground for new features and improvements before they are deployed to the mainnet.

The introduction of staking and governance mechanisms will empower the community with decision-making powers. These features will promote decentralization and encourage active participation from LSK token holders. Continuous improvements to the Lisk SDK will enhance the development experience and enable the creation of more sophisticated and scalable applications.

Detailed Component Explanation

Lisk Framework

The Lisk Framework is the core of the Lisk SDK. It provides the essential infrastructure for building blockchain applications. The framework is built on a modular system, allowing developers to extend functionality through custom modules, which can implement blockchain features, such as custom transaction types or consensus algorithms.

Similar to the module system, the plugin system allows developers to add additional features to their blockchain applications. Plugins can include monitoring tools, analytics, or other auxiliary functionalities that enhance the application’s capabilities.

The Lisk Framework manages the lifecycle of blockchain applications, including initialization, execution, and shutdown processes, ensuring that applications run smoothly and can be easily maintained.

Lisk Elements

Lisk Elements is a collection of JavaScript libraries that provide tools for interacting with the Lisk blockchain. These libraries include a suite of cryptographic tools for securing transactions and managing keys, including digital signatures, hash functions, and encryption mechanisms.

The libraries include tools for creating and managing blockchain transactions, which simplifies the process of developing applications that interact with the Lisk blockchain. Lisk Elements includes utilities for managing blockchain accounts, including key generation, account recovery, and balance queries.

Lisk Commander

Lisk Commander is a command-line interface (CLI) tool that simplifies the development and management of blockchain applications. It includes commands for setting up and managing blockchain nodes, including starting, stopping, and monitoring node operations. Tools for interacting with the blockchain include querying the state, submitting transactions, and retrieving block data.

Commands for deploying and managing blockchain applications, including creating new applications, updating existing ones, and managing application configurations.

Highlights

  • Lisk Core: Manages all blockchain operations, including transaction processing, block creation, and network synchronization.
  • Lisk SDK: A toolkit for building custom blockchain applications, consisting of the Lisk Framework, Lisk Elements, and Lisk Commander.
  • Lisk Service: Acts as middleware between the blockchain and user interfaces, aggregating and providing access to blockchain data.
  • Sidechain Architecture: Enhances scalability and flexibility by allowing independent blockchains to operate alongside the mainchain.
  • Consensus and Security: Uses Delegated Proof of Stake (DPoS) and Byzantine Fault Tolerance (BFT) to ensure secure and efficient network operation.
Відмова від відповідальності
* Криптоінвестиції пов'язані зі значними ризиками. Дійте обережно. Курс не є інвестиційною консультацією.
* Курс створений автором, який приєднався до Gate Learn. Будь-яка думка, висловлена автором, не є позицією Gate Learn.
Каталог
Урок 2

Architecture Elements

This module goes into the architectural components of Lisk, detailing its main elements, consensus mechanism, and scalability features. It aims to provide a thorough understanding of how Lisk's structure supports its functionality and development goals.

Core Components of Lisk

Lisk Core

Lisk Core manages all blockchain operations, including transaction processing, block creation, and network synchronization. It ensures the integrity and security of the blockchain. Key modules include the network module for peer-to-peer connections, the consensus module for agreement on the blockchain state, and the API module for blockchain interaction.

Core runs on nodes operated by network participants who validate transactions and secure the network. The software is updated regularly to include new features and improvements. It is written in JavaScript and TypeScript, aligning with Lisk’s goal of making blockchain development accessible to a broader audience. The move to TypeScript enhances code maintainability and reduces the likelihood of bugs. The core includes several key subsystems:

  • Transaction Pool: Manages pending transactions before they are included in a block.
  • Block Pool: Handles blocks that have been received but not yet processed.
  • Forger: The module responsible for creating new blocks. In Lisk, block creation is delegated to a set of elected delegates.
  • Consensus: Ensures all nodes in the network agree on the state of the blockchain.
    The Lisk Core update process involves regular releases that incorporate protocol improvements, security patches, and performance enhancements, which are thoroughly tested in testnet environments before being deployed to the mainnet.

Lisk SDK

The Lisk SDK (Software Development Kit) is a toolkit for building custom blockchain applications The SDK enables developers to create sidechains, which are independent blockchains connected to the main Lisk blockchain. These sidechains can be customized for specific use cases and operate independently without affecting the main network’s performance.

Lisk Framework

It provides modular architecture that developers can extend through plugins and custom modules. It manages the lifecycle of the application and the interaction between different modules.

Lisk Elements

A set of libraries that provide tools for interacting with the Lisk blockchain. These include cryptographic functions, transaction creation tools, and utilities for managing accounts and keys. The use of JavaScript and TypeScript makes these libraries accessible to a wider range of developers.

Lisk Commander

A command-line tool that simplifies the development and management of blockchain applications. It includes commands for setting up a development environment, creating new blockchain applications, and deploying them to a network. It also provides tools for managing nodes and interacting with the blockchain.

The SDK also includes support for developing smart contracts, which can be deployed on Lisk sidechains. These contracts are written in JavaScript, making them accessible to a broad range of developers.

Lisk Service

Lisk Service acts as a middleware between the blockchain and user interfaces like Lisk Desktop and Lisk Mobile. It aggregates blockchain data and provides APIs for accessing this information. Key functionalities include data aggregation, API endpoints for querying blockchain data, and enhanced data access features. Lisk Service ensures that applications and wallets can interact with the blockchain efficiently, providing real-time data access and improving user experience.

Lisk Service includes:

  • Gateway: Manages API requests and routes them to the appropriate service.
  • Data Aggregator: Collects and processes data from the blockchain, making it available through APIs.
  • Indexer: Indexes blockchain data to enable fast and efficient querying.
  • Cache: Stores frequently accessed data to improve performance.

These components work together to provide a seamless experience for developers and users. The service is designed to be highly scalable, allowing it to handle large volumes of data and high traffic loads.

Sidechain and Mainchain Architecture

Lisk uses sidechains to enhance scalability and flexibility. The mainchain handles essential operations and secures the network, while sidechains handle their own transactions and operations, a separation which enables:

  • Scalability: Sidechains process transactions independently, reducing the mainchain’s load.
  • Customization: Developers can create sidechains tailored to specific applications.
  • Interoperability: Sidechains can communicate with the mainchain and other sidechains through cross-chain messaging, enabling data and value transfer across the network.

How Sidechains Work

Sidechains in Lisk are fully independent blockchains that can operate with their own set of rules and consensus mechanisms. They are connected to the main Lisk blockchain, which provides security and coordination. Sidechains can be used for a variety of purposes, such as running dApps, managing digital assets, or implementing specialized blockchain solutions.

To create a sidechain developers use the Lisk SDK to create and configure sidechains. It provides tools for defining the sidechain’s consensus mechanism, transaction types, and other parameters. Once created, the sidechain is connected to the mainchain through a set of interoperability protocols.

In terms of Lisk’s interoperability solution, it enables sidechains to communicate with each other and with the mainchain effectively. This is achieved through cross-chain update (CCU) transactions, which carry state changes and data between chains. For example, a sidechain can send a CCU to the mainchain to update its state or to transfer assets. The mainchain validates the CCU and applies the changes.

Sidechains inherit security from the mainchain through the use of cryptographic proofs and validation mechanisms, ensuring that sidechain operations are secure and tamper-proof. The mainchain also provides a finality layer, ensuring that transactions on sidechains cannot be reversed once they are confirmed.

Consensus Mechanism: Delegated Proof of Stake (DPoS)

Lisk uses a Delegated Proof of Stake (DPoS) consensus mechanism, where stakeholders (LSK token holders) vote for delegates who validate transactions and create new blocks. Features of Lisk’s DPoS system include:

  • Delegates: 101 active delegates are elected by stakeholders to maintain the blockchain.
  • Voting Power: Stakeholders vote for delegates by locking their LSK tokens.
  • Incentives: Delegates earn rewards for validating transactions, which are often shared with their voters.

How DPoS Works

In DPoS, the power to create blocks and validate transactions is delegated to a set of trusted nodes known as delegates, who are elected by LSK token holders through a voting process. Each LSK token represents one vote, and token holders can distribute their votes among multiple delegates.

Election of Delegates

The election process is continuous, with token holders able to change their votes at any time. The top 101 delegates with the most votes are responsible for creating blocks and validating transactions. This ensures that the network remains decentralized and that power is distributed among multiple participants.

Block Creation

Delegates take turns creating blocks in a round-robin fashion. Each delegate is assigned a time slot during which they can create a block. If a delegate fails to create a block within their slot, the next delegate in line takes over. This process ensures that blocks are created regularly and that the network remains efficient.

Validation

Once a block is created, it is broadcast to the network and validated by other nodes. If the block is valid, it is added to the blockchain. If not, it is rejected, and the delegate responsible for creating it may be penalized. This validation process ensures that only legitimate transactions are included in the blockchain.

Byzantine Fault Tolerance (BFT)

Lisk incorporates Byzantine Fault Tolerance (BFT) to ensure network reliability and security. BFT addresses the challenge of achieving consensus in a distributed system with potentially faulty nodes. Lisk’s BFT implementation ensures finality, consistency and resilience. Once a block is added, it is considered final and cannot be reverted and all honest nodes agree on the blockchain’s state.

The network can tolerate a certain number of faulty nodes without compromising security and functionality.

How BFT Works

BFT in Lisk is achieved through a process known as pre-voting and pre-commitment. This process involves multiple stages of validation to ensure that a block is accepted by the network.

Pre-Voting: When a block is proposed, nodes in the network cast pre-votes to indicate whether they believe the block is valid. These pre-votes are collected and counted. If a sufficient number of pre-votes are received, the block moves to the next stage.

Pre-Commitment: Nodes that have pre-voted for the block then cast pre-commitments. These pre-commitments are also collected and counted. If a sufficient number of pre-commitments are received, the block is considered finalized and is added to the blockchain.

Finality: Once a block is finalized, it cannot be reverted. This ensures that transactions are permanent and that the blockchain remains consistent. The use of pre-voting and pre-commitment ensures that consensus is achieved even in the presence of faulty nodes.

Scalability Features

Lisk’s architecture addresses scalability challenges with features like:

  • Sidechains: Allow independent transaction processing.
  • Efficient Consensus: DPoS and BFT ensure quick and secure transaction validation.
  • Interoperability: Facilitates communication between sidechains and the mainchain.

Improving Performance

Lisk has implemented several features to improve the performance and scalability of the network. Transaction fees are dynamically adjusted based on network conditions, helping to prevent congestion and ensuring that transactions are processed efficiently.

Lisk has enhanced its peer-to-peer layer to handle a higher volume of connections and data throughput. This optimization improves the network’s ability to process transactions quickly and efficiently. The modular design of the Lisk SDK allows developers to create customized blockchain applications. Each application can operate independently, reducing the load on the mainchain and enhancing overall network performance.

Interoperability Solutions

Lisk’s interoperability framework is designed to facilitate communication between different blockchains. This is achieved through several mechanisms:

Cross-Chain Messages (CCMs): CCMs are used to transfer data and state changes between sidechains and the mainchain. This allows for seamless interaction between different chains within the Lisk ecosystem.

Federated 2-Way Peg: This mechanism enables token transfers between sidechains and the mainchain. A federation of trusted intermediaries manages the minting and burning of tokens, ensuring secure and efficient transfers.

General Cross-Chain Messaging: Lisk’s interoperability solution supports the transfer of various types of data, not just tokens. This flexibility allows for a wide range of applications, from token transfers to more complex data interactions.

Future Roadmap and Updates

Lisk’s roadmap includes several key milestones aimed at enhancing the platform’s capabilities and expanding its ecosystem. Upcoming developments include plans to launch a Layer 2 Testnet connected to the Ethereum Sepolia Testnet. This Testnet will serve as a proving ground for new features and improvements before they are deployed to the mainnet.

The introduction of staking and governance mechanisms will empower the community with decision-making powers. These features will promote decentralization and encourage active participation from LSK token holders. Continuous improvements to the Lisk SDK will enhance the development experience and enable the creation of more sophisticated and scalable applications.

Detailed Component Explanation

Lisk Framework

The Lisk Framework is the core of the Lisk SDK. It provides the essential infrastructure for building blockchain applications. The framework is built on a modular system, allowing developers to extend functionality through custom modules, which can implement blockchain features, such as custom transaction types or consensus algorithms.

Similar to the module system, the plugin system allows developers to add additional features to their blockchain applications. Plugins can include monitoring tools, analytics, or other auxiliary functionalities that enhance the application’s capabilities.

The Lisk Framework manages the lifecycle of blockchain applications, including initialization, execution, and shutdown processes, ensuring that applications run smoothly and can be easily maintained.

Lisk Elements

Lisk Elements is a collection of JavaScript libraries that provide tools for interacting with the Lisk blockchain. These libraries include a suite of cryptographic tools for securing transactions and managing keys, including digital signatures, hash functions, and encryption mechanisms.

The libraries include tools for creating and managing blockchain transactions, which simplifies the process of developing applications that interact with the Lisk blockchain. Lisk Elements includes utilities for managing blockchain accounts, including key generation, account recovery, and balance queries.

Lisk Commander

Lisk Commander is a command-line interface (CLI) tool that simplifies the development and management of blockchain applications. It includes commands for setting up and managing blockchain nodes, including starting, stopping, and monitoring node operations. Tools for interacting with the blockchain include querying the state, submitting transactions, and retrieving block data.

Commands for deploying and managing blockchain applications, including creating new applications, updating existing ones, and managing application configurations.

Highlights

  • Lisk Core: Manages all blockchain operations, including transaction processing, block creation, and network synchronization.
  • Lisk SDK: A toolkit for building custom blockchain applications, consisting of the Lisk Framework, Lisk Elements, and Lisk Commander.
  • Lisk Service: Acts as middleware between the blockchain and user interfaces, aggregating and providing access to blockchain data.
  • Sidechain Architecture: Enhances scalability and flexibility by allowing independent blockchains to operate alongside the mainchain.
  • Consensus and Security: Uses Delegated Proof of Stake (DPoS) and Byzantine Fault Tolerance (BFT) to ensure secure and efficient network operation.
Відмова від відповідальності
* Криптоінвестиції пов'язані зі значними ризиками. Дійте обережно. Курс не є інвестиційною консультацією.
* Курс створений автором, який приєднався до Gate Learn. Будь-яка думка, висловлена автором, не є позицією Gate Learn.