Bridging BTC into DeFi without Intermediaries
The supply of tokenized Bitcoin on Ethereum relayed through centralized, trusted bridges now tops $1.1B. While the demand for Bitcoin in DeFi is expected to grow, a better solution without counterparty risk for bridging is needed. This post will introduce the technical components of the trustless, one-way bridge operated by Strudel.
Strudel Bridge Design
When BTC is requested to be transferred using the Strudel Dapp, a transaction output with the transfer amount and the receiving Ethereum wallet address is created. This output is handed to the user’s Bitcoin wallet through the QR code. When a user signs a transfer the resulting transaction might look something like this.
Next, the header of the Bitcoin block containing the transaction needs to be registered in the relayer contract on Ethereum, where its proof-of-work is verified and the canonical chain is extended. Simple payment verification (SPV), a protocol used by Bitcoin light clients and wallets, prevents invalid blocks from entering the relayer.
Once the transaction containing the burn has been buried under enough proof of work (6 blocks), an inclusion proof is relayed onto Ethereum. The proof is verified by the Strudel contract which mints vBTC in a ratio of 1:1 to the designated Ethereum address. The protocol strictly mints 1 vBTC for 1 burned BTC, not taking any fees for bridge crossings.
Future Burn Methods
OP_RETURN is a clean way to burn BTC, where outputs are removed from the memory of Bitcoin nodes and don’t pollute the state. Unfortunately, only few Bitcoin wallets support the payment protocol (BIP70), which is the only way to construct transactions with OP_RETURN outputs.
For those users that want to burn with a BIP70-incompatible wallet, a fallback will be provided soon. The Ethereum address will be injected into a P2SH (pay to script-hash) output instead of a valid script, creating a P2FSH (pay to fake script-hash) output. While P2FSH outputs can never be spent, the Strudel protocol can use the data embedded in them to mint vBTC to designated addresses.
Burns by P2FSH outputs can only be picked up by the same account as encoded in the output. The account has to be msg.sender
of the relay transaction as seen by the vBTC contract.
Relayer Contract
The relayer contract is the heart of the bridge architecture. It is able to verify new block headers of the Bitcoin blockchain and construct a canonical chain. It acts as an on-chain implementation of a Bitcoin light client.
The Strudel team is very thankful to our friends at Summa for creating and operating the first version of such a contract. Our bridge wouldn’t be possible without the function and data that the contract provides. We want to support the operation of the contract through relayer rewards. Currently, 3 different functions of the contract are proxied by the vBTC contract and pay out rewards for valid header relays.
Opening Bitcoin to DeFi
Current Bitcoin holders have no way to let the capital in their wallets work for them — to hodl is the only way. By equipping BTC with the ERC20 interface and smart-contract interoperability it becomes more versatile - it becomes vBTC. The future for Bitcoin on the DeFi space is bright, as its supply can be locked into protocols for lending, options, and other DeFi use-cases, reducing its volatility and potentially increasing market value.
vBTC upgrades BTC with another tool to hold its ground in Blockchain finance — flash loans. Flash loans are instant uncollateralized loans for the duration of only one transaction. While other tokens need to be pooled, before they can be flash-loaned, every vBTC holder has the ability to borrow up to 21,000,000 vBTC at any time — this feature is also used in our pegging algorithm.
Strudel Reads
📖 Have a look at our one-page manifesto: https://medium.com/@strudelfinance/strudel-manifesto-580759f9634b