β¦οΈBRC20
The BRC20 token standard is a regulatory framework for token issuance and management based on the Bitcoin Request for Comment (abbreviated as BRC). It aims to provide a token design pattern in the BRC blockchain ecosystem similar to the ERC20 standard. By defining a set of precise rules and program interfaces (APIs), the BRC20 standard ensures that tokens issued on the Bitcoin blockchain can be compatible with other tokens, thereby promoting liquidity and efficiency in token transactions.
BRC20 tokens are not limited to being digital assets used as a medium of exchange; they are also designed to support a variety of applications within the blockchain network, including but not limited to cross-chain transactions, token staking, and lending mechanisms in DeFi. Furthermore, the BRC20 standard aims to promote innovation within the developer community by providing standardized token contract templates to lower the barrier to development, accelerating the deployment and promotion of new applications.
The BRC20 protocol originates from the Ordinals protocol, aiming to integrate a comprehensive feature set similar to ERC20 Tokens into the output scripts of Bitcoin. As shown in the diagram, information related to BRC20 tokens is embedded into the segregated witness script data of Bitcoin transactions. The BRC20 protocol first implemented the writing of BRC20 standard methods on the Bitcoin network, including key functions such as "deployment," "minting," and "transfer."
In the "deployment" phase, the BRC20 specifies the token's metadata, total supply, and the limit of each issuance. When users mint new BRC20 tokens, they need to write data such as the token quantity into the script by sending a transaction.
To transfer tokens, users first need to initiate a transaction, recording the consolidated result of the token quantity into the Bitcoin script, known as "engraving," and then send a second transaction, transferring the consolidated balance to a designated address, also recorded in the script. The completion of these two transactions signifies the completion of the transfer.
Understanding the three core components of the first layer of the Bitcoin protocol is crucial for mastering BRC20: the protocol defines the rules for writing data on the Bitcoin network; indexers provide the function to query and parse these data; the ledger records the token balance and processes transfer transactions.
For BRC20, index servers need to first identify each BRC20 deployment action to read the token information, a process known as "indexing."
Due to the balance of BRC20 tokens being directly embedded into Bitcoin scripts, the Bitcoin network itself cannot directly recognize this balance data. Therefore, BRC20 index servers must build a ledger locally to record BRC20 balances. Whenever a transfer operation occurs, the system must refer to this local ledger to verify whether the transaction is feasible (i.e., if there is a sufficient token balance) and update the ledger accordingly.
The BRC20 token system, developed based on the Ordinals protocol, requires each transfer to be completed by sending two transactions: first, querying and calculating the account balance in the local ledger, then executing the transfer operation.
The Ordinals protocol was originally designed for NFTs. The complexity of handling transfer operations in BRC20, improved based on Ordinals, grows recursively. BRC20 indexers not only play the role of indexing but are also responsible for maintaining a ledger completely independent of the Bitcoin network. Indexers must precisely record each balance change to ensure the integrity and accuracy of the ledger.
Over time, the ledger data maintained by indexers will accumulate, putting enormous pressure on nodes and servers. If indexer nodes stop serving, the use of BRC20 tokens will encounter difficulties.
Fortunately, Unisat had open-sourced the code for indexer nodes. With the joint efforts of several technical teams, including OKX Wallet, the infrastructure and robustness of BRC20 have been significantly strengthened.
Nonetheless, the decentralization of the BRC20 ledger remains an urgent problem to solve. A decentralized ledger is essentially equivalent to creating a new chain. Therefore, achieving a decentralized ledger for BRC20 is an inevitable trend in its development.
Last updated