Skip to main content
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
This guide uses the utexo network profile for Utexo’s hosted signet infrastructure. Never use mainnet keys or real funds while following this guide.

Step 1: Install the SDK

For iOS, install the native dependencies after adding the package:
The package includes native bindings and is not interchangeable with the Node.js or Web packages.

Step 2: Generate Wallet Keys

Store the mnemonic in platform-backed secure storage. Do not log it in production or persist it in AsyncStorage.

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.
The older new UTEXOWallet(mnemonic, { network, dataDir }) form does not match the current React Native implementation. The mnemonic and password belong in the signer, and startup requires both init() and unlock().

Step 4: Fund the Wallet

Send signet BTC to the address and wait for the required confirmation before creating RGB UTXOs.

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.
A new receiver wallet will not list an asset it has never received. Resolve the ID and precision from the funded sender or an authoritative asset registry.

Step 7: Create a Receive Invoice

Run this on the receiver wallet initialized above:
The 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 uses onchainSend(), not send().
The sender wallet must be a separately initialized UTEXOWallet with its own storage directory and ports, sufficient signet BTC, and a spendable asset balance.

Step 9: Refresh and Verify

A transfer can remain pending while its consignment is delivered and its Bitcoin anchor reaches the required confirmation state.

Lightning Payments

Lightning requires usable peer and channel state. Wallet initialization does not open or fund a channel. For a BTC-only invoice, omit the asset field.
For an RGB-asset invoice, pass 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

Next Steps