> For the complete documentation index, see [llms.txt](https://docs-legacy.dfns.co/d/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-legacy.dfns.co/d/api-docs/keys/generate-signature/iota.md).

# IOTA

IOTA supports the following signature `kinds`:

* `Transaction`, unsigned transaction.

## Transaction

Signs an unsigned transaction.

| Field            | Description                                          | Type - Optiional |
| ---------------- | ---------------------------------------------------- | ---------------- |
| `blockchainKind` | `Iota`                                               | String           |
| `kind`           | `Transaction`                                        | String           |
| `transaction`    | The unsigned hex encoded transaction as shown below. | String           |

```json
{
  "blockchainKind": "Iota",
  "kind": "Transaction",
  "transaction": "0x00000200080100000000000000002044732583a657f2d13bce82acc611e5ea6424508036f27e3a3277f24f55f9bfc60202000101000001010300000000010100b8737aab95b5d62407a921c23d26f28cd94da2df511276693a5cba782ae640ee01122efbd2244535c134ab802ad247b3ece73641e7ea8169b199bb6fa644af3ef32ffa94070000000020608d3f1e7023d0947f8274db06898744fadb3598769f8463070536ce489ca336b8737aab95b5d62407a921c23d26f28cd94da2df511276693a5cba782ae640eee803000000000000e06f3c000000000000"
}
```

{% hint style="info" %}
IOTA does not have a serialized format for a signed transaction. The response only includes the signature. You must package it correctly before calling `iota_executeTransactionBlock`.
{% endhint %}

### Typescript Example with IOTA SDK <a href="#typescript-example" id="typescript-example"></a>

First install the IOTA SDK. You can find the full documentation here: <https://docs.iota.org/developer/ts-sdk/typescript/>

Here a code sample to generate a signature via [the Dfns TypeScript SDK](https://github.com/dfns/dfns-sdk-ts):

```typescript
import { IotaClient } from '@iota/iota-sdk/client'
import { Transaction } from '@iota/iota-sdk/transactions'

const walletId = 'wa-4to1j-8tho9-xxxxxxxxxxxxxxxx'
const wallet = await dfnsClient.wallets.getWallet({ walletId })

const client = new IotaClient({ url: process.env.IOTA_RPC_URL! })

const transaction = new Transaction()
const [coin] = transaction.splitCoins(transaction.gas, [1])
transaction.transferObjects([coin], '0xb8737aab95b5d62407a921c23d26f28cd94da2df511276693a5cba782ae640ee')
transaction.setSender(wallet.address!)
const bytes = await transaction.build({ client })

const res = await dfnsClient.wallets.generateSignature({
  walletId,
  body: {
    kind: 'Transaction',
    transaction: `0x${Buffer.from(bytes).toString('hex')}`,
  },
})
```


---

# 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 dynamically by asking a question.

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

```
GET https://docs-legacy.dfns.co/d/api-docs/keys/generate-signature/iota.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
