Introduction
react-native-rgb is a React Native Turbo Module for the Bitcoin RGB Protocol. This library provides a high-level TypeScript API to manage RGB assets, keys, and wallets. It wraps the native rgb-lib-swift and rgb-lib-kotlin libraries.
Features
- Full Asset Support: Handle NIA (Non-Inflatable Assets), UDA (Unique Digital Assets), CFA (Collectible Fungible Assets), and IFA (Inflatable Fungible Assets)
- Key Management: BIP39 mnemonic support for key generation and restoration
- Performance: Built as a Turbo Module for efficient native communication
- Type Safety: Written in TypeScript with comprehensive type definitions
- Error Handling: Structured error handling with error codes for better error management
What is RGB?
RGB is a client-side validated state and smart contract system for Bitcoin. It allows you to issue and transfer digital assets on Bitcoin's blockchain while maintaining privacy and scalability. RGB assets are stored off-chain and only cryptographic commitments are stored on-chain.
Key Concepts
Asset Types
- NIA (Non-Inflatable Asset): Simple fungible tokens that cannot be inflated after issuance
- UDA (Unique Digital Asset): Non-fungible tokens representing unique digital items
- CFA (Collectible Fungible Asset): Fungible tokens that can have associated media files
- IFA (Inflatable Fungible Asset): Fungible tokens that support inflation and replace rights
Wallet Structure
The wallet consists of two sides:
- Vanilla: Regular Bitcoin transactions
- Colored: RGB asset allocations
Both sides share the same keys but manage different types of transactions.
Getting Started
Ready to start using react-native-rgb? Head over to the Getting Started guide to set up your first wallet.