This guide covers iOS and Android applications. For Node.js, see the Node.js guide. For browser applications, see the Web guide.
Prerequisites
- React Native with a working iOS or Android native build environment
- Node.js for the development toolchain
- A persistent, writable application directory
- Bitcoin test funds for transaction fees
- A separately initialized sender wallet that already holds the RGB asset for an end-to-end transfer
Step 1: Install the SDK
Step 2: Generate Wallet Keys
Step 3: Initialize and Unlock the Wallet
The React Native constructor requires node parameters and a signer. Create the storage directory before initializing the wallet.getPasswordFromSecureInput() represents an application-owned secure prompt. The empty unlock object allows the SDK to resolve the indexer and RGB proxy from the utexo network defaults.
Use unused listening ports. If two wallet instances run in the same app process, give each instance different ports and a different storage directory.
Step 4: Fund the Wallet
Step 5: Create RGB UTXOs
size is denominated in satoshis.
Step 6: Resolve the Asset From the Sender
listAssets() returns arrays grouped by schema. NIA assets are in nia and use assetId.
Step 7: Create a Receive Invoice
Run this on the receiver wallet initialized above:amount is an integer in asset base units. One displayed unit equals 10 ** precision base units.
Step 8: Send From the Funded Wallet
The current React Native API usesonchainSend(), not send().
UTEXOWallet with its own storage directory and ports, sufficient signet BTC, and a spendable asset balance.
Step 9: Refresh and Verify
Lightning Payments
Lightning requires usable peer and channel state. Wallet initialization does not open or fund a channel. For a BTC-only invoice, omit theasset field.
asset: { assetId, amount } when creating the invoice. Do not pass an empty asset object for BTC-only payments.
React Native-Specific Notes
- Store the wallet database in a persistent application document directory, not a cache directory.
- Keep the mnemonic and password in platform-backed secure storage.
- Give concurrent node instances distinct storage directories and listening ports.
- Plan for application lifecycle changes. Shut down or dispose of the wallet according to the SDK lifecycle before replacing an instance.
- Network access is required for indexer, RGB transport, and Lightning operations.
Troubleshooting
Implementation References
- React Native wallet implementation
- React Native network defaults
- React Native signer implementations
- Maintained React Native lifecycle harness
- Shared wallet models