Basic Analysis of Bitcoin BRC20 Ecosystem

0. Research Background

Staking has become an essential feature of many blockchain networks, allowing users to participate in network consensus and earn rewards. While Ethereum has been the leading blockchain network for staking, with over $80 billion worth of ETH currently staked, Bitcoin has also been expanding its use case boundaries and exploring staking as a way to provide users with additional earning opportunities. In this article, we will explore basic background of Bitcoin extensions, as well as the development history of Bitcoin BRC20, its current staking experiments and their drawbacks, and what StaFi can do for Bitcoin and BRC20 staking.

1. Ethereum and Bitcoin, POS vs. POW

Ethereum and Bitcoin are two of the most prominent blockchain networks, and while they share many similarities, there are also significant differences between them. One of the most significant differences between Ethereum and Bitcoin is their consensus mechanism. Ethereum uses a proof-of-stake (PoS) consensus mechanism, while Bitcoin uses a proof-of-work (PoW) consensus mechanism.

POS allows users to validate transactions and create new blocks based on the number of coins they hold and are willing to lock up. POW, on the other hand, requires miners to solve complex mathematical equations to validate transactions and create new blocks.

Another significant difference between Ethereum and Bitcoin is scalability. Ethereum is designed to be more scalable than Bitcoin, with the ability to process more transactions per second. Ethereum also supports smart contracts, which allow developers to build decentralized applications (dApps) on top of the blockchain. Bitcoin, on the other hand, has limited smart contract capabilities, which has led to the development of Bitcoin extensions.

2. Current Bitcoin Extension Solutions

There are many Bitcoin extensions such as No-upgradable Scaling, Side Chains, and On-Way Transfer solutions for Bitcoin blockchain to enhance its functionality. These extensions aim to address some of the limitations of the Bitcoin network, especially the limited smart contract capabilities and scalability issues.

2.1 No-upgradable Scaling Extensions

Feature RGB protocol Taproot + Taro PBST
What is it? Client-validated state and smart contract system working at layer 2/3 in Bitcoin and Lightning Network Taproot is an upgrade to the Bitcoin protocol that introduces new features, such as Schnorr signatures and Tapscript; Taro is a protocol that based on Taproot upgrade. A valuable tool for improving the efficiency and security of Bitcoin transactions. PSBT makes it easy for multiple participants to work together to complete a transaction without concern for the underlying implementation details.
How does it work? RGB achieves scalability by utilizing the Bitcoin blockchain as its state commitment layer and maintaining the code and data for smart contracts off-chain. Taproot uses Schnorr signatures to reduce the size of transactions and improve privacy. It also introduces Tapscript, which is a new scripting language that allows for more complex smart contracts. PSBTs work by providing a way for wallets to exchange information about a transaction without having to reveal the private keys that are used to sign the transaction. This makes it possible for multiple parties to collaborate on signing a transaction without having to trust each other.

2.2 State Channel: Lightning Network

2.2.1 What is it, how it works?

The Lightning Network is a second-layer payment protocol that operates on top of the Bitcoin blockchain. It allows for fast and cheap payments between users without the need to broadcast transactions to the blockchain.

The Lightning Network works by creating a network of bidirectional payment channels between users. When two users want to make a payment, they first open a payment channel between them. This channel allows each user to send and receive funds from the other user. Once the payment channel is open, users can make as many payments as they want to each other without having to broadcast any transactions to the blockchain. When the users are finished making payments, they can close the payment channel and the funds will be settled on the blockchain.

2.2.2 Differences between Lightning Network and Side Chains

The concept of Lightning Network is to open a “green channel” outside the blockchain, so that a large number of high-frequency and small transactions are carried out outside the blockchain, and the final settlement data is placed on the chain, while the confirmation of off-chain transactions and payment channels are solved by technical means such as RSMC and HTLC.

