Off-Chain Operator Software
Last updated
Last updated
SatLayer's Off-Chain Operator Software consists of a set of programs that listen for on-chain events and respond accordingly.
Node operators run important off-chain components developed by BVS developers , which typically includes:
Off-Chain Compute Processes: These processes perform productive tasks as needed.
Challenger Processes: These monitor the network for potential violations.
When a BVS consumer creates a new task, the off-chain compute process activates, executing the required operation, signing the result, and forwarding it either to another component within the BVS or directly back on-chain.
The Challenger listens for on-chain result submission events and verifies if the result meets any slashing conditions. If it does, a challenge is raised, initiating the BVS contract to penalize misbehaving operators.
SatLayer provides helper utilities and libraries to simplify the development and organization of these essential on-chain and off-chain workflows.
SatLayer offers various modules to facilitate interaction with our contracts and streamline the development of operator software. There are no limitations on the number of processes, servers, or the complexity of the off-chain software. In fact, you can implement multiple processes, provided that the final step results in a task result being submitted on-chain.
ChainIO
is our primary library that offers easy access to contracts, on-chain events, node status, and other features. It serves as the foundation for all off-chain SDK functionalities, communicating with the Babylon node specified by the developer.
The ChainIO library supports both reading and writing to contracts (referred to as querying and executing in CosmWasm terms).
Below is a list of helper functions built on ChainIO, designed to simplify interaction with SatLayer's core contracts using Golang.
Built on ChainIO, our off-chain SDK offers strongly typed wrappers for all SatLayer core contracts, including the BVSDirectory
wrapper. This wrapper facilitates access to the BVS Directory contract and allows for querying of BVS information.
The StateBank
is another wrapper for the State Bank contract. It monitors on-chain StateBank
update events and maintains a local view of the state in sync with the on-chain version. It also enables programs to query the local view of the contract state.
In pseudo code, this functionality can be represented as follows:
The BVS Driver contract emits events when a new task is created by the BVS. Off-chain programs listen for these events generated by the BVSDriver
and then perform the required computation.
In pseudo code, this functionality can be represented as follows:
Thereβs no need to worry about synchronization between the BVS Driver and the State Bank. The BVS Driver will internally handle off-chain synchronization with the State Bank and will only process tasks that have been synchronized.
For detailed implementation and usage information, please refer to the Hello World BVS section.
The following Golang modules are also provided to facilitate developers in interacting with our other core contracts. All of these modules are available inside the ChainIO/API folder.
DelegationManager
RewardsCoordinator
SlashManager
StrategyBase
StrategyBaseTVLLimits
StrategyFactory
StrategyManager
The off-chain component is highly flexible, and SatLayer provides libraries to simplify development. As mentioned in SatLayer's architecture, a BVS has two core responsibilities:
Receive task creation events and perform the computations accordingly.
Submit the result back to the BVS contract.
The specifics of the computation and how the results are sent back are implementation details that BVS developers can design freely, keeping in mind that there must be a mechanism to verify the validity of the result on-chain.
SatLayer's BVS framework is designed to be modular, accommodating your diverse use cases. Whether you need a GPU for computation, wish to interact with another blockchain on a different network, or want to split the off-chain software to support multiple operators and incorporate an aggregator for higher availability, you can leverage SatLayer's modular BVS framework for your dApp and development work. Just ensure that you adhere to the core BVS blueprint and principles.