# ECDSA Signer Integration

The VAULT Wallet uses an ECDSA (Elliptic Curve Digital Signature Algorithm) signer derived from a seed phrase, providing a unified and streamlined user experience across multiple blockchain ecosystems. This seed phrase serves as the foundation for generating private keys, which are used not only for the Ethereum Virtual Machine (EVM) compatible address but also for wallets on other blockchain networks, such as Tron and Solana. This approach allows users to manage assets across different blockchains using the same seed phrase, eliminating the need for multiple wallets and providing a cohesive, user-friendly experience.

The ECDSA signer is a crucial component that enables secure transaction signing. By deriving keys from a single seed phrase, VAULT Wallet provides a consistent and seamless user interface that works across different blockchains, each with their unique requirements. For instance, the same seed phrase can be used to generate keys that are compatible with the Tron blockchain's signature scheme, as well as Solana's ed25519-based signature scheme, bridging the gap between different blockchain architectures.

### This integration of the ECDSA signer brings multiple advantages:

1. **Unified Key Management**: Users only need to remember one seed phrase to manage their accounts across multiple blockchain networks. This significantly reduces the complexity of interacting with various blockchain ecosystems.
2. **Cross-Chain Compatibility**: By utilizing the same seed phrase for Ethereum, Tron, and Solana wallets, the VAULT Wallet offers a highly interoperable experience. Users can seamlessly manage assets and perform transactions across these chains without the need for separate credentials.
3. **Enhanced Security**: The ECDSA-based signing mechanism ensures that private keys are securely derived from the seed phrase, offering robust cryptographic guarantees. This consistency across multiple chains allows users to benefit from a high level of security regardless of which blockchain they are interacting with.
4. **Developer Flexibility**: For developers building on top of VAULT Wallet, the use of a common ECDSA signer simplifies integration with dApps that support multiple blockchain networks. This provides greater flexibility when building cross-chain applications and ensures that user interactions remain secure and straightforward.

Overall, the ECDSA signer derived from the seed phrase is a fundamental building block that aligns with VAULT Wallet's mission of simplifying the management of digital assets across different blockchain networks. It delivers a cohesive and secure experience, empowering users to interact seamlessly with the Web3 ecosystem.\
\
**Code example**