Apart from that, the Lightning Network mainly solved the problem of low throughput and high cost of BTC settlement, but did not solve the problem of inadequate construction of BTC native applications, hence the concept of Bitcoin Side-chain was introduced in the same period. Simply put, developers then created a separate chain on which to do more smart contracts or other computational execution.
The main interaction between the side-chain and Bitcoin is that the sidechain verifies the information on the main Bitcoin chain and then does the subsequent execution, and in turn the main Bitcoin chain cannot trust the side-chain or have all Bitcoin miners verify that the transactions on the side-chain have occurred.

So, generally speaking it’s probably in the form of a federated side-chain, similar to the way a group or a few members witness each other, so going for a two-way anchor.

2.3 Side Chains

Stacks, Liquidity Network, and RSK are all aim to enable smart contracts on top of Bitcoin. However, they differ in their approach to consensus, security and adoption.

Feature Stacks Liquidity Network RSK
Consensus mechanism PoX D-POS Bitcoin side-chain
Native token STX LBTC RBTC
Smart contract language Clarity Solidity EVM
Security High Medium High
Adoption Growing Small Growing
  • Stacks: Rather than deploying smart contracts directly on the Bitcoin chain, Stacks executes them on its own Layer 1 blockchain and uses only Bitcoin for settlement. Stacks’ technical architecture consists of a core layer and a subnet, and developers and users can choose between the two. the main Stacks network is highly decentralised but has low throughput, while the subnet is less decentralised but has higher throughput. For the POX Consensus mechanism of Stacks, STX staking involves locking up STX in a smart contract and earning Bitcoin rewards, which represent the value of the staked STX and can be exchanged on the Bitcoin. On the Other hand, Miners participate in the bidding process on the Stacks network by spending BTC, this bidding process takes place on the Stacks chain and new blocks are written to the Bitcoin layer.
  • Liquidity Network: Liquid Network uses D-POS consensus mechanism and transaction fees on the Liquid Network are paid in L-BTC. To participate in Liquid Consensus, nodes must stake a minimum of 100,000 L-BTC. Staking nodes are responsible for validating transactions and generating blocks. They are also rewarded with a portion of the transaction fees collected on the network.
  • RSK is a EVM compatible smart contracts platform, rBTC is the native token of RSK and it could be used as gas fees same like Liquidity Network. Bitcoin miners can choose to do the RSK merged mining without extra resources consuming and they could get extra RSK transaction fees.

3. Development History for Bitcoin BRC20

3.1 What is Ordinal and BRC20?

BRC20 is based on the Ordinals protocol, which was introduced in February 2022 and officially launched in January 2023. Ordinals allow for the creation of unique identifiers for individual satoshis, it uses a unique way of writing any segment of 4MB sized content data to Bitcoin, with each segment of data tied to a satoshi of Bitcoin. There are two main parts in the Ordinal protocols: Ordinal and Inscription.

3.1.1 Ordinal

There are a total of 2,100,000,000,000,000,000 minimum units of Bitcoin, known as Satoshi, and 1 BTC = 100,000,000 Satoshi. Ordinals distinguishes these Satoshi by numbering them sequentially, which is how the project “Ordinals: Serial Numbers” got its name.

There are various ways to number the Satoshi, such as directly by a purely numerical sequence number such as 2099994106992659, or by the block number + offset of each Satoshi’s location such as 3891094.16797. Once a Satoshi is numbered, any asset, such as an NFT (texts, pictures, videos and audios formats), Security Token, account or stablecoin, can be attached to the Satoshi using the serial number as the stable identifier.

3.1.2 Inscription

Ordinals refers to this “attach” action as inscribe, similar to the act of minting in ETH NFT. ordinals inscription content are stored entirely on-chain, in a taproot script-path spend scripts. Taproot scripts have very few restrictions on their content and receive a witness discount, making it relatively economical to store inscription content. taproot is the latest stage in bitcoin’s expansion after segwit, which was designed to increase the volume of bitcoin transactions, but objectively also created the conditions for ordinals to emerge.

