BRC-42: A Cross-Chain Standard For BRC-20 Tokens
Proposal for a fully decentralized protocol to bridge BRC-20 and similar tokens to other chains
Version 0.1 - May 11th 2023
Introduction
This proposal outlines an extension to the BRC-20 standard that allows bridging BRC-20 tokens to chains with smart contract support, such as Ethereum, Interlay, Solana, Polkadot, etc.
The proposed method does not require trust in any 3rd party.
While the proposed protocol is specified for BRC-20 tokens, it can be extended to support any other token standard that is built on top of Bitcoin, including inscriptions, colored coins, and Taro.
Technical Requirements
Custom indexer that validates the BRC-20 cross-chain "bridge-out" and "bridge-in" operations on Bitcoin, as well as the contract state on the destination chain. Indexers track the total amount of "bridged out" tokens for each tracked BRC-20 token.
Destination chain contract that handles bridge-out and bridge-in operations on the destination chain.
BTC-Relay: a BTC-light client implemented as a smart contract on the destination chain, capable of verifying the mainchain inclusion of BTC transactions and parsing them. See e.g. here for a specification, here for a PoC implementation on Ethereum, and here for an audited production implementation in Rust on Interlay.
Use Cases
The main use case for BRC-20 tokens is to unlock access to decentralized financial protocols. Trading on decentralized AMMs, using them as collateral in lending protocols, creating auctions, etc.
Building decentralized financial primitives is difficult on Bitcoin and often limited to very basic products like atomic swaps. Allowing BRC-20s to be used on other chains that have smart contract support and advanced DeFi ecosystems can be beneficial for the growth of BRC-20s and future experiments.
Definitions
CHAIN
: the destination chain, e.g. Ethereum or InterlayCOIN
: BRC-20 token, to be minted on the destination chainwCOIN
: "wrapped" representation of the BRC-20 token on the destination chain, e.g. an ERC-20 token on EthereumCONTRACT
: smart contact on CHAIN that handles mint and redeem operations ofwCOIN
onCHAIN
BTC-RELAY
: smart contract on CHAIN that is capable of verifying the Bitcoin main chain (incl. difficulty adjustments), verifying transaction inclusion, and parsing transaction data (specifically, extracting the BRC-20 witness data from P2TR transactions).
Protocol
This proposal introduces two new operations to the BRC-20 standard:
Bridge-out: burns
COIN
BRC-20 tokens on Bitcoin and mints the equivalent amount on the destination chainCHAIN
.Bridge-in: burns
wCOIN
wrapped BRC-20 tokens on the destination chainCHAIN
and mints the equivalent amount ofCOIN
tokens on Bitcoin
No changes are needed to the deploy, mint, and transfer operations.
Deploy on destination chain
The deployment procedure depends on the implementation of the source chain. Requirements of the CONTRACT
smart contract are:
Mint
wCOIN
tokens if and only if a valid transaction inclusion proof was received for a "bridge-out" operation of XCOIN
tokens on Bitcoin. UseBTC-RELAY
to verify and validate (i.e. parse) the corresponding Bitcoin transaction.
This assumes a BTC-RELAY
contract is already deployed on CHAIN
or that CHAIN
has built-in Bitcoin light client functionality. For requirements, see here.
Bridge-out
Locks ("bridges-out") X COIN
BRC-20 tokens on Bitcoin and mints X wCOIN
on CHAIN
.
The "bridge-out" operation is defined as follows:
Inscribe “bridge-out” operation on Bitcoin, specifying
amt
,dest
andacc
.Submit BTC transaction and transaction inclusion proof ("SPV proof") to
CONTRACT
which in turn callsBTC-RELAY
to complete the verification.If
BTC-Relay
returns "true" (i.e., the transaction is verifiably included in the Bitcoin main chain), theCONTRACT
mints XwCOIN
to the account specified in theacc
field, and emits a "Mint" event.
Indexer behavior
Indexers MUST verify that the "Mint" event emitted by the
CONTRACT
onCHAIN
matches theamt
,dest
, andacc
fields of the bridge-out operationIndexers MUST mark the X
COIN
tokens as "bridged-out" and increase the total amount ofCOIN
BRC-20 tokens marked as "bridged-out" by XIndexers MUST NOT allow transfer (or any other) operations of BRC-20 tokens marked as "bridged-out"
Consideration for future versions of BRC-20 tokens: Indexers MUST NOT remove the X
COIN
tokens from the total supply ofCOIN
Bridge-in
Burns X wCOIN
tokens on CHAIN
and mints ("bridges-in") X COIN
BRC-20 tokens on Bitcoin - if and only if X is less or equal to the total amount of COIN
tokens tracked as "bridged-out".
The "bridge-out" operation is defined as follows:
Inscribe “bridge-in” operation on Bitcoin, specifying
amt
anddest
.Lock X
wCOIN
tokens on in theCONTRACT
onCHAIN
and pass the inscription or transaction ID of the transaction containing the "bridge-in" operation performed in step (1). TheCONTRACT
verifies that X =amt
. If correct, emits a "bridge-in" event and burns thewCOIN
tokens at the end of the operation, removing them from circulation.
Indexer behavior
Indexers MUST verify that the event emitted by the
CONTRACT
onCHAIN
matches theamt
andsrc
fields of the bridge-in operationsIndexers MUST set the
COIN
balance of the address associated with the bridge-in txid to XIndexers MUST reduce the tracked total amount of "bridged-out"
COIN
tokens by X
Changelog
May 11th 2023 23:50 UTC: version 0.1 completed
Last updated