Use Para with ZeroDev
Para offers a signing solution enabling the creation of secure, embedded MPC wallets accessible via email or social login. These wallets, compatible across different applications, offer portability, recoverability, and programmability, eliminating the need for users to establish separate signers or contract accounts for each application.
Set up
To use Para with ZeroDev, first create an application that integrates with Para.
- Refer to the Para documentation site for instructions on setting up an application with the Para.
- For a quick start, Para provides an example hub, available here.
Integration
Integrating ZeroDev with Para is straightforward after setting up the project. Para provides an Externally Owned Account (EOA) wallet to use as a signer with Kernel.
Create the Para object
After following the Para documentation, you will have access to a ParaWeb3Provider
object as shown below:
import Para from "@getpara/web-sdk";
// Param options here will be specific to your project. See the Para docs for more info.
const para = new Para(env, apiKey, opts);
Use with ZeroDev
Use the WalletClient from Para 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.
import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator"
import { KERNEL_V3_1, getEntryPoint } from "@zerodev/sdk/constants"
import { createParaViemClient } from '@getpara/web-sdk';
import { polygonAmoy } from 'viem/chains';
import { createPublicClient } from "viem";
// Follow the Para docs for more instructions on creating the Viem client https://docs.getpara.com/alpha/web/guides/evm/viem#viem-integration
const viemClient = createParaViemClient(para, {
chain: polygonAmoy,
transport: http('https://rpc-amoy.polygon.technology'),
});
const publicClient = createPublicClient({
// Use your own RPC provider (e.g. Infura/Alchemy).
transport: http('https://rpc-amoy.polygon.technology'),
chain: polygonAmoy,
})
// Pass your `viemClient` to the validator
const ecdsaValidator = await signerToEcdsaValidator(publicClient, {
signer: viemClient,
entryPoint: getEntryPoint("0.7"),
kernelVersion: KERNEL_V3_1,
})
// You can now use this ECDSA Validator to create a Kernel account