> For the complete documentation index, see [llms.txt](https://docs.kanalabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kanalabs.io/smart-wallet-sdk/mirai-sdk-the-evm-smart-wallet-and-paymaster/paymaster.md).

# Paymaster

1. **User Transaction Initiation**: A whitelisted user initiates a transaction on the blockchain but does not supply the gas fee.
2. **Paymaster Intervention**: The Paymaster account detects this transaction. It verifies if the user is on the whitelist and the transaction is valid.
3. **Gas Fee Payment**: If the conditions are met, the Paymaster uses its funds to pay the gas fee required for the transaction.
4. **Transaction Completion**: The transaction is processed on the blockchain, thanks to the Paymaster covering the cost.&#x20;

The main advantage of the Paymaster feature is that it removes the burden of gas fees from individual users, especially beneficial in scenarios where users might not have the means or wish to spend their own cryptocurrency on transaction fees. This system is particularly advantageous for companies looking to onboard new users who are unfamiliar with blockchain technology or for applications aiming to provide a more user-friendly experience. By covering transaction fees, companies can encourage more frequent and frictionless interactions on their platform.

<figure><img src="/files/VuzcHF87yuWRTNylkhAv" alt=""><figcaption><p>How gas fees is sponsored using Paymaster in Mirai Smart Wallet</p></figcaption></figure>

<table><thead><tr><th>Methods</th><th>Description</th></tr></thead><tbody><tr><td><p></p><pre class="language-typescript"><code class="lang-typescript">addWhitelist(accountAddress: string, chainId: number): Promise&#x3C;any>
</code></pre></td><td>To add a whitelist using the specified accountAddress and chainId.</td></tr><tr><td><p></p><pre class="language-typescript"><code class="lang-typescript">checkWhitelist(accountAddress: string, sponsorAddress: string, chainId: number)
</code></pre></td><td>To check a whitelist using the specified accountAddress, sponsorAddress and chainId.</td></tr><tr><td><p></p><pre class="language-typescript"><code class="lang-typescript">deposit(amount: string, chainId: number)
</code></pre></td><td>To deposit using the specified amount and chainId.</td></tr><tr><td><p></p><pre class="language-typescript"><code class="lang-typescript">getSponsorBalance(sponsorAddress: string, chainId: number): Promise&#x3C;any>
</code></pre></td><td>To get a sponsor balance using the specified sponsorAddress and chainId.</td></tr><tr><td><p></p><pre class="language-typescript"><code class="lang-typescript">removeWhitelist(accountAddress: string, chainId: number)
</code></pre></td><td>To remove a whitelist using the specified accountAddress, sponsorAddress and chainId.</td></tr></tbody></table>

```typescript
 * @param apiKey - Contact kanalabs to obtain the API key for authentication.
```


---

# 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.kanalabs.io/smart-wallet-sdk/mirai-sdk-the-evm-smart-wallet-and-paymaster/paymaster.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.
