Migrate from Stackup

We’re thrilled to support your migration to Alchemy! This guide will walk you through the process and any necessary changes to your setup, and highlight the benefits of using our stack.

Why Alchemy?

There are many unique benefits of using Alchemy, but here are the three biggest ones:

1. We’re here for the long haul, with proven scale & reliability

  • Powered the largest companies in web3 & web2 for 7+ years.
  • More experienced at building Internet-scale, global enterprise infrastructure than any other company in web3.
  • Seen almost any issue that could happen to a chain (re-orgs, chain halt, dropped blocks, etc), and have workarounds and protections against these issues that others don’t.
Note: these are a few selected companies.

Note: these are a few selected companies.

2. We have the only full-stack toolkit you need to solve web3’s biggest problem
Open up Alchemy’s Account Kit, and you’ll have all the tools you need to solve web3’s biggest problem — user experience.

Build zero friction sign up and transaction flows with smart accounts. Sign up with email and social, login with passkeys, transact with sponsored gas, and checkout in one click with transaction batching.

Get up and running in minutes with the account kit, or swap out any pieces of the stack from signer to infra - Account Kit lets you build how YOU want to.

🙀 UI components COMING SOON!! It’s the last piece 🧩

🙀 UI components COMING SOON!! It’s the last piece 🧩

3. We offer you the full developer platform, on a silver platter, of course

It doesn’t stop there. Alchemy is the only all-in-one developer platform. Start with Account Kit, but while you’re here, leverage the APIs & tools (RPC, subgraphs, NFT API, token balances, etc.) to build and scale your web3 app with ease.

When you join our ecosystem, you’re part of the flywheel of builders, chains, and services that evolves together, making the whole greater than the sum of its parts.

Alchemy Developer Platform - each box is one API or product you can rely on to build great blockchain apps.

Alchemy Developer Platform - each box is one API or product you can rely on to build great blockchain apps.

Migration Process

1. Create an Alchemy account

Go to the Alchemy Dashboard and create an account if you haven’t already.

Create an Alchemy Account

2. Create an App

  1. Go to the Apps dashboard
  2. Click "Create new app”
  3. Select the chain(s) you want to build on. Refer to our Feature Support By Chain page for details on feature availability across our supported chains.

📘

For additional chain support, reach out on discord.

You will now have an API key to use for sending requests.


3. Sponsoring gas? Create a Gas Manager Policy

Create a policy in the Gas Manager dashboard to sponsor gas for your users.

  • A policy is a set of rules that define which user operations are eligible for gas sponsorship. To learn more about policy configuration, refer to our setting up a gas manager policy guide.
  • Each policy can only be applied to one app and one chain. To sponsor gas on multiple chains, you must create multiple policies.

Once a policy is created, you will receive a policy id.


4. Update RPC calls

Migrate bundler API

Migrating bundler API calls to estimate gas and send user operations is as simple as swapping out your RPC url since both Stackup and Alchemy follow the ERC-4337 standard.

  1. Replace RPC URL: https://api.stackup.sh/v1/node/api_keyhttps://eth-mainnet.g.alchemy.com/v2/alchemy_api_key

    • Include the desired chain in the alchemy rpc url
    • Replace alchemy_api_key with the key from step 2 (from app dashboard)
  2. Use updated endpoint for all bundler API endpoints

    • Request params do not need to be changed as they are standardized
    • Add the additional alchemy method rundler_maxPriorityFee when estimating gas to set the priority fee

Migrate paymaster API (if sponsoring gas)

  1. Replace RPC URL: https://api.stackup.sh/v1/paymaster/API_KEYhttps://eth-mainnet.g.alchemy.com/v2/alchemy_api_key

    • You no longer need a dedicated paymaster endpoint - use the same RPC url for both bundler and paymaster requests
  2. Update RPC methods

    1. pm_sponsorUserOperationalchemy_requestGasAndPaymasterAndData
      • Rather than needing to estimate gas before requesting gas sponsorship, use alchemy_requestGasAndPaymasterAndData to obtain paymasterAndData and gas estimates at the same time
        • Alternatively, you can use alchemy_requestPaymasterAndData to only request coverage and obtain paymasterAndData. You must separately estimate gas in this option.
      • Add the policyId from step 3 (gas manager dashboard)
      • Pass a partial user operation rather than a full user operation with gas estimates
      • Note: the below examples assume you are using entrypoint v0.6. Please see documentation for entrypoint v0.7 requests.
      • Example request and response migration
        {  
          "jsonrpc": "2.0",  
          "id": 1,  
          "method": "pm_sponsorUserOperation",  
          "params": [  
            {  
              sender, 
              nonce,   
              initCode, 
              callData,
              callGasLimit,
              verificationGasLimit, 
              preVerificationGas,
              maxFeePerGas,
              maxPriorityFeePerGas,
              paymasterAndData,  
              signature, 
            },  
            "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", // entrypoint
            { /* PM specific data here... */ }  
          ]  
        }
        
        {
          "id": 1,
          "jsonrpc": "2.0",
          "method": "alchemy_requestGasAndPaymasterAndData",
          "params": [
            {
              "policyId": "POLICY_ID",
              "entryPoint": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
              "dummySignature": "signature",
              "userOperation": { // partial user operation
                "sender": "sender",
                "nonce": "nonce",
                "initCode": "initCode",
                "callData": "callData"
              }
            }
          ]
        }
        
        {  
          "jsonrpc": "2.0",  
          "id": 1,  
          "result": {  
              "paymasterAndData": "0x1234...5678",  
              "preVerificationGas": "0x...",  
              "verificationGasLimit": "0x...",  
              "callGasLimit": "0x...",  
          }  
        }
        
        {  
          "jsonrpc": "2.0",  
          "id": 1,  
          "result": {  
              "paymasterAndData": "0x1234...5678",  
              "preVerificationGas": "0x...",  
              "verificationGasLimit": "0x...",  
              "callGasLimit": "0x...",  
              "maxFeePerFas": "0x...",
              "maxPriorityFeePerGas": "0x..."
          }  
        }
        
    2. pm_accounts → remove
      • This endpoint is no longer needed
      • To find alchemy paymaster deployment addresses, see here

Using an SDK and not APIs?

Please reach out on discord for additional SDK migration support. See Account Kit to use our SDK.

📘

For additional support, reach out on discord.