3.2 Why now Ordinal?

The logic of Ordinals in the script relies on the “op_if” opcode in the Bitcoin script. “op_if” means that if there are “0” and “op_if” in the stack, then “0” and "op_if and “op_if” are present on the stack, then the whole section of code in between “0” and “op_if” is skipped and does not go onto the stack for actual execution.

Ordinals takes advantage of this - when it needs to attach an inscription, it first validates a signature, then writes “0” and “op_if” to the stack, and The data in between the “0” and “op_if” is skipped in its entirety as scripted, and this data is the Ordinals inscription.

In addition to the “op_if”, the existence of Ordinals is also related to a major technical upgrade to Bitcoin’s isolated witness. As we all know, Bitcoin uses the UTXO system of bookkeeping, and UTXO has its own scripted public key, which usually requires some data to be provided to complete the verification process programmed into the scripted public key for a sum of money to be unlocked. Originally, all the data used to pass the verification process would have been placed in the field where the script signature was entered. in August 2017, bitcoin adopted a soft fork upgrade called Segregated Witness (SegWit) which allows for more space in the block by placing data such as signatures, which take up a lot of storage space, at the end of the transaction script, within the bitcoin block size limit of no more than 4MB, thus allowing for more transactions for the purpose of scaling.

Since quarantine witnessing is a soft fork and not mandatory, the developers have made data storage on quarantine witnessing cheaper in order to attract people to use it. The size of the transaction is the basis for the fees charged for bitcoin, so the developers used a discount on the transaction size calculation for the isolated part of the witness - dividing the transaction data structure into two parts, the transaction data and the witness data, and calculating the size of the witness data using the virtual Byte ( vByte) units, with 1 vByte equivalent to 4 weight units (wu):

  • Witness data: contains the script and signature data, each byte is counted as 1 wu
  • transaction data: contains information about the sender, the receiver and the input and output, each byte counts as 4wu

In other words, the data weight of the witness part is only 25% of the transaction part, and the transaction fee is 25% accordingly, while the previous maximum block size is changed from 1MB to 1vMB, i.e. 4MB.

The real implementation of Ordinals, however, is also related to Taproot. In the witness isolation technology, there was a specific limit on the size of data per input, but in November 2021, Bitcoin saw another major upgrade to Taproot that removed the limit on the amount of data in the witness section, and the exact size of data was only limited by the maximum block size of 4MB in the isolated area, while allowing developers to write more advanced scripts in the witness section.

A series of technical upgrades allowed data that previously could not be placed on the Bitcoin chain to be stored on the chain, laying the groundwork for the implementation of Ordinals step by step.

After the release of Ordinals, the community first used the protocol to issue NFTs, especially after a well-known organization like Yuga Labs also issued a Bitcoin NFT based on BRC20, which attracted widespread industry attention and Mempool published a research report specifically on Bitcoin NFTs. But it was the BRC20 protocol, based on Ordinals’ issuance of tokens, that soon attracted greater market attention.

3.3 How does Ordinal works?

3.3.1 Functions

Basically BRC20 uses the feature that inscription can write any data in the block, and writes JSON data in it to issue tokens. These JSON defines some criteria of tokens, including asset name, issue amount and other information are written to the chain in the form of inscription. By comparison, Ordinals would be like writing words or drawing a picture on top of the banknote.

Following algorithm demonstrates how Ordinal being created and transferred:

# subsidy of block at given height
def subsidy(height):
  return 50 * 100_000_000 >> height // 210_000

# first ordinal of subsidy of block at given height
def first_ordinal(height):
  start = 0
  for height in range(height):
    start += subsidy(height)
  return start

