📬BRC20-S Proposal

Summary

We have introduced BRC20-S, an extended version of the BRC-20 proposal (a fungible token standard made explicitly for the Bitcoin blockchain) that incorporates BRC-20 design principles while introducing functionalities for staking operations such as depositing, minting, and withdrawing. This proposal introduces a staking mechanism within the Bitcoin network specifically tailored for BRC-20 tokens or Bitcoin.

With the introduction of BRC20-S, users can now stake their own BRC-20 tokens or bitcoin and receive BRC20-S tokens in return. BRC20-S tokens are an extension of the functionality of BRC-20 tokens, with an added description of the staking protocol. In this way, BRC-20 token holders can be rewarded for putting their digital assets to work, demonstrating their commitment to the community, and participating in the Bitcoin network.

BRC20-S protocol is open-source and available for all developers to build upon.

Motivation

The introduction of BRC20-S and its staking functionalities provide BRC-20 token holders and projects with expanded design space and additional opportunities to engage with their communities.

By implementing BRC20-S, we envision a future where BRC-20 token and Bitcoin holders can do more with their tokens and be rewarded for their commitment towards the ecosystem. This staking mechanism introduces a new dimension to the BRC-20 token ecosystem, fostering greater participation, and a stronger connection between token holders and the underlying blockchain network.

Specifications

User scenarios

Project team

  • Issuing their own BRC20-S tokens by creating a staking pool, gaining seed users

Users

  • Staking BTC earns other BRC20-S like abcd (newly issued BRC20-S token)

  • Staking BRC-20 tokens earns other BRC20-S like abcd (newly issued BRC20-S token)

Interaction flow

Project Party: Carries out the deploy operation, defining the attributes of the staking pool, including the staking token, earned token, mining rate, total mining rewards, and permission for coin holders to engage in multi-mining. Following this operation, the user's deposit operation will be recognized and recorded (following the BRC-20).

User: Executes staking activities such as depositing, minting (claiming), and withdrawing. Users have the freedom to claim their mining rewards at any time by minting earned tokens.

Server: Performs a comprehensive interpretation of the BRC-20 and BRC20-S proposal, providing an open-source interface for profit calculation. The staking profits for any user are consistently computed using both the backend and open-source tools, ensuring uniformity across all calculations.

Instruction

Operations

  1. Deploy brc20-s pool

// case 1: 
{
  "p": "brc20-s",
  "op": "deploy",
  "t": "pool",
  "pid": "f7c515d6b7#01",
  "stake": "btc",
  "earn": "abcd",
  "erate": "10",
  "dmax": "21000000",
  "total": "21000000",
  "only": "1",
  "dec": 18
}

// case 2: 
{
  "p": "brc20-s",
  "op": "deploy",
  "t": "fixed",
  "pid": "f7c515d6b7#01",
  "stake": "btc",
  "earn": "abcd",
  "erate": "10",
  "dmax": "12000000",
  "total": "21000000",
  "only": "1",
  "dec": 18
}
{
  "p": "brc20-s",
  "op": "deploy",
  "t": "pool",
  "pid": "f7c515d6b7#02",
  "stake": "ordi",
  "earn": "abcd",
  "erate": "100",
  "dmax": "9000000",
  "total": "21000000",
  "only": "1",
  "dec": 18
}

User can choose whether to put all BRC20-S tokens as mining rewards in a single pool.

  • In case 1, the user puts the total supply of abcd tokens (21,000,000) as mining rewards in the f7c515d6b7#01 pool.

  • In case 2, the user puts 12,000,000 abcd tokens as mining rewards in the f7c515d6b7#01 pool and the remaining 9,000,000 abcd tokens in the f7c515d6b7#02 pool.

In order to better understand the erate field, let's take the example of case 2 mentioned above.

  • In the "f7c515d6b7#01" pool, which is of type "fixed", the user's earnings depend on the amount of tokens they have staked. userReward = erate * userStakeAmount.

  • In the "f7c515d6b7#02" pool, which is of type "pool", the user's earnings depend on the proportion of tokens they have staked in the pool. userReward = erate * userStakeAmount / totalStakeAmount.

KeyRequired?Description

p

Yes

Protocol: Helps other systems identify and process brc20-s events

op

Yes

Operation: Type of event (deploy, deposit, mint, withdraw, transfer)

t

Yes

type: type of earning(pool, fixed). pool: share earning with all pool deposits. fixed: earn solo,and have a fixed rate.

pid

Yes

10 letter identifier of the tick id + "#" + 2 letter of pool number

stake

Yes

ticker: 4 letter identifier of the brc-20,"btc" for special

earn

Yes

ticker: 4-6 letter identifier of the brc20-s,"btc" for special

erate

Yes

distribution rate every block

dmax

Yes

maximum token distribution of the pool

total

Yes

total distribution of the token (specified by tick ID)

only

Yes

assets only deposit this pool, must be yes

dec

no

the decimal precision of earn token, default: 18

  1. Stake: deposit brc-20 token/btc into brc20-s pool

{
  "p": "brc20-s",
  "op": "deposit",
  "pid": "f7c515d6b7#01",
  "amt": "100"
}
KeyRequired?Description

p

Yes

Protocol: Helps other systems identify and process brc20-s events

op

Yes

Operation: Type of event (deploy, deposit, mint, withdraw, transfer)

pid

Yes

10 letter identifier of the tick id + "#" + 2 letter of pool number

amt

Yes

Amount to deposit: States the amount of the brc-20 to deposit.

  1. Claim: mint brc20-s earned token

Notice: Users simply need to mint brc20-s inscriptions to execute the "claim" operation and realize profits.

