XRGB
  • XRGB
    • XRGB Introduciton
    • XRGB-404
    • XRGB Token
    • Roadmaps
    • XRGB L2 Chain
    • X404 Protocol
    • How to Use the XRGB Bridge on Lynex
  • XRGB WALLET
    • Overview
    • Social Login
    • XRGB Web Wallet
    • XRGB Mobile Wallet
    • XRGB Extension Wallet
    • Assets Supported
      • BRC20
        • Technical implementation
        • User Tutorial
      • RGB20
        • Overview
        • User Tutorial
    • Address type
  • XRGB STAKING
    • Babylon Staking
    • Lorenzo Staking
    • Other Staking Protocols
  • XRGB USB
    • Tech Implementation
    • USB Design
    • USB Tutorial
    • Musig2 Introduction
  • X404 NFT Hub
    • Get started
    • Mint X404 Tutorial
    • Buy X404 Tutorial
    • Bridge X404 Tutorial
    • Redeem or claim X404 Tutorial
    • Send & Receive X404 Tutorial
  • FAQs
    • XRGB Wallet
      • Quick Question
      • Executing a payment using RGB
      • What are the benefits of MPC wallets with Social Login?
      • MPC Wallet Use Cases
    • RGB
      • Quick Question
      • Client-Side-Validation
      • Introduction of RGB Contract
      • Introduction of Single-Use Seals
      • Client to client communications
      • RGB state transitions
      • RGB state transition commitments
      • RGB Privacy Protection
    • BRC20
      • Quick Question
      • Pros of BRC-20 Tokens
      • Cons of BRC-20 Tokens
  • πŸ“–User Tutorials
    • Get started
      • Usage conditions
      • Create a new account
      • Social Login
      • Import Wallet
    • BRC20 Tutorial
      • View BRC20 tokens and balances
      • View BRC20 token detail
      • Inscribe transfer
      • Send BRC20
      • Receive BRC20
    • RGB20 Tutorial
      • View RGB20 assets and balance (Testnet)
      • Mint RGB20 assets (Testnet)
      • Send and receive RGB20 tokens (Testnet)
    • ERC20 Tutorial
      • View ERC20 assets
      • Send and receive ERC20
    • BTC Token
    • BRC20 - ERC404 Bridge
Powered by GitBook
On this page
  • 1.Creation of RGB Assets
  • Step 1:
  • Step 2:
  • Note:
  • 2.Send/Receive RGB Assets
  • 2.1.Userflow
  • 2.2.Workflow
  • 3.RGB Asset Accounting
  • 4.Bitcoin Address Format
  1. XRGB WALLET
  2. Assets Supported
  3. RGB20

Overview

PreviousRGB20NextUser Tutorial

Last updated 1 year ago

1.Creation of RGB Assets

Step 1:

XRGB Wallet users need to deposit BTC in advance. This is used to initiate a BTC transaction and create a new UTXO for the on-chain commitment of newly created RGB asset. The amount of Bitcoin required is not large; it just needs to be sufficient to prevent any output from becoming a dust transaction. XRGB Wallet suggests a minimum of 10,000 satoshis.

Step 2:

To create RGB assets in the XRGB Wallet, users enter the asset's code or abbreviation, full name and total supply, setting the precision to 18. Upon successful creation, a Bitcoin transaction is initiated. The commitment for the newly created RGB asset is added to the OP_RETURN output or Taproot output of the Bitcoin transaction, directing the ownership of the asset to the UTXO newly created in this BTC transaction. In the following content, we will refer to this UTXO as UTXO_Genesis. As this BTC transaction is broadcasted on the Bitcoin network, whoever owns UTXO_Genesis becomes the owner of the newly created RGB asset.

Note:

The use of the OP_RETURN field output is part of the BTC transaction, not a separate step post-creation. Therefore, the pre-deposited Bitcoin is used to make the BTC transaction, add the commitment to the OP_RETURN or Taproot output and create the UTXO_Genesis.

2.Send/Receive RGB Assets

2.1.Userflow

(1) The recipient imports the RGB asset contract and generates an invoice containing the receiving amount.

(2) The sender verifies the invoice and sends the generated consignment to the recipient.

(3) The recipient signs the consignment, successfully transferring the RGB asset.

2.2.Workflow

Step 1: the formation of a new state transition consignment and the corresponding witness transaction

The XRGB Wallet initially constructs a PSBT (Partially Signed Bitcoin Transaction) file, defining the underlying witness transaction structure. Based on this PSBT, the consumed output list is passed to the RGB node, along with a specific contract ID. The node prepares a state transition consignment, including the complete history of the consumed outputs.

This consignment is then used in the transfer preparation process. During this, a new state transition (or multiple bundled transitions) is arranged based on the consignment file, PSBT, beneficiary list, and available change addresses.

Next, the RGB node is requested to complete the consignment and prepare for disclosure. This involves

(1) extracting all other contracts affected by this operation and preparing "blank" state transitions for them;

(2) packaging the main contract's state transition with additional blank transitions of other affected contracts into an anchor;

(3) updating the consignment file with the newly formed anchor and state transitions;

(4) preparing a disclosure containing the remaining blank state transitions.

This completes the formation of a new state transition consignment and the corresponding witness transaction (e.g., transaction spending UTXO_Genesis).

Step 2: sign the consignment and broadcast on chain

The consignment is then sent to the recipient, who must return a signature.

Once the signature is received, the witness transaction from the PSBT (e.g., transaction spending UTXO_Genesis) should be signed by all signatories and released to the network. Simultaneously, the RGB node should attach the previously prepared disclosure in parallel to maintain the validity of the remaining smart contracts.

Note:

If only a portion of the RGB assets in UTXO_Genesis is transferred to the recipient, part of the RGB assets will be colored to UTXO_1, and the remainder to UTXO_2. Both UTXO_1 and UTXO_2 are created in the BTC transaction which spending UTXO_Genesis, with UTXO_1 sent to the BTC Mainnet recipient's address and UTXO_2 returned to the BTC Mainnet sender's address, allowing the recipient and sender to own UTXO_1 and UTXO_2, respectively.

If you possess UTXOs that have been colored by RGB20 or RGB21, XRGB Wallet can use client-side validation to confirm that you have received and can control your assets.

Deterministic Bitcoin Commitments (DBCs) offer a method to create provably unique commitments within Bitcoin transactions. The RGB protocol allows two types of DBCs: those based on taproot outputs (referred to as β€œtapret”) and those based on OP_RETURN outputs (referred to as β€œopret”).

To better support user management of RGB assets, and considering future scalability, XRGB Wallet provides comprehensive functionality for creating, importing, and using the β€œBech32m” Bitcoin address format in the first version. The Bech32m format is not only compatible with existing Segwit-support systems but also supports all new features included in the Taproot upgrade. It can support both types of DBCs, significantly enhancing transaction efficiency, security, and privacy. This improves the user experience and the future scalability of the wallet while reducing transaction costs.

3.RGB Asset Accounting

4.Bitcoin Address Format

🍭
🍭
🌈
🌈
🌈
🍭
🍭
🌈
🌈
🍭
🍭
🍭
🍭