# Use Turnkey with ZeroDev (/sdk/v5_3_x/signers/turnkey)

> For the complete documentation index, see [llms.txt](/llms.txt)



<VersionWarning version="5.3.x" />

[Turnkey](https://turnkey.com/) is a key infrastructure provider with a great developer API and a powerful security policy engine.

By combining ZeroDev with Turnkey, you can create **custodial AA wallets** whose security is provided by Turnkey, with powerful functionalities such as sponsoring gas, batching transactions, etc.

## Set up [#set-up]

To use Turnkey with ZeroDev, first create an application that integrates with Turnkey.

* Refer to the [Turnkey documentation site](https://docs.turnkey.com/) for instructions on setting up an application with the Turnkey.
* For a quick start, Turnkey provides examples, available [here](https://docs.turnkey.com/getting-started/examples).

## Integration [#integration]

Integrating ZeroDev with Turnkey is straightforward after setting up the project. Turnkey provides an Externally Owned Account (EOA) wallet to use as a signer with Kernel.

### Create the TurnkeyClient and a Turnkey viem account [#create-the-turnkeyclient-and-a-turnkey-viem-account]

After following the Turnkey documentation, you will have access to a `TurnkeyClient`. An example is shown below:

```typescript
import { TurnkeyClient } from "@turnkey/http";
import { createAccount } from "@turnkey/viem";

// Param options here will be specific to your project.  See the Turnkey docs for more info.
const turnkeyClient = new TurnkeyClient({ baseUrl: '' }, stamper);

const turnkeyAccount = createAccount({
  client: turnkeyClient,
  organizationId: subOrganizationId, // Your subOrganization id
  signWith: signWith, // Your suborganization `signWith` param.
})
```

### Use with ZeroDev [#use-with-zerodev]

Use the WalletClient from Turnkey to create a smart account signer, which can be passed to a validator. For detailed guidance on using a validator, refer to our documentation on [creating accounts](/sdk/v5_3_x/core-api/create-account#api).

```typescript
import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator"
import { KERNEL_V3_1 } from "@zerodev/sdk/constants"
import { walletClientToSmartAccountSigner, ENTRYPOINT_ADDRESS_V07 } from 'permissionless';
import { createWalletClient, createPublicClient } from "viem";
import { polygonAmoy } from 'viem/chains';

// Create a SmartAccountSigner from the turnkeyAccount
const walletClient = createWalletClient({
  account: turnkeyAccount,
  transport: http('https://rpc-amoy.polygon.technology'),
})
const smartAccountSigner = walletClientToSmartAccountSigner(walletClient);

const publicClient = createPublicClient({
  // Use your own RPC provider (e.g. Infura/Alchemy).
  transport: http('https://rpc-amoy.polygon.technology'),
  chain: polygonAmoy,
})

// Pass your `smartAccountSigner` to the validator
const ecdsaValidator = await signerToEcdsaValidator(publicClient, {
  signer: smartAccountSigner,
  entryPoint: ENTRYPOINT_ADDRESS_V07,
  kernelVersion: KERNEL_V3_1
})

// You can now use this ECDSA Validator to create a Kernel account
```
