π©Lockers - decentralized custodians
Last updated
Last updated
Lockers are decentralized custodians of the TeleSwap protocol who manage Bitcoin assets and process unwrap requests. They are introduced because Bitcoin is not programmable, making it impossible to have smart contracts as decentralized custodians. For wrap requests, users send their Bitcoin assets to Lockers. Unwrap requests are also assigned to Lockers for processing.
Anyone can become a Locker by registering itself in the TeleSwap contract and running the Locker script on a server. Registration requires locking collateral. There is a slashing mechanism in place that forces Lockers to behave honestly; otherwise, their locked collateral will be slashed.
The main incentive to become a Locker in TeleSwap is to earn fees from every bridge request. For every request assigned to a Locker, 0.15% of the bridge amount goes to the Locker. This compensation rewards Lockers for their service and their locked collateral. As the demand for bridging Bitcoin assets increases, Lockers have an incentive to provide more collateral to increase the system's capacity.
To move Bitcoin assets from Bitcoin to EVM chains, users select one of the registered Lockers and send their Bitcoin assets to it. The Locker that receives the assets is responsible for keeping the Bitcoin assets safe. If they lose assets due to hacking or theft, they will get slashed.
Users choose Lockers based on the amount they want to move to EVM chains, the amount that the Locker already manages, and the locked collateral of Lockers. The amount that a Locker already manages and the amount of locked collateral determine the Locker's capacity. If the Locker's capacity is greater than the user's bridge amount, it is safe to send the assets to the Locker. A Locker with a higher capacity also provides better security for users as it has more collateral to back Bitcoin assets.
Locker capacity is used by users to determine if it's secure to wrap their Bitcoin assets to EVMs by sending them to a specific Locker. If the Locker capacity is more than the value of Bitcoin assets users want to send to it, then it is safe to proceed. Otherwise, users should choose the lower amount or wait for the Locker to lock extra collateral and then proceed. To find the Locker capacity, we use the formula below:
Where:
LockedCollateralValue is the value of the locked collateral of the Locker.
CollateralRatio is a ratio used to ensure that the value of locked collateral is always a multiple of the Bitcoin assets. This ensures that in case of price fluctuations, the collateral value doesnβt fall below the value of the Bitcoin assets.
BitcoinAssetsValue is the value of all Bitcoin assets currently managed by the Locker.
To redeem native Bitcoin assets by unwrapping wrapped assets, users select one of the registered Lockers to process their request. The assigned Locker is then responsible for sending the requested native assets to the user and providing proof of payment to the smart contract. If they donβt process the request on time, they will get slashed.
Here, users choose a Locker for their unwrap request based on Lockers' managed Bitcoin assets. The Locker should have enough native assets to send to the user. If there is no single Locker that can process the userβs requested amount, the user needs to break down the request into multiple requests and ask multiple Lockers to send her the native Bitcoin assets. Note that the accounting for how much Bitcoin assets are held by a Locker is kept by the TeleSwap contract, so the contract can determine whether to assign a request to a Locker or not.
By processing unwrap requests, the managed Bitcoin assets of a Locker decrease, which increases the Locker's capacity to process further wrap requests.