@utexo/rgb-sdk package is the Node.js SDK for applications built on the Utexo stack. It provides a complete set of bindings for wallet management, RGB asset operations, Lightning payments, async payments, and on-chain Bitcoin interactions. It is built on top of @utexo/rgb-sdk-core, the shared foundation used by all three Utexo SDK platforms.
All operations are performed locally using client-side validation. Private keys and mnemonics are never transmitted to remote servers during normal execution.
Installation
Initialisation
The primary wallet class isUTEXOWallet. Initialise it with a mnemonic and a configuration object, then call await wallet.initialize() before use.
getBtcBalance() returns separate balance objects for each path (vanilla and colored), each containing:
Networks
Pass the identifier string in the
network field of the init config. utexo is the default environment for development and testing.
Utexo Network Faucet — To get test BTC and RGB assets on the Utexo network, use the Telegram bot @Utexo_RLN_bot.
Limited to 2 requests per 24 hours per user.
Vanilla vs Colored Addresses
The SDK maintains two separate derivation paths:- Vanilla — the standard Bitcoin path.
getAddress()returns a vanilla bech32 receive address used for on-chain BTC funding, withdrawals, and fee payments. - Colored — the RGB-specific path. Colored outputs anchor RGB asset allocations to Bitcoin UTXOs. This path is used internally by
createUtxos()and all RGB transfer operations.
getXpub() returns both:
accountXpubVanilla— the extended public key for the vanilla (BTC) derivation pathaccountXpubColored— the extended public key for the colored (RGB) derivation path
getBtcBalance() returns separate balance objects for each path, each containing:
settled— confirmed, final balancefuture— expected balance after pending operations confirmspendable— currently usable amount for new operations
Vanilla vs Colored Addresses
The wallet manages two address types:- Vanilla — Standard Bitcoin addresses for receiving on-chain BTC. Also used as the change address for Bitcoin transactions that anchor RGB state transitions.
- Colored — Addresses associated with UTXOs that hold RGB asset allocations. These UTXOs are reserved exclusively for RGB state transitions and should not be spent directly as BTC.
Networks
The available environments for thenetwork field in the init config are:
Utexo Network Faucet — To get test BTC and RGB assets on the Utexo network, use the Telegram bot @Utexo_RLN_bot.
Limited to 2 requests per 24 hours per user.
UTXO Management
Before issuing or receiving RGB assets, prepare colored UTXOs:createUtxos({ num, size, up_to? })— Create colored UTXOs (combines begin, sign, end internally)
Asset Methods
listAssets()— List all RGB assets held by the walletgetAsset(assetId)— Get metadata and balance for a specific assetissueAssetNia(params)— Issue a new NIA (Non-Inflatable Asset) RGB assetissueAssetCfa(params)— Issue a new CFA (Collectible) RGB assetblindReceive(params)— Generate a blinded invoice to receive an RGB assetsend(params)— Send RGB assets to a blinded invoicelistTransfers(assetId)— List all transfers for a given assetrefreshWallet()— Sync wallet state with the chain and transport layerfailTransfers(params)— Expire stale pending transfersdeleteTransfers(params)— Remove transfer records
BTC Methods
getAddress()— Get the current vanilla Bitcoin deposit addressgetBtcBalance()— Get the BTC balance (vanilla and colored paths)sendBtc(params, mnemonic?)— Send BTC from the vanilla walletdrainBtc(params, mnemonic?)— Drain the entire vanilla BTC balance to an address
Key Derivation and Backup
generateKeys(network)— Generate a new BIP-39 mnemonic and derive xpubderiveKeysFromMnemonic(network, mnemonic)— Re-derive keys from an existing mnemonicbackup(backupPath, password)— Create an encrypted wallet backuprestore(mnemonic, backupPath, password)— Restore a wallet from a backup file
PSBT Methods
For advanced use cases where signing must happen externally:createUtxosBegin(params)— Create an unsigned PSBT for UTXO creationcreateUtxosEnd(params)— Finalise UTXO creation with a signed PSBTsendBegin(params)— Create an unsigned PSBT for an RGB sendsendEnd(params)— Finalise an RGB send with a signed PSBTsendBtcBegin(params)— Create an unsigned PSBT for a BTC sendsendBtcEnd(params, mnemonic?)— Finalise a BTC send with a signed PSBT
Lightning Methods
createLightningInvoice(params)— Create a standard BOLT11 Lightning invoice for receiving
payLightningInvoiceBegin(params)— Start Lightning payment (returns unsigned PSBT)payLightningInvoiceEnd(params)— Finalise Lightning payment with signed PSBTpayLightningInvoice(params, mnemonic?)— Complete Lightning payment in a single call
lspBaseUrl and lspBearerToken in the wallet init config. The inbound leg (receiving while offline) is fully operational; the outbound leg is in active development.
When LSP integration is configured, recipients receive a stable Lightning Address rather than a per-transfer invoice. The address is provisioned automatically — no additional method calls are required.
getLightningSendRequest(lnInvoice)— Get status of a Lightning send requestgetLightningReceiveRequest(lnInvoice)— Get status of a Lightning receive requestlistLightningPayments()— List all Lightning payments
On-chain Methods
onchainReceive(params)— Generate an invoice for depositing from mainnet to UTEXOonchainSend(params, mnemonic?)— Complete an on-chain withdrawal (begin → sign → end)getOnchainSendStatus(invoice)— Get the status of an on-chain withdrawal
Security
By using this SDK, developers have full control over transfer orchestration, UTXO selection, invoice lifecycle, and signing policy. The SDK supports an external signer architecture: key management can be handled entirely outside the node, keeping signing logic isolated from the rest of the application. This is the recommended approach for custody-grade and enterprise deployments where key isolation is a hard requirement. Private keys and mnemonics should be stored securely and never logged or transmitted. Use environment variables or a secrets manager for mnemonic storage:Further Reading
- SDK Overview — SDK family, key concepts, execution model, and network environments.
- Product Suite — How the SDK fits into the full Utexo product surface.
- Architecture — The Bitcoin + RGB stack the SDK operates on.