Long Push: How to Create a BRC Protocol Using ChatGPT

Original Author: ACE

Original Source: Twitter

Note: This article comes from @CKN_ACEE’s Twitter, who is the founder of @Cardanokn. The original tweet content is summarized below by MarsBit:

How I Created a BRC Protocol with ChatGPT

First, I had an idea. If we imagine BRC-20 as a ledger and the index as a shopkeeper, can we play around with it as long as the shopkeeper can handle it? So, I came up with an unstaked pledge protocol: let iterations of inscriptions replace the rotation of time.


Step one, I plan to feed GPT with the function writing of ORC-20, let it learn first. Of course, it learns quickly and understands thoroughly, but I don’t need such a complicated interpretation, so I let it keep the simplest function.

Step two, I split my ideas with GPT, 1. Deployment 2. Staking 3. Unstaking 4. Claiming Rewards 5. Transfer; At first, it still didn’t quite understand such simple functions, but after I trained it a bit, it gave me the following function, which is a fusion of deployment and pledge contracts.

Step three, this is a protocol created for an NFT collection, so it needs to include multiple inscription IDs, and this is the answer it gave me, which I was very satisfied with and praised it.

Step four, I started discussing the staking operation with it, and I let it try it out first, see if it’s smart enough. But because the information I gave it was limited, and I didn’t have time to explain the rules of ordinal numbers, I forgave it and made corrections.

As we discussed, GPT became closer and closer to the correct answer. We then looked at how it solved the problem of unstaking. At this point, I gave it the most interesting concept: the number of inscriptions is time.

We had a dispute about how to determine the identity of the pledger. But it was quickly resolved; because I asked the technical guru @aowu2048, the index can parse the sender’s wallet, so naturally we can save the address step in the function: this is the final simplified result:


“p”: “brc-721k”,

“tick”: “KNGT”,

“op”: “stake”,

“asset_id”: “e5ea…527e”


Canceling the pledge is the same:


“p”: “brc-721k”,

“tick”: “KNGT”,

“op”: “unstake”,

“asset_id”: “e5eaf….3fa0i0”


Step 5, I want to use a function to express receiving rewards and this inscription can be used as a token directly (saving one gas); this is the result he gave me for the first time, obviously he is confused now, so I gave him two requirements: 1. Receive rewards 2. Record the amount of rewards received

Okay, he’s still fooling me, giving me a value that I don’t know where it came from, which is definitely not what I want; because the user can calculate the amount of income by himself at this point, that is: the deployed inscription number of stake (assuming it is 1000) – the inscription number of unstake (assuming it is 3000) x reward ratio (assuming it is 1.2), the index is responsible for checking.

After a simple training, he gave me a satisfactory answer, doesn’t it look stupid?

But this is really all we need

The most important deployment, pledge and reward collection have been written; I tried to let him briefly review whether there are any logical problems; the result is useless; so we do the last step: transfer

At this step, you gave me a very comprehensive answer, but as mentioned before, indexing can solve the problem of address verification. The final answer is as follows:


“p”: “orc-20”,

“tick”: “orc”,

“op”: “transfer”,

“amount”: “amount”


Alright, let’s summarize:

This protocol provides a set of functions for deploying tokens, executing staking, unstaking, claiming rewards, and transfer operations. We proposed a very interesting concept: replacing the concept of time with the quantity of inscriptions, successfully solving the problem of inaccurate calculation of staking length on the brc-20 protocol. This is also very retro and interesting, and the number of inscriptions during the staking period will increase profits.

Note: All articles blocked only represent the author’s point of view and do not constitute investment advice
Original link: https://www.bitpush.news/articles/4458202

Like what you're reading? Subscribe to our top stories.

We will continue to update Gambling Chain; if you have any questions or suggestions, please contact us!

Follow us on Twitter, Facebook, YouTube, and TikTok.


Was this article helpful?

93 out of 132 found this helpful

Gambling Chain Logo
Digital Asset Investment
Real world, Metaverse and Network.
Build Daos that bring Decentralized finance to more and more persons Who love Web3.
Website and other Media Daos

Products used

GC Wallet

Send targeted currencies to the right people at the right time.