Validated Service Lifecycle
SatLayer supports various types of integration:
- EVM Contract: Service with deployed on-chain logic developed in Solidity (or EVM-compatible language), objectively verifiable and irrefutable by the network, driven primarily by the contract code.
- CosmWasm Contract: Service with deployed on-chain logic developed in Rust, objectively verifiable and irrefutable by the network, driven primarily by the contract code.
- Protocol-agnostic: Service with a contract-agnostic and/or protocol-agnostic logic (using EOA) that can be verified by the network, but not necessarily on-chain. This allows a wider range of services that can utilize shared security.
Lifecycle of a Bitcoin Validated Service (BVS)
Regardless of the type of service, the lifecycle of a Bitcoin Validated Service (BVS) is the same. BVS developers integrate with the SatLayer ecosystem through a set of core contracts, either directly as EOA or governed through a set (or singular) smart contract.
The two core contracts utilized by BVS for the entire BVS lifecycle are BVS Registry and BVS Router.
The lifecycle of a Bitcoin Validated Service (BVS) is similar regardless of the type of service. The code section below provides an high-level overview of the lifecycle and how to integrate with the SatLayer ecosystem.
BVS Registry
The BVS Registry is a central record-keeping contract for all Operators and Services within the SatLayer ecosystem. It serves as a directory where Operators and Services can register themselves and establish mutual relationships. For on-chain services, the Operator can be queried and asserted to determine if it is validating a Service.
Example for registering a BVS service:
Rust (CosmWasm)
We register the service during the contract constructor, but it can be executed at any time in the contract lifecycle.
contract BVS is Ownable {
SLAYRegistry private _SLAYRegistry;
SLAYRouter private _SLAYRouter;
constructor(SLAYRegistry SLAYRegistry_, SLAYRouter SLAYRouter_, address owner) Ownable(owner) {
_SLAYRegistry = SLAYRegistry_;
_SLAYRouter = slayRouter_;
SLAYRegistry_.registerAsService(
"https://www.myservice.com", "My Service"
);
}
}
BVS Router
The BVS Router is a central contract that manages the interaction between vaults and other contracts in the SatLayer ecosystem. As a BVS, the Vault Router coordinates the programmable slashing of vaults, serving as the execution layer for the slashing logic.
High-level example for initializing a slash request:
Rust (CosmWasm)
The requestSlashing
function is used to request a slashing of an operator.
This can be called at any time in the contract lifecycle, for example, during a specific event or condition that leads to slashing.
contract BVS is Ownable {
SLAYRegistry private _SLAYRegistry;
SLAYRouter private _SLAYRouter;
function requestSlashing(address operator, uint32 timestamp) external {
ISLAYRouterSlashingV2.Payload memory payload = ISLAYRouterSlashingV2.Payload({
operator: operator,
mbips: 100,
timestamp: timestamp,
reason: "Missing Heartbeat"
});
_SLAYRouter.requestSlashing(payload);
}
}
Next steps
Depending on the type of service you want to build, the next steps are different.