# assign ordinals in given block
def assign_ordinals(block):
  first = first_ordinal(block.height)
  last = first + subsidy(block.height)
  coinbase_ordinals = list(range(first, last))

  for transaction in block.transactions[1:]:
    ordinals = []
    for input in transaction.inputs:
      ordinals.extend(input.ordinals)

    for output in transaction.outputs:
      output.ordinals = ordinals[:output.value]
      del ordinals[:output.value]

    coinbase_ordinals.extend(ordinals)

  for output in block.transaction[0].outputs:
    output.ordinals = coinbase_ordinals[:output.value]
    del coinbase_ordinals[:output.value]

3.3.2 Characteristics

Storage:

  • All data for Ordinals inscriptions is stored on the chain and does not rely on external storage such as IPFS or AWS S3, the creator of the inscription must pay a fee proportional to the size of the content.

Format:

  • Takes up space for other normal Bitcoin transactions, Bitcoin’s protocol does not impose type restrictions on this part of the data, Ordinals follows the MIME protocol and the data type can be images, but also video, text, identity or other;

Consensus:

  • Bitcoin users need a special wallet and block browser (Ord Wallet) to index and track ordinal NFTs, but can use any bitcoin address to send and receive those NFTs. because electronic artifacts require taproot to be minted, Ordi Wallet will enable Taproot addresses by default.
    Also note: A satoshi with an inscription attached to it is still indistinguishable from any other satoshi from the chain, meaning it can be spent just like any other satoshi, and there is no difference in how it is spent. Right now, a satoshi can only be inscribed once, but Rodarmor is working on an upgrade that will allow users to re-inscribe a satoshi that has already been inscribed before (called “transcription”).

Requirement:

  • Issuing Inscriptions maintenance requires bitcoin full nodes to view the current bitcoin blockchain state, as well as the ability to create Inscriptions and execute sat-controlled wallets to construct transactions sent to another wallet.

3.3.3 Recursive inscriptions

On Mon Jun 12th, 2023, Ordinals made one update named as Recursive Inscriptions. Recursive Inscriptions breaks the independent and unrelated inscription format, and opens up the possibility of free combinations through its self-referential nature.

According to developer Leonidas.og, inscriptions can now request the content of other inscriptions using a special “/-/content/:inscription_id” syntax, which directly allows users to create inscriptions on the Bitcoin chain with less space and lower cost fees.

Normal Ordinals Recursive Inscriptions
Data storage Up to 4MB per inscription No limit, as data can be linked through a series of calls
Interoperability Limited, as ordinals cannot interact with each other Enhanced, as recursive inscriptions can link to other inscriptions
Use cases Storing digital artifacts, such as images, videos, and text Storing larger files, running software on-chain, and implementing permissionless contracts
Limitations 4MB storage limit, limited interoperability Complex to implement, requires a deep understanding of ordinals
Potential Could revolutionize the way digital artifacts are stored and used on the Bitcoin network Could enable new applications on the Bitcoin network, such as hosting large files and running software on-chain

Summary:

  • In the past: to create an inscription for a PFP collection, an image needed to be uploaded and the user downloaded the image on the chain. And as the quality of the images increased and became more detailed and high-definition, the corresponding images had more memory and took up more space, and the fees and costs were higher.
  • Now: the special id syntax used for recursive inscriptions essentially uses textual code to find images. Creating PFP ensemble inscriptions can be done by uploading images corresponding to features, including elements such as patterns, colors, and accessories. The corresponding elements already existing on the chain found by are then combined and stitched together without having to upload and download around the image.
  • Immediate advantage: creating inscriptions this way is very small because it is called text code, which not only reduces significantly in cost and expense, but also allows the inscription size to break the 4MB limit of the bitcoin block size.

Potential Use Cases:

  • Make it possible to create games and 3D models, metaverse that are entirely hosted on the Bitcoin blockchain. This would make games more secure and resistant to censorship. (inscription types have been added to the “JS” and “CSS” types).
  • Being used to create more complex smart contracts in Bitcoin network.

3.4 BRC20