{
  "p": "brc20-s",
  "op": "mint",
  "tick": "abcd",
  "pid": "f7c515d6b7#01",
  "amt": "100"
}
KeyRequired?Description

p

Yes

Protocol: Helps other systems identify and process brc20-s events

op

Yes

Operation: Type of event (deploy, deposit, mint, withdraw, transfer)

tick

Yes

Ticker: 4-6 letter identifier of the brc20-s

pid

Yes

10 letter identifier of the tick id + "#" + 2 letter of pool number

amt

Yes

Amount to mint: States the amount of the brc20-s to mint. Has to be less than "lim" above if stated

  1. Unstake: withdraw brc-20 token/btc from brc20-s pool

Notice: the logic for withdrawing and transferring stake tokens is equivalent.

{
  "p": "brc20-s",
  "op": "withdraw",
  "pid": "f7c515d6b7#01",
  "amt": "100"
}
KeyRequired?Description

p

Yes

Protocol: Helps other systems identify and process brc20-s events

op

Yes

Operation: Type of event (deploy, deposit, mint, withdraw, transfer)

pid

Yes

10 letter identifier of the tick id + "#" + 2 letter of pool number

amt

Yes

Amount to withdraw: States the amount of the brc-20 to withdraw

  1. Transfer brc20-s token

Be careful when using inscription service. Some tools first inscribe and transfer to themselves and then forward it to the customer. So make sure to send tokens to the address that holds the balance, especially in the situation that some ordinal compatible wallet generates a different address each time.

{
  "p": "brc20-s",
  "op": "transfer",
  "tid": "f7c515d6b7",
  "tick": "abcd",
  "amt": "100"
}
KeyRequired?Description

p

Yes

Protocol: Helps other systems identify and process brc20-s events,same compatible with brc-20 in transfer op.

op

Yes

Operation: Type of event (deploy, deposit, mint, withdraw, transfer)

tid

Yes

10 letter identifier of the tick id,pool number not included

tick

Yes

Ticker: 4-6 letter identifier of the brc20-s

amt

Yes

Amount to transfer: States the amount of the brc20-s to transfer.

The parsing rules of BRC20-S are compatible with BRC-20. When there are line breaks or spaces between the text fields in the JSON, it does not affect the parsing result. The validity of the inscription is determined according to the rules of the field itself.

Rules

tick id(tid) generation rule:

pid: 10 letter identifier of the tick id (tid) + "#" + 2 letter of pool number. The rule for generating tid is as follows: Take the values from the plaintext information and combine them in order. Apply a hash operation, specifically SHA256, and obtain the first 10 characters.

Here is an example of generating a tid based on the provided information:

Input: tick = "abcd", total = "21000000", dec = "18", from = "bc1pvk535u5eedhsx75r7mfvdru7t0kcr36mf9wuku7k68stc0ncss8qwzeahv", to = "bc1pvk535u5eedhsx75r7mfvdru7t0kcr36mf9wuku7k68stc0ncss8qwzeahv"

tid example:

SHA256("abcd2100000018bc1pvk535u5eedhsx75r7mfvdru7t0kcr36mf9wuku7k68stc0ncss8qwzeahvbc1pvk535u5eedhsx75r7mfvdru7t0kcr36mf9wuku7k68stc0ncss8qwzeahv")

d15a61a12da6dfa51d386477ecadc35bbddddfb47733401fcd44bae5162a16ab -> First 10 characters -> tid: d15a61a12d

Passive withdraw rule:

When users stake their tokens, they can still transfer these tokens, which could trigger a passive withdraw operation. If the number of tokens in the non-staked state is more than the transfer amount, the transfer will proceed directly. However, if the number of tokens in the non-staked state is less than the transfer amount, the insufficient portion will trigger the passive withdraw operation. Tokens will be withdrawn following a "Last-In-First-Out" order, where tokens that were staked last will be withdrawn first. Consider the following example.

User A holds a total of 20 ordi tokens. First, he stakes 10 ordi tokens in the 215a686504#01 pool. Then, 7 ordi tokens are staked in the 2d66a43166#01 pool. At this point, User A has 3 ordi tokens remaining that are not staked.

  1. User A transfers 3 ordi tokens to User B, which does not trigger the passive withdraw operation, and the staking status doesn't change. The remaining 3 ordi tokens are transferred to User B.

  2. User A transfers 5 ordi tokens to User B, the protocol triggers passive withdraw operation. The staking status of pool 215a686504#01 doesn't change, while the pool 2d66a43166#01 changes. User A passively withdraws 2 ordi tokens from the latter, which, along with the 3 non-staked ordi tokens, are transferred.

  3. User A transfers 15 ordi tokens to User B, the protocol triggers passive withdraw operation. The staking status of both pools changes. User A first passively withdraws 7 ordi tokens from pool 2d66a43166#01, then 5 ordi tokens from pool 215a686504#01. These, along with the 3 non-staked ordi tokens, are transferred.

Risk Associated

We have proposed an extended version of the BRC-20 protocol, which is available for ecosystem developers to continue building upon. Similar to BRC-20, anyone can deploy their own pool, and we do not endorse or audit the created staking pools. We advise users to conduct thorough research and understand the project (DYOR) before participating in staking. Even so, during the staking period, your assets remain securely stored in your own wallet, and there will be no negative returns.

References

standards

  1. BRC-20 Token Standard.

This proposal is licensed under the BSD 2-clause license.

Contact us

We're eager to listen to feedback. Additionally, if you are a developer or project looking to build on top of the BRC20-S protocol and/or wish to collaborate, we'd love to hear from you. Please contact us at web3earn@OKX.com.

Last updated