



`@ckb-ccc/utxo-global` integrates [UTXO Global](https://utxo.global/) into CCC, providing `Signer` implementations for CKB, Bitcoin, and Dogecoin. UTXO Global is a multi-chain browser extension wallet that supports native CKB transaction signing as well as cross-chain signing from BTC and DOGE.

<Callout type="info">
  If you're using `@ckb-ccc/connector-react` or `@ckb-ccc/ccc`, UTXO Global is already included — no separate installation needed.
</Callout>

## Installation [#installation]

<PackageBadges pkg="@ckb-ccc/utxo-global" />

<Tabs items="['npm', 'yarn', 'pnpm']">
  <Tab value="npm">
    ```bash
    npm install @ckb-ccc/utxo-global
    ```
  </Tab>

  <Tab value="yarn">
    ```bash
    yarn add @ckb-ccc/utxo-global
    ```
  </Tab>

  <Tab value="pnpm">
    ```bash
    pnpm add @ckb-ccc/utxo-global
    ```
  </Tab>
</Tabs>

**Dependencies:**

| Package         | Description                                              |
| --------------- | -------------------------------------------------------- |
| `@ckb-ccc/core` | Base types — `Signer`, `Client`, `Transaction`, and more |

## Architecture [#architecture]

`@ckb-ccc/utxo-global` provides three separate signers from a single provider injection at `window.utxoGlobal`:

<Mermaid
  chart="graph TB
    subgraph &#x22;UTXO Global Package&#x22;
        GUGS[&#x22;getUtxoGlobalSigners(client)&#x22;]
        SC[&#x22;SignerCkb&#x22;]
        SB[&#x22;SignerBtc&#x22;]
        SD[&#x22;SignerDoge&#x22;]
    end

    subgraph &#x22;Provider (window.utxoGlobal)&#x22;
        CKB[&#x22;ckbSigner&#x22;]
        BTC[&#x22;bitcoinSigner&#x22;]
        DOGE[&#x22;dogeSigner&#x22;]
    end

    subgraph &#x22;Core&#x22;
        CoreS[&#x22;ccc.Signer&#x22;]
        CoreBtc[&#x22;ccc.SignerBtc&#x22;]
        CoreDoge[&#x22;ccc.SignerDoge&#x22;]
    end

    GUGS -->|&#x22;creates&#x22;| SC
    GUGS -->|&#x22;creates&#x22;| SB
    GUGS -->|&#x22;creates&#x22;| SD

    SC -->|&#x22;extends&#x22;| CoreS
    SB -->|&#x22;extends&#x22;| CoreBtc
    SD -->|&#x22;extends&#x22;| CoreDoge

    SC -->|&#x22;calls&#x22;| CKB
    SB -->|&#x22;calls&#x22;| BTC
    SD -->|&#x22;calls&#x22;| DOGE"
/>

### Entry point: `getUtxoGlobalSigners` [#entry-point-getutxoglobalsigners]

`getUtxoGlobalSigners(client, preferredNetworks?)` checks for `window.utxoGlobal` and returns a `SignerInfo[]` array with all three signers — or an empty array if the wallet isn't available:

<Mermaid
  chart="graph TD
    Start[&#x22;getUtxoGlobalSigners(client)&#x22;] --> Check[&#x22;window.utxoGlobal exists?&#x22;]
    Check -->|No| Empty[&#x22;return []&#x22;]
    Check -->|Yes| Create[&#x22;Create three SignerInfo entries&#x22;]

    Create --> CKB[&#x22;SignerCkb (name: 'CKB')&#x22;]
    Create --> BTC[&#x22;SignerBtc (name: 'BTC')&#x22;]
    Create --> DOGE[&#x22;SignerDoge (name: 'DOGE')&#x22;]

    CKB --> Array[&#x22;SignerInfo[]&#x22;]
    BTC --> Array
    DOGE --> Array"
/>

## Supported signer types [#supported-signer-types]

| Signer Class | Base Type        | Chain    | SignerType |
| ------------ | ---------------- | -------- | ---------- |
| `SignerCkb`  | `ccc.Signer`     | CKB      | `CKB`      |
| `SignerBtc`  | `ccc.SignerBtc`  | Bitcoin  | `BTC`      |
| `SignerDoge` | `ccc.SignerDoge` | Dogecoin | `Doge`     |

### CKB signer [#ckb-signer]

`SignerCkb` provides native CKB signing — no cross-chain address derivation needed. It calls `signTransaction()` on the provider directly.

### BTC and Doge signers [#btc-and-doge-signers]

`SignerBtc` and `SignerDoge` extend their respective cross-chain base classes. They derive CKB addresses from Bitcoin/Dogecoin public keys and sign CKB transaction witnesses using the respective chain's signing scheme.

## Account change detection [#account-change-detection]

All three signers implement `onReplaced()`:

* Listens for `"accountsChanged"` — user switched account
* Listens for `"networkChanged"` — user switched network

When either fires, the application callback is invoked and listeners are cleaned up.

## Provider interface [#provider-interface]

All three sub-providers (`ckbSigner`, `bitcoinSigner`, `dogeSigner`) share the same interface:

| Method                      | Description                                   |
| --------------------------- | --------------------------------------------- |
| `requestAccounts()`         | Prompt user to connect and return accounts    |
| `getAccount()`              | Get connected accounts                        |
| `getPublicKey()`            | Get address and public key pairs              |
| `connect()`                 | Establish connection                          |
| `isConnected()`             | Check connection status                       |
| `signMessage(msg, address)` | Sign a message                                |
| `signTransaction(tx)`       | Sign a full CKB transaction (CKB signer only) |
| `getNetwork()`              | Get current network                           |
| `switchNetwork(network)`    | Switch network                                |

## Integration pattern [#integration-pattern]

`@ckb-ccc/utxo-global` follows the same integration contract as every other wallet package in CCC:

* **Factory function** — `getUtxoGlobalSigners` returns a `SignerInfo[]` array.
* **Provider detection** — checks for `window.utxoGlobal` before creating signers.
* **Graceful degradation** — returns an empty array when the wallet is unavailable.

## References [#references]

* [UTXO Global Website](https://utxo.global/)


---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ckbccc.com/llms.txt
> Use this file to discover all available pages before exploring further.
