Home/RGB++ SDK

RGB++ SDK

A comprehensive SDK for RGB++ asset operations that manages assets on both BTC and CKB chains, providing wallet functionality and signature verification within the RGB++ protocol semantics.

RGB++ SDK Overview

At its core, the RGB++ SDK is focused on verifying and recording RGB++ asset ownership. In a regular BTC transaction, once the transaction is signed with a private key and broadcast to the network, it is considered complete after being validated and confirmed by most BTC nodes.

Key Challenge: Isomorphic Binding

However, with RGB++'s isomorphic binding, the consumption and generation of bound UTXOs and CKB Cells must maintain atomicity. It relies on btc-assets-api and SPV Service to faithfully synchronize RGB++ asset transaction information from BTC to CKB, while recording the resulting ownership changes in CKB Cells.

Core Functions

Wallet Functionality

The RGB++ SDK can be understood as a wallet operating within the RGB++ protocol semantics, capable of managing assets on both BTC and CKB chains, thereby facilitating RGB++ asset operations.

Dual-Chain Management

BTC

Manages Bitcoin UTXOs and transactions

CKB

Manages CKB Cells and asset states

Key Features
  • • Cross-chain asset management
  • • Unified wallet interface
  • • Transaction coordination
  • • State synchronization
Signature Verification

Beyond basic BTC/CKB private key signature verification, the RGB++ SDK extends the signature verification process for RGB++ assets from the BTC chain to the CKB chain through the SPV Service and RGB++ contracts.

Extended Verification

1

Standard BTC/CKB private key verification

2

RGB++ asset signature verification via SPV

3

Cross-chain commitment validation

Verification Features
  • • RGB++ asset signature verifier
  • • Cross-chain verification
  • • SPV-based validation
  • • Contract integration
Implementation Architecture

At the implementation level, the RGB++ SDK extensively utilizes ccc, the standard CKB JavaScript/TypeScript SDK, for core functionalities such as transaction assembly, signing, and submission.

Transaction Assembly

Utilizes ccc SDK for constructing both Bitcoin and CKB transactions with proper RGB++ commitments.

Transaction Signing

Handles cryptographic signing for both chains while maintaining isomorphic binding requirements.

Transaction Submission

Coordinates submission of paired transactions across Bitcoin and CKB networks.

CCC Integration

The RGB++ SDK leverages the comprehensive capabilities of the ccc (CKB Client Core) library, which provides standardized interfaces for CKB blockchain interactions, ensuring compatibility and reliability in RGB++ asset operations.

Available SDKs

Primary SDK (Recommended)
Actively Developed

The actively developed and recommended RGB++ SDK, integrated with the ccc library for enhanced functionality and performance.

Features

  • • Latest RGB++ protocol features
  • • Integrated with ccc library
  • • TypeScript/JavaScript support
  • • Active maintenance and updates
  • • Comprehensive documentation

https://github.com/ckb-devrel/ccc/tree/rgbpp-sdk

Legacy SDK
Continuously Maintained

The original RGB++ SDK that continues to be maintained for backward compatibility and existing projects.

Features

  • • Stable and proven implementation
  • • TypeScript/JavaScript support
  • • Backward compatibility
  • • Continuous maintenance
  • • Existing project support

https://github.com/RGBPlusPlus/rgbpp-sdk

Usage Scenarios

The RGB++ SDK serves multiple roles in the RGB++ ecosystem, providing essential functionality for various use cases.

Developer Integration

DApp development and integration

Custom wallet implementations

Exchange and service integrations

Asset Operations

RGB++ asset issuance and management

Cross-chain asset transfers

Asset verification and validation

Getting Started

Ready to start building with RGB++ SDK? Choose your preferred SDK and explore the comprehensive documentation and examples.

Quick Start Steps

1

Choose your preferred SDK (Primary recommended)

2

Install the SDK via npm or yarn

3

Follow the UDT example in our Quick Start guide

4

Explore advanced features and integrations

Continue Learning

Now that you understand RGB++ SDK, explore other core components and see practical implementation examples.