| <p><mark style="color:blue;">import { createKernelAccount, createKernelAccountClient, createZeroDevPaymasterClient } from "@zerodev/sdk"</mark><br><mark style="color:blue;">import { KERNEL\_V3\_1 } from "@zerodev/sdk/constants"</mark><br><mark style="color:blue;">import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator"</mark><br><mark style="color:blue;">import { http, createPublicClient, zeroAddress } from "viem"</mark><br><mark style="color:blue;">import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"</mark><br><mark style="color:blue;">import { sepolia } from "viem/chains"</mark><br><mark style="color:blue;">import { ENTRYPOINT\_ADDRESS\_V07, bundlerActions } from "permissionless"</mark><br><br><mark style="color:blue;">const PROJECT\_ID = '98fd43a8-fb2f-4948-a7ae-069f53969f73'</mark><br><mark style="color:blue;">const BUNDLER\_RPC = `https://rpc.zerodev.app/api/v2/bundler/${PROJECT_ID}`</mark><br><mark style="color:blue;">const PAYMASTER\_RPC = `https://rpc.zerodev.app/api/v2/paymaster/${PROJECT_ID}`</mark><br><br><mark style="color:blue;">const chain = sepolia</mark><br><mark style="color:blue;">const entryPoint = ENTRYPOINT\_ADDRESS\_V07</mark><br><mark style="color:blue;">const kernelVersion = KERNEL\_V3\_1</mark><br><br><mark style="color:blue;">const main = async () => {</mark><br>  <mark style="color:blue;">// Construct a signer</mark><br>  <mark style="color:blue;">const privateKey = generatePrivateKey()</mark><br>  <mark style="color:blue;">const signer = privateKeyToAccount(privateKey)</mark><br><br>  <mark style="color:blue;">// Construct a public client</mark><br>  <mark style="color:blue;">const publicClient = createPublicClient({</mark><br>    <mark style="color:blue;">transport: http(BUNDLER\_RPC),</mark><br>  <mark style="color:blue;">})</mark><br><br>  <mark style="color:blue;">// Construct a validator</mark><br>  <mark style="color:blue;">const ecdsaValidator = await signerToEcdsaValidator(publicClient, {</mark><br>    <mark style="color:blue;">signer,</mark><br>    <mark style="color:blue;">entryPoint,</mark><br>    <mark style="color:blue;">kernelVersion</mark><br>  <mark style="color:blue;">})</mark><br><br>  <mark style="color:blue;">// Construct a Kernel account</mark><br>  <mark style="color:blue;">const account = await createKernelAccount(publicClient, {</mark><br>    <mark style="color:blue;">plugins: {</mark><br>      <mark style="color:blue;">sudo: ecdsaValidator,</mark><br>    <mark style="color:blue;">},</mark><br>    <mark style="color:blue;">entryPoint,</mark><br>   <mark style="color:blue;">kernelVersion</mark><br>  <mark style="color:blue;">})</mark><br><br>  <mark style="color:blue;">// Construct a Kernel account client</mark><br>  <mark style="color:blue;">const kernelClient = createKernelAccountClient({</mark><br>    <mark style="color:blue;">account,</mark><br>    <mark style="color:blue;">chain,</mark><br>    <mark style="color:blue;">entryPoint,</mark><br>    <mark style="color:blue;">bundlerTransport: http(BUNDLER\_RPC),</mark><br>    <mark style="color:blue;">middleware: {</mark><br>      <mark style="color:blue;">sponsorUserOperation: async ({ userOperation }) => {</mark><br>        <mark style="color:blue;">const zerodevPaymaster = createZeroDevPaymasterClient({</mark><br>          <mark style="color:blue;">chain,</mark><br>          <mark style="color:blue;">entryPoint,</mark><br>          <mark style="color:blue;">transport: http(PAYMASTER\_RPC),</mark><br>        <mark style="color:blue;">})</mark><br>        <mark style="color:blue;">return zerodevPaymaster.sponsorUserOperation({</mark><br>          <mark style="color:blue;">userOperation,</mark><br>          <mark style="color:blue;">entryPoint,</mark><br>        <mark style="color:blue;">})</mark><br>      <mark style="color:blue;">},</mark><br>    <mark style="color:blue;">},</mark><br>  <mark style="color:blue;">})</mark><br><br>  <mark style="color:blue;">const accountAddress = kernelClient.account.address</mark><br>  <mark style="color:blue;">console.log("My account:", accountAddress)</mark><br><br>  <mark style="color:blue;">// Send a UserOp</mark><br>  <mark style="color:blue;">const userOpHash = await kernelClient.sendUserOperation({</mark><br>    <mark style="color:blue;">userOperation: {</mark><br>      <mark style="color:blue;">callData: await kernelClient.account.encodeCallData({</mark><br>        <mark style="color:blue;">to: zeroAddress,</mark><br>        <mark style="color:blue;">value: BigInt(0),</mark><br>        <mark style="color:blue;">data: "0x",</mark><br>      <mark style="color:blue;">}),</mark><br>    <mark style="color:blue;">},</mark><br>  <mark style="color:blue;">})</mark><br><br>  <mark style="color:blue;">console.log("UserOp hash:", userOpHash)</mark><br>  <mark style="color:blue;">console.log("Waiting for UserOp to complete...")</mark><br><br>  <mark style="color:blue;">const bundlerClient = kernelClient.extend(bundlerActions(entryPoint));</mark><br>  <mark style="color:blue;">await bundlerClient.waitForUserOperationReceipt({</mark><br>    <mark style="color:blue;">hash: userOpHash,</mark><br>  <mark style="color:blue;">})</mark><br><br>  <mark style="color:blue;">console.log("View completed UserOp here: <https://jiffyscan.xyz/userOpHash/>" + userOpHash)</mark><br><mark style="color:blue;">}</mark><br><br><mark style="color:blue;">main()</mark></p> |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
