BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

How to Introduce Bitcoin into Ethereum in a Decentralized Way: Understanding tBTC Asset Cross-Chain Solution and Vulnerability Remediation

Winkrypto
特邀专栏作者
This article is about 5258 words, reading the full article takes about 8 minutes
How does tBTC achieve cross-chain Bitcoin assets in a safe and decentralized manner? How are the vulnerabilities after the mainnet launch are fixed?
AI Summary
Expand
How does tBTC achieve cross-chain Bitcoin assets in a safe and decentralized manner? How are the vulnerabilities after the mainnet launch are fixed?

Editor's Note: This article comes fromChain News ChainNews (ID: chainnewscom), Author: Pan Zhixiong, Lianwen Research Director, published with authorization.

Editor's Note: This article comes from

Chain News ChainNews (ID: chainnewscom)

Chain News ChainNews (ID: chainnewscom)

  • , Author: Pan Zhixiong, Lianwen Research Director, published with authorization.

  • Among the solutions to achieve cross-chain Bitcoin assets through decentralization, tBTC is the most attention-grabbing project in the near future. When BTC can migrate to the Ethereum network safely and without trust, it means that BTC can enjoy Turing's complete smart contracts, and there is more room for imagination. For example, in this way, Bitcoin assets can be applied in the decentralized finance (DeFi) ecosystem-after all, Bitcoin has the most users, the highest market value, and the most significant network effect.

  • tBTC is a sub-project developed by Keep Network, a subsidiary of Thesis, which is even a bit like an experimental project launched by them "out of business". Originally, Keep Network was a solution to provide a privacy layer for Ethereum, using off-chain containers to store private data; while tBTC is a Bitcoin cross-chain solution, which sounds like it has nothing to do with the direction of Keep itself. However, there are still some intersections between the two, such as the use of the same token KEEP and multi-signature mechanism.

In addition, Summa and Cross-Chain Group are also participants in the tBTC project. According to the introduction, these partners are divided as follows:

Keep uses the ECDSA threshold signature in the logic of Bitcoin decentralized custody, and the native token of tBTC uses KEEP;

Summa focuses on cross-chain solutions, which is the part of the tBTC protocol responsible for how to verify Bitcoin transactions in the Ethereum blockchain (SPV solution);

Cross-Chain Group is responsible for the research, design and implementation of cross-chain technology.

Keep's investors include several mainstream institutions in the United States, such as Polychain Capital, a16z, Draper Associates, Fabric Ventures, Distributed Capital Partners, etc. Among them, a16z is also an investor in a number of DeFi protocols, including the stablecoin protocol Maker, the lending protocol Compound, and the trading protocol dYdX. These three are also the top projects in the current DeFi protocol. If they can integrate tBTC in the future, it may be a win-win situation Strategy: Bitcoin can support DeFi, and DeFi can use Bitcoin.

  • Projects currently integrating tBTC

  • Before tBTC, most of the cross-chain solutions of encrypted assets, especially Bitcoin assets, were realized through the custody of centralized institutions, such as WBTC, imBTC or HBTC. Although these solutions also take security and transparency into consideration, for the cryptocurrency community, people want a completely decentralized, non-custodial, no barriers to entry, and permissionless asset cross-chain infrastructure. After all, it is a very basic right to move assets from one place to another, and other factors should not be involved, additional risks should not be added, and privacy should not be sacrificed.

Overall, the two most important advantages of tBTC are:

Mortgage by original assets: Since tBTC generates equivalent TBTC tokens across chains by pledging Bitcoin, no additional Bitcoin will be generated. On the contrary, asset synthesis protocols such as Synthetix use other tokens to mint tokens sBTC that "simulate" the value of Bitcoin, which actually increases the circulation of Bitcoin.

Hosted by a decentralized protocol: Bitcoin assets in the tBTC protocol are hosted by a decentralized protocol, and a series of security mechanisms are also set up to ensure that the entire process cannot be malicious.

From the above two perspectives, current projects similar to tBTC can be classified as follows:

first level title

How does tBTC work?

