Skip to content

Use Fireblocks with ZeroDev

Fireblocks is a user-friendly platform designed for building blockchain-based products and managing digital asset operations. It uses a direct custody approach, combining high performance with zero counterparty risk and multi-layered security. The platform includes secure MPC-based digital asset wallets, a policy engine for governance and transaction rules, and comprehensive treasury management. Fireblocks' security framework features multiple layers, including MPC-CMP technology, secure enclaves, and a robust policy engine, ensuring protection against cyberattacks, internal threats, and human errors. It's widely used for various operations like treasury, trading, and managing NFTs, smart contracts, and user wallets.

Set up

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

  • Refer to the Fireblocks documentation site for instructions on setting up an application with the Fireblocks.
  • For a quick start, Fireblocks provides a guide, available here.

Integration

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

Create the Fireblocks object

After following the Fireblocks documentation, you will have access to a FireblocksWeb3Provider object as shown below:

import { FireblocksWeb3Provider, type FireblocksProviderConfig } from "@fireblocks/fireblocks-web3-provider";
 
// Config options here will be specific to your project.  See the Fireblocks docs for more info.
const fireblocksProviderConfig: FireblocksProviderConfig = { ... };
const fireblocksWeb3Provider = new FireblocksWeb3Provider(fireblocksProviderConfig);

Use with ZeroDev

Use the provider from Fireblocks 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 { createPublicClient } from "viem";
import { polygonAmoy } from 'viem/chains';
 
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: fireblocksWeb3Provider,
  entryPoint: getEntryPoint("0.7"),
  kernelVersion: KERNEL_V3_1
})
 
// You can now use this ECDSA Validator to create a Kernel account