again? What is the improved BOP of the Brc-20 protocol?

avatar
MarsBit
04-27
This article is machine translated
Show original

I have to sigh, "One day in the currency circle, one year in the world" is not for nothing. The speed of innovation in web3 is astonishingly fast. Just two days after the release of the Brc-20 protocol, Hugo, another developer of Hirosystem, was inspired by it and proposed an improved version of the protocol BOP (Bitcoin ordinals protocols, Bitcoin ordinal protocol).

The protocol is also experimental, and the author of the brc-20 protocol also acknowledged it and retweeted it. "Improving the brc20 protocol" is passed down from developer to developer like a baton. (Note: Hiro is an infrastructure to help build smart contracts on the Bitcoin two-layer network stacks)

bitcoin

The origin of BOP

Hugo invented the BOP protocol based on a discussion on the brc-20 protocol. Some people questioned, "Any meaningful homogeneous token protocol should not use JSON format" (if you don't know the format of the brc-20 protocol, you can check "Is it possible to issue coins independently on the BTC chain? Take you to understand the brc-20 protocol" ), the reason is: "As the underlying protocol, we can engrave any byte. Although json improves readability, it also increases The size of the inscription, when the third-party service reads the data, there is no need to consider the readability of the protocol, we need a more lightweight protocol." So, inspired by this, Hugo created the BOP protocol (https://github.com/hugocaillard/bop).

bitcoin

Format of the BOP protocol

The author has made the first version of the draft into an inscription and permanently engraved it on the blockchain, the number is #420142

2575466c50a2137ac12b8cfb55e38609018264cbb9b1b0091c56c8992b7d1917i0

bitcoin

When I saw it at the first glance, I said in my heart: "Good guy, good guy, what is this?", but I could understand it at the second glance, but I didn't fully understand it. Next, let me take everyone to disassemble this agreement step by step. .

bitcoin

#d.0.bft means to declare a token standard with ID 0 and name bft, and future protocols using the same ID number or name will be ignored.

The release standard of the bft protocol is declared from the second line, including three method declarations of deploy, mint and transfer .

First look at method 0: deploy

bitcoin

Next, let's look at method 1: mint

bitcoin

Method 2: transfer

bitcoin

If you have programming experience, you will definitely think of the "function declaration" when you first learn programming. The function declaration means to give the function a name and specify parameters, so that it can be called directly in other places in the program. With "function declaration", there must be "function implementation". The process of calling the bop protocol is called " Call a BOP ", and it must start with "#c". Next, I will use the first code issued by the author The coin "idro" is explained as an example.

deploy idro

#c.0.0, call the 0th method (that is, the deployment method) of the protocol with ID number 0 (that is, the above bft)

0, the ID number of the idro token, and the ID numbers of other tokens will increase

idro, token name

21e12, the total amount of tokens, a total of 21000000000000

[[144,2048]....[1728,1]], which means starting from the deployed block ( block height 780310 ) every 144 blocks, the number of mint is halved each time, starting from 2048, almost It halves every other day.

bitcoin

The following is the token production reduction table, which can calculate the maximum amount of mint each time according to the current block height.

bitcoin

casting idro

The next step is how to cast the most concerned issue, the casting code is very short, just one line

#c.0.1 Call the first method (that is, the casting method) of the protocol with ID number 0 (that is, the above bft)

0, the ID number of the idro token

The quantity is defaulted here, and the maximum quantity will be minted according to the current block height. If you want to specify the quantity, you can add the quantity later, such as casting 10 at a time, "#c.0.1&0,10"

bitcoin

Two other points are particularly noteworthy:

1. When using a third-party minting tool, if it is mint to your own built-in wallet first, and then transferred to your wallet, the balance of the token will be saved in the tool's wallet, so it cannot be used.

2. If two balance change events occur in the same block, the one with the higher fee takes precedence. Therefore, only 1 minting operation can be achieved per block per address. So you can't batch mint with the same wallet

Here is an introduction to how to use the foundry tool unisat developed by our Chinese team:

Enter the URL: https://unisat.io/inscribe Go to the homepage and select "Text"

bitcoin

Select "Single" (single casting, next to batch casting), paste the text " #c.0.1&0 ", click "Next"

bitcoin

Paste your own Taproot wallet address (beginning with bc1p), and then select the appropriate rate, it is recommended to use "Normal" or above.

bitcoin

Scroll down to the payment button and click "submit & pay invoice"

bitcoin

Finally, use your own wallet to pay the corresponding amount of BTC to the specified address.

bitcoin

transfer idro

#c.0.2 Call the second method (that is, the transfer method) of the protocol with ID number 0 (that is, the above bft)

0, the ID number of the idro token

100, the amount of tokens transferred

After the text is minted into an inscription and sent to the address to be transferred.

bitcoin

Compared with ERC20

When it comes to token standards, it is inevitable to mention the token standard erc20 on Ethereum, which was proposed by Fabian Vogelsteller in November 2015, mainly including name, symbol, total supply, account balance and transfer and other methods.

bitcoin

Judging from the current Bop standard, name, ID, maximum supply, minting and transfer methods are all available, account balance and transfer tokens also need an on-chain indexer and a front-end to display, which is already preliminary compared with erc20 Take shape.

Compared with brc20, I think this protocol standard is more like a programming language, more programmable, extensible and composable, and more lightweight. I think this is its progress.

Of course, the author has repeatedly emphasized that this is experimental, and hopes that other developers can continue to optimize on this basis.

Summarize

The homogeneous token agreement on the entire BTC is still in the conceived stage. We have no way to confirm which agreement will be recognized in the end, but what we can do is to follow the development of the ecology until a complete set of solutions emerges. If you have further questions,

Source
Disclaimer: The content above is only the author's opinion which does not represent any position of Followin, and is not intended as, and shall not be understood or construed as, investment advice from Followin.
Like
3
Add to Favorites
3
Comments