SatLayer Core Contracts
These are core contracts maintained and owned by SatLayer's core contributors, and deployed on the Babylon Chain.
Last updated
These are core contracts maintained and owned by SatLayer's core contributors, and deployed on the Babylon Chain.
Last updated
This document presents an overview of the system components, contracts, and user roles, detailing a total of 10 core smart contracts within the BVS framework.
BVS Directory for registering BVS contracts.
State Bank for managing relevant BVS task data.
BVS Driver for managing BVS task lifecycle.
Strategy Manager for managing the various assets accepted as collateral.
Delegation Manager for managing the delegation and withdraw of staker assets to operators.
Rewards Coordinator for managing the deposit and distribution of BVS token rewards.
Slash Manager for managing the report and execution of asset slashing.
BVS developers need to focus on contracts including BVSDirectory
, BVSDriver
and StateBank
.
To deploy a live BVS, you will need to:
Write, compile, and deploy your BVS Service Contracts.
Register your TaskInterface contract with the BVS Director
Your TaskInterface contract should call the StateBank then the BVSDriver
The BVS contracts you develop will interface with these three primary contracts. Additional contracts handle functions like delegation, staking, slashing, and more. For further details, please refer to Staking and Delegation. Refer to Contract Addresses to find all deployed core contract addresses and their corresponding explorer links.
The BVSDirectory manages interactions between BVS Services Contracts and the SatLayer Core Contracts. Once registered as an Operator in the SatLayer core (via DelegationManager
), Operators can register with one or more BVSs (via the BVS's contracts) to start providing off-chain services to them. When an Operator registers with a BVS, the BVS records this registration in the core contracts by interfacing with the BVSDirectory
.
The functions of the BVSDirectory include:
Register BVS: Registers the BVS info to BVSDirectory contract.
Register/Deregister Operator: adds or removes an Operator from a specific BVS
Read Only query functions for retrieving on-chain data to be used by off-chain programs.
The StateBank module manages the on-chain state data. It uses the set method to store task states on the blockchain and broadcasts state changes via event logs (event updateState).
StateBank
serves as the central state management system, providing storage and updates for tasks throughout their lifecycle.
The functions provided in the StateBank
include:
Set On-Chain State: Sets a key, value
pair in the StateBank contract, where the key is a string and the value is an int64.
Register a BVS: Registers the final TaskInterface
contract of a BVS Service, required for StateBank
to accept new state data.
Get Method: Provides a method to query on-chain state data.
The BVSDriver module is responsible for managing the BVS task lifecycle within SatLayer. It triggers the execution of BVS off-chain operations via the run BVS method and notifies other modules when a task starts. The BVSDriver
connects with the StateBank
module to retrieve relevant task state and passes this information along to the BVS off-chain program.
Provided functions are as follows:
Set Task Id: to emit a new task event for off-chain program.
Register a BVS Service's final TaskInterface
contract, this is required for BVSDriver to accept tasks.
The functions provided in the BVSDirectory
include:
Set Task ID: Emits a new task event for the off-chain program.
Register a BVS: Registers the final TaskInterface
contract of a BVS Service, which is required for BVSDriver
to accept tasks.
This section is non-final and subject to change. Slashing and its Governance is extremely important to SatLayer, and is still an area of active research.
The SlashManager contract is primarily responsible for penalizing Operators engaged in invalid or malicious activities. The contract owner can designate Validators who will sign and verify slash requests on-chain. The number of Validators who verify slashing should exceeds a minimum threshold for enhanced security and fairness in executing slashes.
Additionally, Slasher roles, appointed by the contract owner, are granted the ability to submit, cancel, and execute slashes. During slash execution, the shares delegated by Stakers to the affected Operator are reduced, with the penalties evenly distributed among all Stakers who delegated to that Operator. Only Slasher roles can submit, execute, or cancel slash requests.
The remaining SatLayer Core Contracts manage functions like staking, delegation, operator coordination, and reward distribution. While these details aren't immediately relevant for developing a BVS service, you can refer to the Staking, Delegation and Rewards Distribution sections for a deeper understanding of how these contracts operate.