An analyse of a liquidation of tBTC system on mainnet

Mitu Tan
4 min readOct 14, 2020

tBTC is a trustlessly Bitcoin-backed ERC-20 token. Users lock BTC and mint tBTC on Ethereum. The lock process involves sending BTC to a generated multisign BTC address(signers are responsible for generating the BTC address and charge fees for their services). In order to make signers behave well a bond(similar like a collateral) is required to be a signer. Currently the bond assets are ETH. If signers don’t behave well their bonded ETH faces a risk of liquidation which is used to compensate users.

In this article we will review the liquidation process of the tBTC system with a true case on mainnet.

First, go to allthekeeps deposits page and click the downtrend arrow(shown in figure 1). Then you can filter deposits with what you’d like to see. Choose Liquidations & Signer Misbehaviour and you will see all liquidations. There are a total of 4 liquidations by now.

Fig1. Filter Liquidations at allthekeeps

Next we will choose the first liquidation happening on Sep-25–2020. Click the contract address below and we can see details of this liquidation. Lot size means the amount users deposit BTC. In this case the user(we will call him depositor below) deposited 10 BTC. The liquidated state means the node operators who signed this deposit((so they are also called signers) ) were liquidated(simply speaking their bonded ETH is liquidated). Signer Timeout means the liquidation was caused because some signers didn’t respond when the depositor applied for redeeming his BTC.

Fig2. All liquidations

Let’s jump to the log. From the log we can see that the liquidation started because signer timeout and the transaction is below:

https://etherscan.io/tx/0x5871064ddf0a753611e4f9f8c7c507e102be3d494b0a2039186768bd99fae8de

Fig3 The First Liquidation Detail Page

From this transaction a user 0xe52e…4e6a(we call him 0xe52e below) called the deposit contract’s notifyRedemptionSignatureTimedOut function to trigger the liquidation.It means 0xe52e found some signers didn’t respond in time. Then you may ask what’s the max time a signer can respond. This is defined at TBTCConstants.sol:

uint256 public constant REDEMPTION_SIGNATURE_TIMEOUT = 2 * 60 * 60; // seconds

It means the max time is 2 hours. So a depositor applied for redemption at Sep-25–2020 10:08:00 AM +UTC and after 2 hours signers still didn’t generate a signature. Then 0xe52e found this and triggered the liquidation at Sep-25–2020 03:15:26 PM +UTC(actually 5 hours passed when someone noticed this).

After the deposit contract received a call from 0xe52e, it called keepbonding contract and received 155.376009944*3 ETH from keepbonding contract. It’s the amount 3 signers bonded(each bonded 155.376009944 ETH) for this signature. Again 0xe52e called the deposit contract’s purchaseSignerBondsAtAuction() function to trigger the auction. It means in order to compensate the depositor the tBTC system conducted an auction to purchase TBTC selling signers’ bonded ETH. From this transaction we can find that 0xe52e paid 10 TBTC to the depositor and the deposit contract paid 0.005 TBTC to the depositor and the deposit contract returned 26.41392169048*3 ETH to the keepbonding contract. Let’s recall that the deposit contractor received 155.376009944*3 ETH from the keepbonding contract and returned 26.41392169048*3 ETH. Where’s the left 386.88626476056 ETH then? Of course it went to 0xe52e and he bought those with 10 TBTC. We can find he withdrew those ETH with this transaction. Until now a liquidation finished. Now let’s describe this process with a sheet.

Transactions
Balances

Someone may wonder why the depositor got more 0.005TBTC. That’s because when the depositor mint TBTC he chose a FRT. From the tBTC specification,this token grants the right to a fee rebate(lot size * 0.0005) if and when the pre-term deposit is redeemed by another party. So the depositor got 10*0.0005=0.005TBTC as a fee rebate.

We illustrate the process of liquidations caused by RedemptionSignatureTimedOut and all 4 liquidations are caused by the same reason. This tells us when you run an ECDSA node it’s important to keep online. It’s good for both you and your signers group. Also besides this kind of liquidation there are still other kinds which haven’t happened at mainnet. For more risks analysis,please visit:

Official tBTC specification:

ssh’s analysis:

state’s analysis:

--

--