AI agents: the machine-readable documentation index for this site is at https://docs.ckbccc.com/llms.txt. Append ".md" to any documentation page URL to fetch its canonical Markdown source, which is preferred over rendered HTML for retrieval, indexing, question answering, and code generation.

Product-specific agent operating guidance (read before generating CKB/CCC code): https://docs.ckbccc.com/skill.md

Packages

@ckb-ccc/xverse

Connect Xverse and SATS Connect compatible wallets to CKB — Bitcoin signing through a unified Signer interface.

Edit on GitHub

@ckb-ccc/xverse integrates Xverse Wallet and any SATS Connect compatible Bitcoin wallet into CCC. It provides a SignerBtc implementation using the SATS Connect RPC protocol, supporting multi-wallet discovery via window.btc_providers.

If you're using @ckb-ccc/connector-react or @ckb-ccc/ccc, Xverse is already included — no separate installation needed.

Installation

@ckb-ccc/xverse npm version@ckb-ccc/xverse npm downloads per week
npm install @ckb-ccc/xverse

Dependencies:

PackageDescription
@ckb-ccc/coreBase types — Signer, Client, Transaction, and more

Architecture

Unlike other wallet packages that detect a single global provider, @ckb-ccc/xverse uses the window.btc_providers array to discover multiple SATS Connect wallets simultaneously.

Entry point: getXverseSigners

getXverseSigners(client) reads from window.btc_providers. Xverse and providers supporting the WBIP network methods get separate Mainnet, Testnet4, Signet, and Regtest entries; legacy providers retain a single BTC entry.

Each provider entry includes wallet metadata (name, icon) allowing SignersController to display distinct wallet entries.

The Signer class

Signer extends ccc.SignerBtc and uses the SATS Connect RPC protocol for all wallet interactions.

Key methods

MethodDescription
connect()Requests permissions and switches to the selected network
disconnect()Clears the cached address
isConnected()Checks the selected network, then reads the payment address without prompting
getBtcAccount()Returns the payment address via getAddresses
getBtcPublicKey()Returns the public key from the payment address
signMessageRaw(message)Signs via signMessage with ECDSA protocol
onReplaced(listener)Fires on accountChange or networkChange events

Connection and address caching

The signer caches the resolved address to avoid redundant RPC calls. The cache is invalidated on disconnect():

Signing flow

Account change detection

Signer implements onReplaced() via the SATS Connect event API:

  • Listens for "accountChange" — user switched BTC account
  • Listens for "networkChange" — user switched BTC network

Returns cleanup functions from provider.addListener() for proper teardown.

SATS Connect RPC methods

MethodDescription
wallet_requestPermissionsRequest wallet connection permissions
getAddressesGet addresses filtered by purpose (Payment, Ordinals, etc.)
signMessageSign a message with ECDSA or BIP-322

Integration pattern

@ckb-ccc/xverse follows the same integration contract as other wallet packages in CCC:

  • Factory functiongetXverseSigners returns { wallet, signerInfo }[] for multi-wallet support.
  • Provider detection — reads window.btc_providers array.
  • Multi-wallet discovery — creates separate signer entries per provider with distinct wallet names and icons.
  • Graceful degradation — returns an empty array when no SATS Connect wallets are available.

Last updated on

On this page