> 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/signer/buildsignercalldata.md).

# buildSignerCalldata

Encodes a Bitcoin payout address and a maximum fee into the `signerCalldata` bytes that [buildStake](/reference/stacks.js/stacks-bitcoin-staking/build/buildstake.md), [buildStakeUpdate](/reference/stacks.js/stacks-bitcoin-staking/build/buildstakeupdate.md), [buildRegisterForBond](/reference/stacks.js/stacks-bitcoin-staking/build/buildregisterforbond.md) and [buildUpdateBondRegistration](/reference/stacks.js/stacks-bitcoin-staking/build/buildupdatebondregistration.md) pass to the signer-manager. Pure computation.

***

### Usage

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

const signerCalldata = buildSignerCalldata({
  poxAddress: 'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4',
  maxFeeSats: 1_000n,
  network: 'mainnet',
});
```

#### Notes

* The bytes are the Clarity serialization of `{ pox-addr: { version, hashbytes }, max-fee }`.
* pox-5 does not read them. It forwards them to the signer-manager's `validate-stake!` as an `(optional (buff 500))` ([pox-5.clar L392-L427](https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/stackslib/src/chainstate/stacks/boot/pox-5.clar#L392-L427)), so what they do depends on the signer-manager. The SDK documents this format as an election of an L1 BTC payout to `poxAddress`; omitting `signerCalldata` keeps the sBTC payout.
* pox-5 does not validate the address, so a wrong but well-formed address is accepted on-chain. Decode the bytes with [parseSignerCalldata](/reference/stacks.js/stacks-bitcoin-staking/signer/parsesignercalldata.md) to check them before you build.
* A string `poxAddress` must be a P2PKH, P2SH, P2WPKH, P2WSH or P2TR address, or the function throws. With `network`, an address from another network throws, for example a `bc1` address with `network: 'testnet'`. Without `network`, any network's address is accepted.
* A [BtcAddressRepr](/reference/stacks.js/stacks-bitcoin-staking/btcaddress/btcaddressrepr.md) `poxAddress` must have a known version and the matching `data` length, or the function throws.

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

***

### Signature

```ts
function buildSignerCalldata(opts: SignerCalldataL1Payout): Uint8Array;
```

`opts` is a [SignerCalldataL1Payout](/reference/stacks.js/stacks-bitcoin-staking/types/signercalldatal1payout.md).

***

### Returns

`Uint8Array`

The serialized Clarity tuple.

***

### Parameters

#### opts.poxAddress (required)

* **Type**: `string | BtcAddressRepr`

Bitcoin address to pay rewards to, as an address string or a parsed [BtcAddressRepr](/reference/stacks.js/stacks-bitcoin-staking/btcaddress/btcaddressrepr.md).

#### opts.maxFeeSats (required)

* **Type**: `IntegerType`

Largest sBTC fee, in sats, the staker accepts on the L1 BTC withdrawal.

#### opts.network (optional)

* **Type**: `StacksNetworkName | StacksNetwork`

When `poxAddress` is a string, the network it must belong to. Omit it to accept any network's address.


---

# 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/signer/buildsignercalldata.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.