BRC20 is an NFT based on the Ordinal protocol. The design logic is that NFTs can be obtained by filling different messages based on sats, so when we fill the messages with a certain pattern or follow a uniform standard, we can produce homogeneous Tokens on the BTC ecosystem.

After Domo proposed the first brc-20 standard, he also issued the first brc-20 Token ORDI as an experiment, and this is seen as a prototype for the development of BRC-20.

3.4.1 BRC20 Functions

  • deploy:Create a brc-20 with the deploy function
  • Mintinscription):Mint an amount of brc-20’s with the mint function
  • Transfer:Transfer an amount of brc-20’s with the transfer function.

Mint Function

{
"p": "brc-20",
"op": "mint",
"tick": "ordi",
"amt": "1000"
}
- **p:** The protocol name, which is "brc-20" in this case.
- **op:** The operation, which is "transfer" in this case.
- **tick:** The ticker symbol of the token being transferred, which is "ordi" in this case.
- **amt:** The amount of tokens being transferred, which is 500 in this case.

Transfer Function

{"p":"brc-20","op":"transfer","tick":"ordi","amt":"500"}

3.4.2 BRC20 Characteristics

  1. because BRC20 is inherently a Sats inscribed message, BRC-20 itself does not have the ability to interact with smart contracts, and in contrast to ETH-20, BRC-20 Token can no longer be given a decimal point, nor can it be Burned and Locked, and it does not have functions such as approval or authorization.
  2. The inability to interact with smart contracts means that BRC-20 Token issuance is not reserved for project owners or VCs, and that everyone is an equal participant in the ecosystem.
  3. The core sats of BRC20 can be considered as the smallest unit of BTC, therefore, the natural value of BRC-20 Token is straightforwardly stretched, even if the narrative of individual BRC-20 projects is not sufficient, the description “BTC” is a real transaction, which ensures that BRC-20 Token will not have the same risk of going to zero as ERC-20 and more ERC-20 sidechains.

3.4.3 Other Protocols that based on BRC20

Protocol Standard Function Characteristics
BRC20 Fungible token Scaling solution for the Bitcoin Network inherently a Sats inscribed message, not distinguishable by normal Bitcoin transactions
BRC721 Non-fungible token A non-fungible token (NFT) standard built on the Bitcoin Network Need OridinalSafe Wallet to use. The metadata is stored off-chain and linked to the collection
GBRC721 Non-fungible token A gas-saving NFT standard built on the Bitcoin Network Images are on-chain and can be regenerated using exclusively on-chain data

4. Current Bitcoin staking and BRC20 Staking Experiment

4.1 BRC-721K

BRC-721K is a non-fungible token (NFT) standard for Bitcoin ordinals, created by BITCOIN KNIGHT. It offers a suite of functions for token deployment, staking, unstaking, reward redemption, and transfer operations, enriching the interaction between BRC-20 and BTC NFT.

4.1.1 Usage Flow:

  1. Deploy

    {
      "p": "brc-721k",
      "tick": "KNGT",
      "op": "deploy",
      "max": "21000000000",
      "precision": "0",
      "asset_id": "e5eaf9dd7a1527eaf2561439ef0abb97b3d17a040b0c9d3d54cae825e36e3fa0i0",
      "reward_rate": "1.2"
    }
    
  2. Stake

    {  "p": "brc-721k",  "tick": "KNGT",  "op": "stake",  "asset_id": "e5eaf9dd7a1527eaf2561439ef0abb97b3d17a040b0c9d3d54cae825e36e3fa0i0"}
    

  1. Unstake

    {
      "p": "brc-721k",
      "tick": "KNGT",
      "op": "unstake",
      "asset_id": "e5eaf9dd7a1527eaf2561439ef0abb97b3d17a040b0c9d3d54cae825e36e3fa0i0"
    }
    
  2. Claim

  • The stake inscription number is #30000

  • The unstake inscription number is #40000

  • The reward rate is 1.2The asset quantity is 1

  • :point_right:The reward quantity is (40000 - 30000)*1.21 = 1200 $KNGT

    {
      "p": "brc-721k",
      "tick": "KNGT",
      "op": "claim",
      "reward_quantity": "stake_inscription - unstake_inscription x reward_rate x asset_quantity"
    }
    

