> For the complete documentation index, see [llms.txt](https://koii-network.gitbook.io/getting-started/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://koii-network.gitbook.io/getting-started/microservices-and-tasks/task-development-kit-tdk/using-the-task-namespace/wallet-signatures.md).

# Wallet Signatures

There are three different wallet options that are available to node operators of Koii who want to be able to sign transactions, store, stake, send and receive Koii Tokens on K2. The three wallet options are:

### 1. Main KOII Wallet

As suggested by the name, this is a node operator's main wallet; it is responsible for funding the other wallets with KOII tokens and its signature key is necessary to pay transaction fees in a Koii Task.

### 2. Staking Wallet&#x20;

The primary purpose of this wallet is to stake on Koii tasks. Node operators who wish to run a particular task have to create a staking wallet and fund the staking wallet with their main wallet; tokens in the staking wallet can in turn be used to stake on a Koii task.

### 3. Distribution Wallet&#x20;

The distribution wallet is required if a node needs to submit a distribution list to K2. The node creates and funds the distribution wallet from the main wallet so there can be a rent exemption.

## How Can the Main Wallet Sign Transactions ?

Yes! as you probably already guessed, the Namespace wrapper offers a method that injects the main system wallet as the first signer for making transaction fees payments. The `sendAndConfirmTransactionWrapper` method is in charge of this. <br>

### Wallet Security

This might seem a bit odd - why would a Koii node allow a task to use it's wallet? \
Well, in many cases, a task will need to write records to a blockchain, or to K2 directly (all tasks do this to manage [Gradual Consensus](/getting-started/microservices-and-tasks/what-are-tasks/gradual-consensus.md) flows). Some examples might include bridging, minting NFTs, or other on-chain asset management.&#x20;

In these cases, the task operator can opt into allowing their wallet to be used by a task directly, in exchange for a greater reward. Most tasks of this nature must follow the [whitelisting process](/getting-started/microservices-and-tasks/task-development-guide/task-development-flow/whitelist-task.md), ensuring that the code is properly audited before a task is promoted to the community.

### sendAndConfirmTransactionWrapper Method

The `sendAndConfirmTransactionWrapper` takes in two parameters:

* `transaction` : Endpoint path to append to `namespace`
* `singers`: Other wallets signatures

```javascript
  async sendAndConfirmTransactionWrapper(
    transaction: any,
    signers: any[],
  ): Promise<string> {
    signers = signers.map((e) =>
      Keypair.fromSecretKey(
        Uint8Array.from(Object.values(e._keypair.secretKey)),
      ),
    );
    const response = await sendAndConfirmTransaction(
      this.connection,
      Transaction.from(transaction.data),
      [this.#mainSystemAccount, ...signers],
    );
    return response;
  }
```

Example:

```javascript
     const result = await sendAndConfirmTransactionWrapper(
        this.connection,
        new Transaction().add(instruction),
        [
          this.#mainSystemAccount,
          this.submitterAccountKeyPair,
          this.distributionAccountKeyPair,
        ],
      );
```


---

# 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:

```
GET https://koii-network.gitbook.io/getting-started/microservices-and-tasks/task-development-kit-tdk/using-the-task-namespace/wallet-signatures.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.
