# Xverse Developer Documentation

## Build on Bitcoin with Xverse

[Xverse](https://www.xverse.app/) is the Bitcoin super-app trusted by nearly 2 million users — built for payments, trading, earning, and borrowing across Bitcoin, Lightning, [Spark](https://www.spark.money/), [Starknet](https://www.starknet.io/), and [Stacks](https://www.stacks.co/).&#x20;

The infrastructure behind it is now open to developers.

Whether you're building a Bitcoin app, a data service, or an AI agent, Xverse gives you the tools to ship on Bitcoin and Bitcoin layers without running your own nodes, indexers, or infrastructure.

## What are you building?

### **Xverse API** - The Data Layer for Bitcoin Apps

{% columns %}
{% column %}
REST APIs for real-time and historical Bitcoin data — no node, no indexer, no custom infrastructure required.&#x20;

* Bitcoin RPC, mempool, UTXOs, and balances.
* Portfolio indexing, analytics, and market data for Bitcoin, Spark, Starknet, Stacks.
* Ordinals, Runes, BRC-20, and inscription services.
* Swap aggregation across Bitcoin AMMs and Bitcoin L2s.

<a href="https://app.gitbook.com/s/itFugh7txAO3gqbz7AUt/" class="button primary" data-icon="rocket-launch">Get started</a> <a href="https://app.gitbook.com/s/itFugh7txAO3gqbz7AUt/mcp-server" class="button secondary" data-icon="robot">MCP server</a>
{% endcolumn %}

{% column %}
{% code title="" overflow="wrap" %}

```http
GET /v2/bitcoin/address/{address}/utxo HTTP/1.1
Host: api.secretkeylabs.io
x-api-key: YOUR_API_KEY
Accept: */*

```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

***

### **Sats Connect -** The Wallet SDK for Bitcoin Apps

{% columns %}
{% column %}
Build apps that connect to users' Bitcoin wallets. Send transactions, request signatures, and interact with the full Bitcoin asset stack — BTC, Ordinals, Runes, BRC-20, Spark, Stacks, and Starknet.

* Bitcoin PSBTs, transfers, and message signing.
* Ordinals, Runes, and BRC-20 operations.
* Spark, Stacks, and Starknet support.
* \~2 million downloads. Used by leading BitcoinFi apps.

<a href="https://app.gitbook.com/s/33DLypUqgcjkBSmN0gZn/" class="button primary" data-icon="rocket-launch">Get started</a> <a href="https://app.gitbook.com/s/33DLypUqgcjkBSmN0gZn/ai-agent-integration" class="button secondary" data-icon="robot">AI Agent integration</a>
{% endcolumn %}

{% column %}
{% code title="index.js" overflow="wrap" %}

```javascript
import {
  request,
  BitcoinNetworkType,
  RpcErrorCode,
} from "sats-connect";
    
try {
  const response = await request('signPsbt', {
    psbt: psbtBase64,
    signInputs: {
      "1ef9...Jn1r": [0],
      "bc1p...ra4w": [1,2],
    },
  });

```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

***

### **Xverse Agent Wallet -** The Agent Economy on Bitcoin Rails

{% columns %}
{% column width="50%" %}
Give your AI agent a Bitcoin-native wallet that can pay, receive, and trade programmatically across Lightning, Spark, and Starknet. No custodian, no permissions to ask for, and no infrastructure to run.

* ⚡ **Pay and get paid on Lightning** request invoices, settle instantly, sub-cent fees. The natural primitive for any agent that needs to charge for or consume a service on Bitcoin rails.
* 🔲 **Trade Runes & Ordinals** directly from the agent, no intermediary.
* 🌐 **Trade on Starknet** — Bitcoin assets, stables, RWAs with high throughput & low fees.
* ⚡ **Trade on Flashnet** via Spark — the cheapest way to move Bitcoin assets.

<a href="https://app.gitbook.com/s/XwQ2KXDgVEBqmKTm7QqN/#the-first-bitcoin-native-wallet-built-for-ai-agents" class="button primary" data-icon="rocket-launch">Get started</a> <a href="https://app.gitbook.com/s/XwQ2KXDgVEBqmKTm7QqN/agent-mode" class="button secondary" data-icon="robot">Agent Mode</a>
{% endcolumn %}

{% column width="50%" %}
{% code title="johndoe\@john-mbp \~ %" overflow="wrap" %}

```bash
xverse [my-agent.com] mainnet:0> --agent my-agent.com bitcoin balance

BTC Balance:

+------------------+-----------+-------------+
| Address Type     | Confirmed | Unconfirmed |
+------------------+-----------+-------------+
| Native Segwit    | 0.1823    | 0.0000      |
| Taproot          | 0.0412    | 0.0050      |
+------------------+-----------+-------------+
| Total            | 0.2235    | 0.0050      |
+------------------+-----------+-------------+


```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

## Not sure where to start?

| I want to…                                         | Use this                                                                                                                             |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| Let users connect their wallet to my app           | [Sats Connect](https://app.gitbook.com/s/33DLypUqgcjkBSmN0gZn/)                                                                      |
| Request transaction signatures from my users       | [Sats Connect](https://app.gitbook.com/s/33DLypUqgcjkBSmN0gZn/)                                                                      |
| Query balances, UTXOs, or mempool data server-side | [Xverse API](https://app.gitbook.com/s/itFugh7txAO3gqbz7AUt/)                                                                        |
| Fetch Ordinals, Runes, or BRC-20 data              | [Xverse API](https://app.gitbook.com/s/itFugh7txAO3gqbz7AUt/)                                                                        |
| Get market data or floor prices                    | [Xverse API](https://app.gitbook.com/s/itFugh7txAO3gqbz7AUt/)                                                                        |
| Give my AI agent a Bitcoin wallet to pay and trade | [Agent Wallet](https://app.gitbook.com/s/XwQ2KXDgVEBqmKTm7QqN/#the-first-bitcoin-native-wallet-built-for-ai-agents)                  |
| Use Bitcoin data inside Claude or Cursor           | [MCP Server](https://app.gitbook.com/s/itFugh7txAO3gqbz7AUt/mcp-server)                                                              |
| Build a full-stack Bitcoin app                     | Both [Xverse API](https://app.gitbook.com/s/itFugh7txAO3gqbz7AUt/) + [Sats Connect](https://app.gitbook.com/s/33DLypUqgcjkBSmN0gZn/) |

## Developer resources

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><h4><i class="fa-discord">:discord:</i></h4></td><td><strong>Discord community</strong></td><td>Post questions, feature requests, get help, and share resources with other developers.</td><td><a href="https://discord.gg/tN84HhSDrz" class="button secondary">Join Discord</a></td><td></td></tr><tr><td><h4><i class="fa-github">:github:</i></h4></td><td><strong>GitHub</strong></td><td>Check out our GitHub repository and submit your first PR.</td><td><a href="https://github.com/secretkeylabs" class="button secondary">Go to Github</a></td><td></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xverse.app/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
