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

# Sign transaction

> Attach a witness to a transaction without submitting it

Attaches the provided witness to a transaction without submitting it. Use this endpoint when you want signed transaction CBOR back and plan to submit it separately.

Submit the signed transaction later via [`/submit`](/api-reference/transaction-builder/submit), or use [`/sign-and-submit`](/api-reference/transaction-builder/sign-and-submit) to do both in one call.

**Auth:** Public

## Request body

<ParamField body="cbor" type="string" required>
  Hex-encoded unsigned transaction CBOR.
</ParamField>

<ParamField body="witness" type="string" required>
  Hex-encoded transaction witness-set CBOR.
</ParamField>

<ParamField body="changeAddress" type="string" required>
  Bech32 change address.
</ParamField>

## Response

<ResponseField name="cbor" type="string">
  Signed transaction CBOR, ready to submit.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://builder.snek.fun/sign \
    --header 'Content-Type: application/json' \
    --data '{
      "cbor": "84a500...",
      "witness": "...",
      "changeAddress": "addr1..."
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "cbor": "84a500..."
  }
  ```
</ResponseExample>

## Error response

<ResponseField name="cause" type="string">
  Machine-readable error code.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable error message.
</ResponseField>

Possible errors:

* `400 INVALID_PARAMS` — one or more required fields are missing or have the wrong type.
* `500 SERVER_ERROR` — the transaction CBOR or witness CBOR could not be processed.

<ResponseExample>
  ```json 400 theme={null}
  {
    "cause": "INVALID_PARAMS",
    "message": "Invalid input"
  }
  ```
</ResponseExample>
