# Perp Smart Account

Perp v3 uses a Smart Account system based on account abstraction, aka ERC-4337. Perpetual Protocol Smart Account is powered by [ZeroDev](https://zerodev.app/).

<figure><img src="https://3534130831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ft9pvATmvHXBuirxBUKA6%2Fuploads%2FLnRHybYGCcknqDplIbeu%2Fimage.png?alt=media&#x26;token=5e9b59eb-cc1c-4c21-aa0d-ce770c62f3fc" alt=""><figcaption></figcaption></figure>

## tl;dr

Perp Smart Account makes crypto trading so much easier.

* Sign up without needing a wallet
* No wallet credentials to store or backup
* Trade without signing (just tap and confirm)
* No separate network (gas) fees
* All funds are 100% onchain and in your control (non-custodial)

Smart Accounts are created using an email, and an authentication method: Passkey or a web3 wallet. Each Smart Account has its own address (starting with 0x). You cannot use an exising address for the Smart Account.

To log in and perform critical operations (e.g. withdraw) you will need the same email and Passkey/web3 wallet that you used when creating the account.

## Benefits

* User experience
  * Sign up and start trading in seconds - no wallet or complex registration needed
  * Trade with 2 clicks - only sign-up/withdrawal requires your Passkey signature
* Security
  * Wallet credentials (e.g. seed words) are stored securely, protecting you from loss or mistakes
  * Easy account recovery using your [#passkey](#passkey "mention")
  * Easy account migration without exporting/handling private keys
* Leading edge tech
  * Fully client-side solution puts the you in complete control of your wallet
  * Industry-leading implementation from ZeroDev

{% hint style="info" %}
**🤔 Is this even web3 bro?**

Good question. Everyone defines web3 a little differently, but if your definition includes the following

* Non-custodial / not your keys, not your coins
* Permissionless
* Open, public blockchain
* No lock-in / easy migration

then yes, this is web3.

Perp Smart Account uses ERC-4337 account abstraction to create user accounts, leveraging the Kernel wallet from ZeroDev for the implementation. If you have more questions about what all of this means, welcome to [contact-us](https://docs.nekodex.org/nekodex-playground/all-about-perp/contact-us "mention")!
{% endhint %}

## Signup

{% hint style="warning" %}
Nekodex only supports Passkey signup. We want to encourage users to try this new user-friendly option for securing your crypto account.
{% endhint %}

First enter an email address to create an account, then link it to a Passkey or Web3 wallet. The key or wallet will be used to authenticate you and sign for critical operations like sign-up and withdrawals.

{% hint style="info" %}
**Passkey requirements**

🍎 Passkeys are available for all iPhones and iPads from iOS 16 onward.

🤖 Passkeys are available for most Android phones from Android 9\* onward.

Some manufacturers have not added Passkey so be sure to check your device. \*Higher versions of Android may be required for 3rd party applications like Proton Pass.
{% endhint %}

<figure><img src="https://3534130831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ft9pvATmvHXBuirxBUKA6%2Fuploads%2FkUJWD3j98uNYn626mnrA%2Fimage.png?alt=media&#x26;token=db0cb9da-c212-4146-b433-0e37296a9987" alt=""><figcaption></figcaption></figure>

## Session keys <a href="#session-keys" id="session-keys"></a>

ZeroDev's session keys implementation opens the door to a faster, smoother trading experience onchain. A session key is created using your Passkey. The session key lets you  perform low-risk operations like opening and closing trades without having to authenticate again using your Passkey.

#### More benefits

* Using session keys instead of the private-key-backed Passkey means less exposure for the private key.
* Session keys allow easy management of what operations are permitted, and what operations require full Passkey authentication.
* Substantial gas savings compared to verifying Passkey signatures for onchain operations.

## Passkey

[Passkeys](https://docs.zerodev.app/sdk/plugins/passkeys#passkeys) (FIDO credential) are a standard for managing passwords, login credentials and more, using a Passkey-enabled hardware device like your iPhone or Android smartphone.

{% hint style="danger" %}

1. Passkeys on your computer may be difficult or impossible to back up. We do not recommend users to store Passkeys this way unless you know what you are doing. If your Passkey is lost, you will **permanently lose access** to your funds. ☠️
2. Perp Smart Account does not currently support Linux. If you use Linux, please sign in using your phone or a [#web3-wallet](#web3-wallet "mention").
   {% endhint %}

When creating your Perp Smart Account or logging into an existing Smart Account, you can use your device's Passkey for authentication.

Check with your phone manufacturer for information about setting up and using Passkeys on your phone.

* Android: <https://support.google.com/chrome/answer/13168025>
* iOS: <https://support.apple.com/guide/iphone/use-passkeys-to-sign-in-to-apps-and-websites-iphf538ea8d0/ios>

#### Backups

It is important to backup your Passkey in order to maintain access to your Perp Smart Account if your device is lost or broken.

From the ZeroDev docs:

<https://docs.zerodev.app/sdk/plugins/passkeys#how-are-passkeys-sync-ed-and-recovered>

> Synchronization and recovery are both supported natively by Apple and Google:
>
> * With Apple, Passkeys created on one device are synced through iCloud [Keychain](https://support.apple.com/en-us/109016) as long as the user is logged in with their Apple ID. Apple covers both syncing and recovery in "[About the security of passkeys](https://support.apple.com/en-us/102195)". For some additional detail, see this [Q\&A with the passkey team](https://developer.apple.com/news/?id=21mnmxow). Apple's account recovery process is documented in this [support page](https://support.apple.com/en-us/HT204921).
> * With Google, [Google Password Manager](https://passwords.google/) syncs passkeys across devices seamlessly. Google has plans to support syncing more broadly across different operating systems, see this [support summary](https://developers.google.com/identity/passkeys/supported-environments#chrome-passkey-support-summary). Recovery is covered in this FAQ ("[What happens if a user loses their device?](https://developers.google.com/identity/passkeys/faq#what_happens_if_a_user_loses_their_device)"): it relies on Google's overall [account recovery process](https://support.google.com/accounts/answer/7682439?hl=en) because passkeys are attached to Google accounts.

## web3 wallet

If you don't want to use Passkey or do not have access to one, you can use a good old fashioned web3 wallet like a proper OG.

Connect your wallet, e.g. Metamask, and sign the `ValidatorApproved` message to set up your account abstraction wallet. You can verify you are signing the message from this contract:

```
0x884bc49b4af83f77bfce93df4d38c7fd2f916c76
```

This will set up your Perp Smart Account which is ready to be funded and used for trading. You won't need to sign for most operations, which will be controlled using your session key. Critical operations like sign-up & withdrawal will requires a signature from your web3 wallet to re-authenticate you.

## FAQ / Troubleshooting

{% tabs %}
{% tab title="General" %}

* Passkeys are linked to an email and a service like a website (e.g. nekodex.org). Make sure to use the Passkey linked to the email you used to sign up to Nekodex.
* Passkeys are created on one device. If you use a phone and backup the phone using iCloud or Google One, the Passkeys should migrate to the new phone.
* Make sure to use the same device to log in, or migrate as mentioned above. You won't be able to log in using a different Passkey.
* One device can create multiple Passkeys so when you log in, make sure to choose the Passkey you used to create your Nekodex account.
  {% endtab %}

{% tab title="Android" %}

* Google Authenticator App: make sure you have it installed and up to date.
* Bluetooth must be turned on and wifi/mobile data connected.
* Passkeys are saved in your Google account. If you have more than one account, make sure to save the Passkey in the account you want to use.
* If you have many Passkeys, make sure to choose the one linked to your Nekodex account.
* **No Passkeys Available Error**
  * Make sure you have Google Authenticator installed.
  * On your phone, go to Settings > Search for password > Password Manager > see if any Passkeys were created for Nekodex. If Passkeys were created, remove them and try logging into Nekodex again (using your same email).
  * Go to the [Passkey demo site](https://www.passkeys.io/) and make sure everything is working. If Passkeys were created, remove them and try logging into Nekodex again (using your same email).
    {% endtab %}

{% tab title="iOS" %}
We aren't aware of any iOS issues at this time! If you have trouble, please [contact-us](https://docs.nekodex.org/nekodex-playground/all-about-perp/contact-us "mention")
{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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://docs.nekodex.org/nekodex-playground/docs-for-users/trade-perpetual-futures/perp-smart-account.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.