Like the various mechanisms designed by the stablecoin protocol Maker to maintain prices, tBTC also takes into account various special situations that may bring about system security in the entire plan. If these modules are explained one by one or supplemented with cases Description, possibly the length of a paper, or as much as a white paper.

After all, for most tBTC systems or users of TBTC tokens, there is no need to be exposed to so many complicated logics. Only deep participants in the system or traders of native tokens should thoroughly understand the operating mechanism of the entire system. Even if it takes time, you need to read their white paper carefully.

  • However, before that, this article can also be used as an introductory manual for understanding tBTC, so as to quickly establish the concept of the tBTC protocol and the core workflow of system operation. In short, the main answer here is this question: Why can tBTC cross-chain assets in a safe and decentralized manner?

  • First a few clarifications and explanations:

  • In the tBTC scheme, these parties are involved:

BTC ->Depositor: a user who wants to transfer BTC to Ethereum;

Verifier/signer: a user who maintains the security of the tBTC network and earns income;

  1. Redeemer: A user who wants to exchange TBTC on Ethereum for real BTC.

  2. secondary title

TBTC Casting Process

For the asset cross-chain solution of Bitcoin and Ethereum, two main challenges are:

How can the user ensure that the mortgaged assets will not be stolen: the solution chosen by tBTC is to store the assets in a multi-signature address co-custodial by 3 people (technology implemented by Keep), no one person can move the assets, and the mortgage needs to be exceeded assets.

How to confirm Bitcoin transactions and ownership on the Ethereum chain: tBTC uses the SPV (Simple Payment Verification) technology designed by Summa to achieve cross-chain transaction verification.

Therefore, the process of switching from BTC to TBTC is divided into two steps:

2. After transferring to the 6 blocks of the Bitcoin custody address, the depositor submits the proof of the completed transfer to the protocol, and then the corresponding amount of TBTC can be minted.

BTC ->A brief introduction to TDT: In order to record the different custodial quantities or time of different depositors, the tBTC system will also issue a non-homogeneous token (NFT) before minting TBTC, called TDT (tBTC Deposit Token). Although it is called a token, it is actually similar to a "certificate", which is indivisible and unique. This certificate is required for subsequent redemption of BTC.

Of course, other possible problems and corresponding handling methods need to be considered in the design of the protocol. The most common one is that if the value of ETH depreciates compared to the value of BTC, the verifier may have insufficient collateral, which will cause the verifier to have motivation Doing evil, so tBTC has designed a corresponding liquidation module to deal with it.

The tBTC protocol includes two stages of pre-liquidation and compulsory liquidation. Similar to the design goals of other liquidation systems, the auction process will be launched in the compulsory liquidation stage, and ETH will be auctioned to TBTC holders at a discounted price to guarantee the collateral ETH The value is greater than the value of TBTC (that is, BTC). And if there are remaining funds after liquidation, the income distribution will be carried out according to different situations.

TBTC redemption process

The redemption process is relatively simple. When users want to exchange their TBTC back to BTC, they only need to submit TBTC and a small "fee" to the Ethereum smart contract, and attach the received Bitcoin address, the three verifiers must jointly sign a transaction on the Bitcoin chain and transfer the BTC to the specified address. What if some verifiers do not cooperate? The mortgaged ETH can only be liquidated.

It is also because validators provide joint custody services and pay ETH mortgage assets, so redeemers need to pay them a small additional fee as an economic incentive.

Therefore, as a validator, the tBTC system can be used as an asset management tool with stable income. According to the calculation of the white paper, the annualized income of validators is about 1.875%. Considering the mortgage rate of 150%, the real annualized income is about 1.25%. This is where many people in the community complain about tBTC: Many people believe that the current low rate of return may lead to insufficient motivation for validators to participate. Of course, this also means that the current parameter settings are more friendly to depositors and redeemers.

KEEP Token: Pay for the Work

In the tBTC system, the native token KEEP is a working token, which means that holding KEEP cannot bring any benefits, but only by working hard while holding KEEP can you get benefits.

Looking back at the link of minting TBTC, in "step 2", the tBTC system needs to draw three of them from the pool containing a group of validators. What is the basis for the extraction? That's right, it is based on the KEEP token holdings. For example, the person holding 1000 KEEP is ten times more likely to be drawn than the person holding 100 KEEP, that is, if placed in a long time span, the former will work ten times as much as the latter. times.

