Skip to content

Account Abstraction

Robinhood Chain has first-class support for ERC-4337 account abstraction, and also supports EIP-7702, which lets existing externally-owned accounts delegate to smart contract code — so users can get smart-account features (batching, sponsorship, session keys) without migrating to a new address.

Account abstraction on Robinhood Chain is powered by Alchemy, with ZeroDev available as an alternative.

What's available

ServiceDescription
AlchemyCreate and manage programmable wallets to submit and manage transactions with built-in batching, configurable spend policies, and gas sponsorship for users.
ZeroDevSmart AA wallets that can be embedded as UI or used through API. Supports gas sponsorship, transaction batching, transaction automation, and cross-chain execution.
PrivyEmbedded wallets and account abstraction tooling

Network configuration

PropertyValue
Chain ID4663
Bundler / RPC URLhttps://robinhood-mainnet.g.alchemy.com/v2/{API_KEY}

Deployed ERC-4337 contracts

ContractAddress
ERC-4337 Entrypoint v0.6.00x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789
ERC-4337 SenderCreator v0.6.00x7fc98430eAEdbb6070B35B39D798725049088348
ERC-4337 Entrypoint v0.7.00x0000000071727De22E5E9d8BAf0edAc6f37da032
ERC-4337 SenderCreator v0.7.00xEFC2c1444eBCC4Db75e7613d20C6a62fF67A167C
ERC-4337 Entrypoint v0.8.00x4337084D9E255Ff0702461CF8895CE9E3b5Ff108
ERC-4337 SenderCreator v0.8.00x449ED7C3e6Fee6a97311d4b55475DF59C44AdD33
ERC-4337 Safe Module Setup v0.3.00x2dd68b007B46fBe91B9A7c3EDa5A7a1063cB5b47
ERC-4337 Safe 4337 Module v0.3.0 (supporting Entrypoint v0.7.0)0x75cf11467937ce3F2f357CE24ffc3DBF8fD5c226

Quickstart

Using Alchemy

Alchemy recommends using the latest version @alchemy/wallet-apis for the easiest setup.

Sending sponsored txs on Robinhood mainnet:

  1. Create an Alchemy account and create an app on Robinhood Chain to get your API key
  2. In the Alchemy dashboard, create a Gas Manager policy to sponsor gas, and note your Policy ID
  3. Install dependencies
npm install @alchemy/wallet-apis @alchemy/common viem
  1. Create a client and send gas-sponsored operation
import { createSmartWalletClient, alchemyWalletTransport } from "@alchemy/wallet-apis";
import { robinhoodMainnet } from "@alchemy/common/chains";
import { privateKeyToAccount } from "viem/accounts";
import { zeroAddress } from "viem";
 
const client = createSmartWalletClient({
  transport: alchemyWalletTransport({
    apiKey: "YOUR_API_KEY",
  }),
  chain: robinhoodMainnet,
  signer: privateKeyToAccount("0xYOUR_PRIVATE_KEY" as const),
  paymaster: {
    policyId: "YOUR_POLICY_ID", // sponsor gas for the user
  },
});
 
// prepare and send calls
const { id } = await client.sendCalls({
  calls: [{ to: zeroAddress, value: BigInt(0) }],
});
 
// get calls status
const status = await client.waitForCallsStatus({ id });
console.log(`Call ID: ${id}`);
console.log(`Status: ${status.status}`);

Using ZeroDev

If you prefer ZeroDev for gas sponsorship, configure a ZeroDev paymaster pointed at Robinhood Chain (chain ID 4663).

Install ZeroDev SDK:

npm i @zerodev/sdk @zerodev/ecdsa-validator

Send a sponsored transaction with ZeroDev:

import { createKernelAccount, createKernelAccountClient, createZeroDevPaymasterClient } from "@zerodev/sdk"
import { KERNEL_V3_1, getEntryPoint } from "@zerodev/sdk/constants"
import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator"
import { http, createPublicClient, zeroAddress } from "viem"
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"
import { robinhoodMainnet } from "viem/chains"
 
const ZERODEV_RPC = 'https://rpc.zerodev.app/api/v3/YOUR_PROJECT_ID/chain/4663'
 
const chain = robinhoodMainnet
const entryPoint = getEntryPoint("0.7")
const kernelVersion = KERNEL_V3_1
 
const main = async () => {
  // Construct a signer
  const privateKey = generatePrivateKey()
  const signer = privateKeyToAccount(privateKey)
 
  // Construct a public client
  const publicClient = createPublicClient({
    // Use your own RPC provider in production (e.g. Infura/Alchemy).
    transport: http(ZERODEV_RPC),
    chain
  })
 
  // Construct a validator
  const ecdsaValidator = await signerToEcdsaValidator(publicClient, {
    signer,
    entryPoint,
    kernelVersion
  })
 
  // Construct a Kernel account
  const account = await createKernelAccount(publicClient, {
    plugins: {
      sudo: ecdsaValidator,
    },
    entryPoint,
    kernelVersion
  })
 
  const zerodevPaymaster = createZeroDevPaymasterClient({
    chain,
    transport: http(ZERODEV_RPC),
  })
 
  // Construct a Kernel account client
  const kernelClient = createKernelAccountClient({
    account,
    chain,
    bundlerTransport: http(ZERODEV_RPC),
    // Required - the public client
    client: publicClient,
    paymaster: {
        getPaymasterData(userOperation) {
            return zerodevPaymaster.sponsorUserOperation({userOperation})
        }
    },
  })
 
  const accountAddress = kernelClient.account.address
  console.log("My account:", accountAddress)
 
  // Send a UserOp
  const userOpHash = await kernelClient.sendUserOperation({
      callData: await kernelClient.account.encodeCalls([{
        to: zeroAddress,
        value: BigInt(0),
        data: "0x",
      }]),
  })
 
  console.log("UserOp hash:", userOpHash)
  console.log("Waiting for UserOp to complete...")
 
  await kernelClient.waitForUserOperationReceipt({
    hash: userOpHash,
    timeout: 1000 * 15,
  })
 
  console.log("UserOp completed: https://robinhoodchain.blockscout.com/op/" + userOpHash)
 
  process.exit()
}
 
main()

For more information, check ZeroDev docs.

Further reading