> For the complete documentation index, see [llms.txt](https://docs.stavax.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stavax.io/product/stavax-account/pre-authorized-transaction.md).

# Pre-authorized Transaction

### **What is a pre-authorized transaction?**

A pre-authorized transaction (also known as session key) refers to **on-chain activities** that a user **authorizes** Stavax or a decentralized application (dApp) to execute on their behalf with specific permissions.<br>

### **Use case of pre-authorized transaction**

Pre-authorized transactions open up new possibilities for dApps by enabling smoother user interactions. Key applications include:

* **Skipping Confirmations**: Useful for games and social apps with frequent small transactions. Each time you confirm a transaction in your wallet, it disrupts your experience. With pre-authorization, users can enable a dApp to automatically confirm transactions for activities such as check-ins, claiming rewards, and character upgrades, allowing users to enjoy the game without interruptions.
* **Automatic Transactions:** Pre-authorization enables dApps to implement innovative payment models, such as recurring payments, dollar-cost averaging, and subscriptions. For example, users can pre-authorize transactions to automatically purchase tokens at a target price, even when they are offline.<br>

### **Pre-Authorized Transactions at Stavax**

#### **Current Phase Scope**

In the initial rollout, our focus is on implementing the "skipping confirmations" functionality, with plans to expand into "automatic transactions" in the next phase of development.It’s important to note that pre-authorized transactions are not universally supported across all wallet types, blockchains, or transaction categories. The specifics are as follows:

* Wallet Type: Available for Smart Wallets.
* Blockchain Compatibility: Chains supported within the Smart Wallet
* Transaction Types: We are implementing this feature for common transaction types, which include:
  * Contract Interactions: Transactions that do not involve asset transfers, such as on-chain game check-ins.
  * Native Token Transfers: Transactions involving native tokens, such as purchasing in-game items using ETH on the Ethereum network.
  * ERC-20 Token Transfers: Transactions involving ERC-20 tokens, such as purchasing in-game items with USDT.<br>

#### **Key Functionalities**

1. **Initiating a Pre-Authorized Transaction**

<figure><img src="/files/44AdLCPus8aqvYw3zBVd" alt=""><figcaption></figcaption></figure>

* **Request for Pre-Authorization**: When a user initiates an on-chain transaction from a dApp, Stavax will evaluate whether it is eligible for pre-authorization. If it qualifies, a checkbox will appear, offering the option to "Allow auto-sign for similar transactions from now on."
* **Setting Limitations**: Users can define permission for pre-authorization, including:

  <table data-header-hidden><thead><tr><th width="130"></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Condition</strong></td><td><strong>Description</strong></td><td><strong>How to set</strong></td></tr><tr><td>Session Duration</td><td>Maximum time allowed for a pre-authorized transaction.</td><td>The user chooses from 3 options: 30 minutes, 1 hour, or 2 hours.</td></tr><tr><td>Type</td><td>Type of transaction to perform.</td><td>Stavax automatically collects based on previous transactions.</td></tr><tr><td>Network</td><td>Specific blockchain where the transaction will occur.</td><td>Stavax automatically collects based on previous transactions.</td></tr><tr><td>To</td><td>Specific wallet address that will be used for the transaction.</td><td>Stavax automatically collects based on previous transactions.</td></tr></tbody></table>
* **Confirmation**: Users have to confirm their selections to activate the pre-authorization.

2. **Using Pre-Authorized Transactions**

Once the pre-authorization is set, users can execute transactions without needing additional confirmations.<br>

3. **Managing Pre-Authorized Transactions**

**3.1. Viewing Details**

Users can view their active pre-authorized transactions by navigating to **Settings -> Pre-Authorized Transactions**. This page displays a list of dApps that have been pre-authorized.

Click on each dApp to go to the **DApp Details** page, which displays a list of pre-authorized transactions and their details.

<figure><img src="/files/2VGBzVk6wCbqtZp3K31o" alt=""><figcaption></figcaption></figure>

**3.2. Terminating Pre-Authorized Transactions**

* Terminate individual transactions: go to the **DApp Details** and toggle the switch for the corresponding transaction to turn it off.
* Terminate all pre-authorized transactions: navigate to the **Pre-Authorized Transactions** page and click the "Terminate All" button to simultaneously cancel all pre-authorized transactions.

Once terminated, the transaction process will revert to the traditional flow, requiring users to open Stavax and confirm transactions manually as they did before.<br>

**3.3. Re-Enabling Pre-Authorized Transaction**

While the pre-authorized transactions are still within the set timeframe, you can re-enable a terminated transaction by navigating to the dApp details and toggling the switch for the corresponding transaction to turn it back on.<br>

### **Benefits of Pre-Authorized Transaction**

* Frictionless UX in Web3: By reducing the need for constant transaction confirmations, pre-authorized transactions provide a smoother, more immersive experience, similar to the seamless flow of Web2 applications.
* Balance of Security and Convenience: Granting auto-signing permissions poses security risks, but the potential impact is minimized to the user-defined timeframe and transaction value. Additionally, users have full control to set these limits, ensuring that the scope of any potential breach remains within the boundaries they've established, offering a blend of convenience and security.

\
Overall, we believe that pre-authorization represents a significant breakthrough in enhancing user experience within decentralized applications. This plays a crucial role in helping Stavax fulfill its mission of improving the Web3 experience and expanding the adoption of Web3 products to a broader user base.