Holding more KEEP means that validators can participate more in custody of BTC, and have the opportunity to obtain more potential benefits.

  • first level title

  • What happened to the bug that was discovered two days after it was launched?

  • Two days after tBTC went online, the official discovered a serious problem with the protocol, so they pressed the previously reserved global switch and suspended the recharge function of the entire system for 10 days.

Before that, we need to introduce a background knowledge. During the development of Bitcoin for more than 10 years, with the evolution of technology, various address types have been born, which are generated by different types of scripts:

The initial Bitcoin address starts with "1", and this type of script is called P2PKH (Pay to Public Key Hash);

Later, addresses starting with "3" were born. This type of script is called P2SH (Pay to Script Hash), which is more powerful, supports multi-signatures, and can be combined with later isolated witnesses;

Finally, the original segregated witness address was born, starting with "bc1". This type of script is called P2WPKH (Pay To Witness Public Key Hash), and it will also be called Bech32.

Initially, when tBTC was designing the protocol, the address that limited and mandated the redemption must be P2WPKH (beginning with bc1). But in February of this year, the engineering director of tBTC submitted a change to relax this restriction, that is, support scripts other than P2WPKH (starting with 1 or 3).

However, this does not necessarily cause problems. The testing process set up in software development is to detect such problems early, but they said that the "non-P2WPKH" script was not covered in the test cases. Although the P2SH address (beginning with 3) was finally tested in the test network, the team mistakenly believed that the test passed due to the front-end loopholes in the redemption DApp process.

The whole process of undiscovered problems is:

Only P2WPKH addresses are supported in the design of the tBTC protocol —> temporarily decided to relax the restrictions on P2WPKH —> but the system has not been adjusted accordingly —> test cases are not covered —> other functional loopholes lead to the mistaken belief that the test has passed.

These problems piled up, causing tBTC to go online with vulnerabilities.

first level title

How to improve in the future?

In the review report of the incident, the tBTC project stated that they will optimize their workflow and will also cooperate with the security team Trail of Bits to plan more automated integration tests and system tests for tBTC.

To add, in the software development process, before an official version is released, several versions are usually released called "Release candidates". If no vulnerabilities are found, the last Release candidates (RC) will be released. It will become the final official version. For example, the next major version of Bitcoin, 0.20.0, has released two RC versions.

tBTC believes that another mechanism that can effectively reduce project risk is to limit the capacity of the entire system. That is, they limit the maximum amount of BTC that can be exchanged for TBTC, so that even if there is a serious problem, the loss is the Bitcoin or Ethereum within the controllable range.

Specifically, in the RC1 version, the system capacity for the first month is set at 100 BTC, and then increases monthly, respectively 250 BTC, 750 BTC, and 1000 BTC. These logics are also preset according to the smart contract Execute it. After 5 months, the restriction will be automatically lifted, and if there is no accident after 12 months, the team will disable the emergency pause button, which is the reserved "back door" that protects the system from further losses this time.

Finally, tBTC also stated that in addition to the security audits of ConsenSys and Trail of Bits, it will organize a third security audit, specifically for the part involving BTC transactions and cross-chain communication. At the same time, tBTC also increased the maximum reward of the bug bounty program by 10 times to 1 million KEEP tokens.

Incentivize Initialized Liquidity: "Staking Airdrop"

Considering that many potential validators may not have KEEP tokens for the time being, tBTC launched a 6 to 12-month "Stakedrop" campaign to provide additional incentives for the project and promote project initialization and liquidity.

During the event, 20% of the total amount of KEEP tokens will be distributed. During the period, users can only rely on pledged ETH to become validators of the tBTC network and provide decentralized custody services for cross-chain assets. After the event, they will follow the previous plan. The KEEP token is used as the basis for the lottery.

Therefore, for validators, during this period, they will receive KEEP token rewards in addition to the 1.25% annualized rate of return, and the amount should refer to the specific performance of participating in the tBTC network, and more details will be announced later.

first level title

ETH
BTC
Welcome to Join Odaily Official Community