4.1.2 Improvements of BRC-721K:

  1. Gas Fee saving: Unnecessary activities such as staking and token deployment have been merged, as well as claiming and depositing, effectively reducing inscription waste and the frequency of user gas fee usage.
  2. non-custodial staking: Users can passively earn rewards without having to move their assets out of their wallets through non-custodial staking.
  3. Reward Mechanism: Staking rewards are no longer calculated based on Earth time but on the number of inscriptions inscribed before reward liquidation, representing the number of reward days.

4.2 Bitstake

4.2.1 Usage Flow:

Stake:

  • Staking is done by incribing a transfer inscription & depositing tokens in the staking wallet address
  • transfer the tokens to staking wallet & block time is captured upon transfer to calculate the yield
{
"p":"brc-20",
"op":"transfer",
"tick":"bYLD",
"amt":"100"
}

Unstake

  • Let us assume we had staked 1000 $bYLD tokens for 100 blocks. The balance shown on staking dashboard will be 1000 * (1+0.0007*100) = 1070 tokens.
  • User need to inscribe an untransfer op and send it to the staking address.
  • Untransfer op is defined only for staking protocol, its not a part of original BRC20 design.
{
  "p":"brc-20",
  "op":"untransfer",
  "tick":"bYLD",
  "txn":"c63ac7663b77b01dc941fc990caf04bb48cb9aeeade8ddi0"
}

4.3 OKX BRC30

users can now stake their own BRC-20 tokens or bitcoin and receive BRC-30 tokens in return. BRC-30 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.

4.3.1 Usage Flow:

Project team

  • Issuing their own BRC-30 tokens by creating a staking pool, gaining seed users

Users

  • Staking BTC earns other BRC-30 like abcd (newly issued BRC-30 token)
  • Staking BRC-20 tokens earns other BRC-30 like abcd (newly issued BRC-30 token)

key features

  • Staking: Users can stake their BRC-20 tokens or bitcoin to earn BRC-30 tokens.
  • Minting: Users can mint BRC-30 tokens from their earned tokens.
  • Withdrawal: Users can withdraw their BRC-20 tokens or bitcoin from staking.
  • Transfer: Users can transfer their BRC-30 tokens to other users.
  • BRC-30 is an open-source protocol, which means that anyone can develop applications that support it.

Conclusion

In conclusion, staking has become an essential feature of many blockchain networks, providing users with additional earning opportunities and enhancing network security. While Ethereum has been the leading blockchain network for staking, Bitcoin has also been exploring staking as a way to increase network security and provide users with additional earning opportunities.

Bitcoin extensions, such as Taproot, PSBT, RGB and UXTO, RSK and Stacks, and the Liquid Network, aim to address some of the limitations of the Bitcoin protocol, such as limited smart contract capabilities and scalability issues.

BRC20 is a token standard that allows for the creation of tokens on the Bitcoin blockchain, which can be used for different purposes. Bitcoin staking experiments, such as L-BTC and STX, and BRC20 staking experiments, such as Bitstake and Cardano Knight Network, OKX BRC30 have shown promise, but there are still some drawbacks that need to be addressed, such as:

  • Lack of liquidity: There is currently limited liquidity for BRC20 tokens, which makes it difficult for users to buy and sell them.
  • Lack of interoperability between different token standards: BRC20 tokens are not currently interoperable with other token standards;
  • Centralization problems: Some of the current BRC20 staking services are centralized, which means that they are not fully decentralized and could pose a security risk to users.

This is a quite interesting filed and there are few directions that StaFi could address some of the drawbacks of current BRC20 staking services, we will keep exploring in this field and may bring StaFier more interesting use cases in Bitcoin.


4 Likes