> For the complete documentation index, see [llms.txt](https://docs.stacks.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stacks.co/reference/stacks.js/stacks-bitcoin-staking/types/utxo.md).

# Utxo

A confirmed Bitcoin output in the Esplora and mempool.space shape (`txid`, `vout`, `value`). [BuildReclaimOpts](/reference/stacks.js/stacks-bitcoin-staking/reclaim/buildreclaimopts.md) takes it as `utxo`, the L1 lockup output that [buildReclaim](/reference/stacks.js/stacks-bitcoin-staking/reclaim/buildreclaim.md) spends.

***

### Usage

```ts
import { buildReclaim } from '@stacks/bitcoin-staking';

const tx = buildReclaim({
  path: 'locktime',
  utxo: {
    txid, // display (big-endian) hex, as shown by explorers
    vout: 0,
    value: 100_000_000n, // sats
  },
  network: 'mainnet',
  output: { address: 'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4', feeSats: 2_000n },
  lockScript: meta.lockScript, // from buildRegisterMetadata
});
```

#### Notes

* If you pass `scriptPubKey`, `buildReclaim` compares it with the P2WSH script derived from `lockScript` and on a mismatch throws an `Error` whose message starts with `buildReclaim: utxo.scriptPubKey does not match the lockScript`. Omit it and the derived script is used.

[**Reference Link**](https://github.com/stx-labs/stacks.js/blob/6101c99efe5a9616ce7e16cef68e28fd10676e7e/packages/bitcoin-staking/src/types.ts#L344-L359)

***

### Definition

```ts
export interface Utxo {
  /** Funding transaction id (display / big-endian hex). */
  txid: string;
  /** Output index within the funding transaction. */
  vout: number;
  /** Output value, in sats. */
  value: IntegerType;
  /** Output `scriptPubKey` bytes, if known. Optional: re-derived when omitted. */
  scriptPubKey?: Uint8Array;
}
```

***

### Properties

| Property       | Type                    | Description                                               |
| -------------- | ----------------------- | --------------------------------------------------------- |
| `txid`         | `string`                | Funding transaction ID, display (big-endian) hex          |
| `vout`         | `number`                | Output index in the funding transaction                   |
| `value`        | `IntegerType`           | Output value in sats                                      |
| `scriptPubKey` | `Uint8Array` (optional) | Output script, used as a cross-check against `lockScript` |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stacks.co/reference/stacks.js/stacks-bitcoin-staking/types/utxo.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
