TheDocumentation Index
Fetch the complete documentation index at: https://utexo-e7ed9bd0-feat-faucet-bot.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
@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.
lspBaseUrl and lspBearerToken are optional. Omitting them has no effect on synchronous payment flows — async payment capability is strictly opt-in.
Networks
| Environment | Identifier | RGB Transport Endpoint | Bitcoin Indexer |
|---|---|---|---|
| Mainnet | mainnet | rpcs://rgb-proxy-mainnet.utexo.com/json-rpc | ssl://electrum.iriswallet.com:50003 |
| Testnet | testnet | rpcs://rgb-proxy-testnet3.utexo.com/json-rpc | ssl://electrum.iriswallet.com:50013 |
| Utexo (Signet) | utexo | rpcs://rgb-proxy.utexo.com/json-rpc | https://esplora-api.utexo.com |
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.
| Command | Description |
|---|---|
/getbtc | Send your Bitcoin address to receive test satoshis |
/getasset | Send an RGB invoice to receive test RGB assets |
/getinvoice | Get an RGB Lightning invoice to test paying |
/getnodeinfo | Get the faucet node URI, asset ID, and ticker |
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
Address Rotation
By default, each call togetAddress() rotates to a new receive address (new HD derivation index). This improves privacy by reducing address reuse and matches HD wallet best practices. If your application requires a stable deposit address, persist one generated address and reuse it in your UI or service layer.
Wallet Methods
Key Generation and Derivation
generateKeys(network?)— Generate new wallet keys. Returns mnemonic,xpub,xpriv,accountXpubVanilla, andaccountXpubColored.deriveKeysFromMnemonic(network, mnemonic)— Derive wallet keys from an existing BIP39 mnemonicderiveKeysFromSeed(network, seed)— Derive wallet keys from a BIP39 seedrestoreKeys(network, mnemonic)— Legacy alias forderiveKeysFromMnemonicgetXpub()— Get vanilla and colored xpubs (accountXpubVanilla,accountXpubColored)getXprivFromMnemonic(network, mnemonic)— Derive the extended private key (xpriv) from a mnemonic. Treat with the same sensitivity as the mnemonic itself.
Wallet State
getAddress()— Get a receive address; rotates to a new HD index on each call for privacygetBtcBalance()— Get on-chain BTC balance split byvanillaandcoloredpaths, each withsettled,future,spendablerefreshWallet()— Update RGB transfer state (consignments and transfer status progression)syncWallet()— Update chain and UTXO state (funding confirmations, spendable BTC)listUnspents()— List unspent UTXOslistAssets()— List RGB assets held in the walletgetAssetBalance(assetId)— Get balance for a specific RGB assetlistTransactions()— List BTC-level transactionslistTransfers(assetId?)— List RGB transfer history. Transfer statuses:WaitingCounterparty,WaitingConfirmations,Settled,Faileddispose()— Clean up wallet resources
Use
syncWallet() after funding or UTXO creation to update chain state. Use refreshWallet() after send() to update RGB transfer status on both sender and receiver sides.Backup and Restore
Backups are recommended after every significant state change: UTXO creation, asset issuance, and transfers.File Backup
Creates an encrypted local backup containing bothlayer1 and utexo state files.
VSS Backup
Pushes wallet state to a remote Verifiable Secret Sharing (VSS) server. The backup is keyed to the wallet mnemonic and can be restored on any device.| Method | Description |
|---|---|
createBackup({ backupPath, password }) | Create encrypted local backup |
restoreUtxoWalletFromBackup({ backupPath, password, targetDir }) | Restore wallet from file backup |
vssBackup(config?) | Push wallet state to VSS remote |
vssBackupInfo(config?) | Check backup status on VSS server |
getDefaultVssConfig() | Get deterministic VSS config from mnemonic |
restoreUtxoWalletFromVss({ mnemonic, targetDir, config?, networkPreset }) | Restore wallet from VSS |
Private Key Export
The SDK exposes a utility to derive the extended private key from a mnemonic:RGB Asset Methods
Issue a new Non-Inflationary Asset (NIA) on RGB:Invoice Types: Blinded vs Witness
RGB receive flows support two invoice styles:- Blinded invoice (
blindReceive) — most common flow. The receiver creates a blinded recipient endpoint; the sender pays the invoice directly. Use for standard app-to-app RGB transfers. - Witness invoice (
witnessReceive) — the receiver binds the transfer to witness data. The sender must providewitnessData(at minimumamountSat) insend(). Use when your integration explicitly requires witness-bound receive semantics.
blindReceive({ assetId, amount, minConfirmations?, durationSeconds? })— Generate blinded UTXO invoicewitnessReceive({ assetId, amount, minConfirmations?, durationSeconds? })— Generate witness UTXO invoicesend({ invoice, assetId, amount, witnessData? })— Complete send (begin → sign → end)signPsbt(psbt, mnemonic?)— Sign a PSBT using wallet mnemonic
UTXO Management
Before issuing or receiving RGB assets, the wallet must have colored UTXOs prepared. Create them after funding the vanilla address:createUtxos({ num?, size?, upTo? })— Create colored UTXOs (combines begin, sign, end internally)
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.