---
updatedAt: 2026-05-07T01:57:09.000Z
agentTools:
  projectIndex: https://docs.mavan.bitminetech.io/llms.txt
---

# Generate validator withdrawal transaction


  Generate transaction data for performing an [EIP 7002 on-chain validator withdrawal](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7002.md#abstract).
  
  This can be used to withdraw accrued rewards exceeding 32 ETH. 
  
  The withdrawal amount will be capped such that the validator balance does not fall below 32 ETH.

  This can be used to perform a full exit by specifying an amount of 0. 
  
  The returned transaction data must be signed and broadcast by the user.
    

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/ethereum/txcrafting/validators/withdraw": {
      "post": {
        "description": "\n  Generate transaction data for performing an [EIP 7002 on-chain validator withdrawal](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7002.md#abstract).\n  \n  This can be used to withdraw accrued rewards exceeding 32 ETH. \n  \n  The withdrawal amount will be capped such that the validator balance does not fall below 32 ETH.\n\n  This can be used to perform a full exit by specifying an amount of 0. \n  \n  The returned transaction data must be signed and broadcast by the user.\n    ",
        "operationId": "craftEthereumValidatorWithdrawTx",
        "parameters": [
          {
            "name": "api-key",
            "in": "header",
            "description": "mavan api key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EthereumValidatorWithdrawDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ApiResponseBase"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/EthereumTransactionCraftingWithAnalysisResponse"
                        }
                      }
                    }
                  ],
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        },
        "summary": "Generate validator withdrawal transaction",
        "tags": [
          "Ethereum"
        ]
      }
    }
  },
  "info": {
    "title": "MAVAN Staking API",
    "description": "The MAVAN Staking API Docs",
    "version": "1.0.181-main-mainnet",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://gw-1.api.standardvalidator.com"
    }
  ],
  "components": {
    "schemas": {
      "ApiResponseBase": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "SimulationLog": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Event name (if decoded)",
            "example": ""
          },
          "address": {
            "type": "string",
            "description": "Contract address that emitted the log",
            "example": "0x00000000219ab540356cbb839cbe05303d7705fa"
          },
          "data": {
            "type": "string",
            "description": "Raw log data",
            "example": "0x00000000000000000000000000000000000000000000000000000000000000a0..."
          },
          "topics": {
            "description": "Event topic hashes",
            "example": [
              "0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "address",
          "data",
          "topics"
        ]
      },
      "SimulationStateDiffRaw": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Contract address",
            "example": "0x00000000219ab540356cbb839cbe05303d7705fa"
          },
          "key": {
            "type": "string",
            "description": "Storage slot key",
            "example": "0x0000000000000000000000000000000000000000000000000000000000000000"
          },
          "original": {
            "type": "string",
            "description": "Original value at storage slot",
            "example": "0x5e0221fc22d93c98e0c1ba43cad66f8ed0c423b355f548ecaecb8b9ac1e87000"
          },
          "dirty": {
            "type": "string",
            "description": "New value at storage slot",
            "example": "0x2103b2b3bed9441170c8483184139f999e1e3feef8d17840ac3082a394718f7e"
          }
        },
        "required": [
          "address",
          "key",
          "original",
          "dirty"
        ]
      },
      "SimulationStateDiff": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Contract address with state changes",
            "example": "0x00000000219ab540356cbb839cbe05303d7705fa"
          },
          "soltype": {
            "type": "object",
            "description": "Solidity type information (if available)",
            "example": null
          },
          "original": {
            "type": "object",
            "description": "Original value (if available)",
            "example": null
          },
          "dirty": {
            "type": "object",
            "description": "Dirty value (if available)",
            "example": null
          },
          "raw": {
            "description": "Raw state diff entries",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SimulationStateDiffRaw"
            }
          }
        },
        "required": [
          "address",
          "raw"
        ]
      },
      "SimulationBalanceDiff": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Address with balance change",
            "example": "0x0000000000000000000000000000000000000000"
          },
          "original": {
            "type": "string",
            "description": "Original balance before transaction",
            "example": "340759134036041748877"
          },
          "dirty": {
            "type": "string",
            "description": "Balance after transaction",
            "example": "339759057341860188039"
          },
          "is_miner": {
            "type": "boolean",
            "description": "Whether this address is the miner/validator",
            "example": false
          }
        },
        "required": [
          "address",
          "original",
          "dirty",
          "is_miner"
        ]
      },
      "AssetTokenInfo": {
        "type": "object",
        "properties": {
          "standard": {
            "type": "string",
            "description": "Token standard (e.g., NativeCurrency, ERC20, ERC721)",
            "example": "NativeCurrency"
          },
          "type": {
            "type": "string",
            "description": "Token type (Fungible, NonFungible)",
            "example": "Fungible"
          },
          "contract_address": {
            "type": "string",
            "description": "Token contract address (0x0 for native currency)",
            "example": "0x0000000000000000000000000000000000000000"
          },
          "symbol": {
            "type": "string",
            "description": "Token symbol",
            "example": "ETH"
          },
          "name": {
            "type": "string",
            "description": "Token name",
            "example": "Ether"
          },
          "logo": {
            "type": "string",
            "description": "Token logo URL",
            "example": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628"
          },
          "decimals": {
            "type": "number",
            "description": "Token decimals",
            "example": 18
          },
          "dollar_value": {
            "type": "string",
            "description": "Dollar value of the token",
            "example": "0"
          }
        },
        "required": [
          "standard",
          "type",
          "contract_address",
          "symbol",
          "name",
          "decimals"
        ]
      },
      "SimulationAssetChange": {
        "type": "object",
        "properties": {
          "token_info": {
            "description": "Token information",
            "allOf": [
              {
                "$ref": "#/components/schemas/AssetTokenInfo"
              }
            ]
          },
          "type": {
            "type": "string",
            "description": "Type of asset change",
            "example": "Transfer"
          },
          "from": {
            "type": "string",
            "description": "Source address",
            "example": "0x0000000000000000000000000000000000000000"
          },
          "to": {
            "type": "string",
            "description": "Destination address",
            "example": "0x00000000219ab540356cbb839cbe05303d7705fa"
          },
          "amount": {
            "type": "string",
            "description": "Human-readable amount",
            "example": "1"
          },
          "raw_amount": {
            "type": "string",
            "description": "Raw amount in smallest unit (wei, etc.)",
            "example": "1000000000000000000"
          },
          "dollar_value": {
            "type": "string",
            "description": "Dollar value of the transfer",
            "example": "0"
          },
          "from_before_balance": {
            "type": "string",
            "description": "Balance before transfer (from address)",
            "example": "0x1278fba2fc8bfd518d"
          },
          "to_before_balance": {
            "type": "string",
            "description": "Balance before transfer (to address)",
            "example": "0x829b4ec2eed78acb84200"
          }
        },
        "required": [
          "token_info",
          "type",
          "from",
          "to",
          "amount",
          "raw_amount"
        ]
      },
      "SimulationData": {
        "type": "object",
        "properties": {
          "simulationId": {
            "type": "string",
            "description": "Simulation ID (if provided by the simulation service)",
            "example": "7e8936af-485d-4aff-b487-6564830128ba"
          },
          "success": {
            "type": "boolean",
            "description": "Whether the simulation was successful",
            "example": true
          },
          "executionCost": {
            "type": "number",
            "description": "Transaction execution cost (gas in EVM, compute units in Solana, etc.)",
            "example": 150000
          },
          "costPerUnit": {
            "type": "string",
            "description": "Cost per unit (gas price, fee, etc.)",
            "example": "20000000000"
          },
          "totalCost": {
            "type": "string",
            "description": "Total cost of the transaction",
            "example": "3000000000000000"
          },
          "logs": {
            "description": "Transaction logs/events from the simulation",
            "example": [
              {
                "name": "",
                "address": "0x00000000219ab540356cbb839cbe05303d7705fa",
                "data": "0x00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000030a20d2ba70419cb3922985488e339736ab32e6184f11708d2333f65b14f70cf47365b538c32eff237cdaf293ea2bcfb03000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000506965722054776f000000000000000000000000000000000000000000000000000000000000000800ca9a3b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000506965722054776f0000000000000000000000000000000000000000000000000000000000000008e61a030000000000000000000000000000000000000000000000000000000000",
                "topics": [
                  "0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5"
                ]
              }
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SimulationLog"
            }
          },
          "stateDiff": {
            "description": "State changes from the simulation",
            "example": [
              {
                "address": "0x00000000219ab540356cbb839cbe05303d7705fa",
                "soltype": null,
                "original": null,
                "dirty": null,
                "raw": [
                  {
                    "address": "0x00000000219ab540356cbb839cbe05303d7705fa",
                    "key": "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "original": "0x5e0221fc22d93c98e0c1ba43cad66f8ed0c423b355f548ecaecb8b9ac1e87000",
                    "dirty": "0x2103b2b3bed9441170c8483184139f999e1e3feef8d17840ac3082a394718f7e"
                  },
                  {
                    "address": "0x00000000219ab540356cbb839cbe05303d7705fa",
                    "key": "0x0000000000000000000000000000000000000000000000000000000000000020",
                    "original": "0x0000000000000000000000000000000000000000000000000000000000031ae6",
                    "dirty": "0x0000000000000000000000000000000000000000000000000000000000031ae7"
                  }
                ]
              }
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SimulationStateDiff"
            }
          },
          "balanceDiff": {
            "description": "Balance differences from the simulation",
            "example": [
              {
                "address": "0x0000000000000000000000000000000000000000",
                "original": "340759134036041748877",
                "dirty": "339759057341860188039",
                "is_miner": false
              },
              {
                "address": "0x00000000219ab540356cBB839Cbe05303d7705Fa",
                "original": "9868361015449101000000000",
                "dirty": "9868362015449101000000000",
                "is_miner": false
              }
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SimulationBalanceDiff"
            }
          },
          "assetChanges": {
            "description": "Asset changes from the simulation",
            "example": [
              {
                "token_info": {
                  "standard": "NativeCurrency",
                  "type": "Fungible",
                  "contract_address": "0x0000000000000000000000000000000000000000",
                  "symbol": "ETH",
                  "name": "Ether",
                  "logo": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
                  "decimals": 18,
                  "dollar_value": "0"
                },
                "type": "Transfer",
                "from": "0x0000000000000000000000000000000000000000",
                "to": "0x00000000219ab540356cbb839cbe05303d7705fa",
                "amount": "1",
                "raw_amount": "1000000000000000000",
                "dollar_value": "0",
                "from_before_balance": "0x1278fba2fc8bfd518d",
                "to_before_balance": "0x829b4ec2eed78acb84200"
              }
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SimulationAssetChange"
            }
          },
          "error": {
            "type": "object",
            "description": "Error information if simulation failed",
            "example": {
              "errorType": "execution_reverted",
              "errorMessage": "Transaction reverted",
              "revertReason": "Insufficient balance"
            }
          },
          "shareUrl": {
            "type": "string",
            "description": "Shareable URL for the simulation (if available)",
            "example": "https://simulator.example.com/..."
          }
        },
        "required": [
          "success",
          "executionCost",
          "costPerUnit",
          "totalCost",
          "logs",
          "stateDiff"
        ]
      },
      "TransactionAnalysisObservation": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "description": "Source of the observation (e.g., simulation, validation, custom)",
            "example": "simulation"
          },
          "message": {
            "type": "string",
            "description": "Observation message describing the issue or finding",
            "example": "Transaction simulation succeeded"
          },
          "severity": {
            "type": "string",
            "description": "Severity level of the observation",
            "enum": [
              "info",
              "warn",
              "danger"
            ],
            "example": "info"
          }
        },
        "required": [
          "source",
          "message",
          "severity"
        ]
      },
      "TransactionAnalysis": {
        "type": "object",
        "properties": {
          "simulations": {
            "type": "object",
            "description": "Simulation data from blockchain simulations, keyed by source (e.g., tenderly). The schema for each simulation source follows the SimulationData structure.",
            "additionalProperties": {
              "$ref": "#/components/schemas/SimulationData"
            },
            "example": {
              "tenderly": {
                "simulationId": "4e5e1636-f422-49f7-beba-88b274a201a5",
                "success": true,
                "executionCost": 49314,
                "costPerUnit": "1555221267",
                "totalCost": "76694181560838",
                "logs": [
                  {
                    "name": "",
                    "address": "0x00000000219ab540356cbb839cbe05303d7705fa",
                    "data": "0x00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000030a20d2ba70419cb3922985488e339736ab32e6184f11708d2333f65b14f70cf47365b538c32eff237cdaf293ea2bcfb03000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000506965722054776f000000000000000000000000000000000000000000000000000000000000000800ca9a3b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000506965722054776f0000000000000000000000000000000000000000000000000000000000000008e61a030000000000000000000000000000000000000000000000000000000000",
                    "topics": [
                      "0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5"
                    ]
                  }
                ],
                "stateDiff": [
                  {
                    "address": "0x00000000219ab540356cbb839cbe05303d7705fa",
                    "soltype": null,
                    "original": null,
                    "dirty": null,
                    "raw": [
                      {
                        "address": "0x00000000219ab540356cbb839cbe05303d7705fa",
                        "key": "0x0000000000000000000000000000000000000000000000000000000000000000",
                        "original": "0x5e0221fc22d93c98e0c1ba43cad66f8ed0c423b355f548ecaecb8b9ac1e87000",
                        "dirty": "0x2103b2b3bed9441170c8483184139f999e1e3feef8d17840ac3082a394718f7e"
                      }
                    ]
                  }
                ],
                "balanceDiff": [
                  {
                    "address": "0x0000000000000000000000000000000000000000",
                    "original": "340759134036041748877",
                    "dirty": "339759057341860188039",
                    "is_miner": false
                  },
                  {
                    "address": "0x00000000219ab540356cBB839Cbe05303d7705Fa",
                    "original": "9868361015449101000000000",
                    "dirty": "9868362015449101000000000",
                    "is_miner": false
                  }
                ],
                "assetChanges": [
                  {
                    "token_info": {
                      "standard": "NativeCurrency",
                      "type": "Fungible",
                      "contract_address": "0x0000000000000000000000000000000000000000",
                      "symbol": "ETH",
                      "name": "Ether",
                      "logo": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
                      "decimals": 18,
                      "dollar_value": "0"
                    },
                    "type": "Transfer",
                    "from": "0x0000000000000000000000000000000000000000",
                    "to": "0x00000000219ab540356cbb839cbe05303d7705fa",
                    "amount": "1",
                    "raw_amount": "1000000000000000000",
                    "dollar_value": "0",
                    "from_before_balance": "0x1278fba2fc8bfd518d",
                    "to_before_balance": "0x829b4ec2eed78acb84200"
                  }
                ],
                "shareUrl": "https://www.tdly.co/shared/simulation/4e5e1636-f422-49f7-beba-88b274a201a5"
              }
            }
          },
          "observations": {
            "description": "Array of observations from various sources",
            "example": [
              {
                "source": "validation",
                "message": "All validators found in user records",
                "severity": "info"
              },
              {
                "source": "simulation",
                "message": "Transaction simulation succeeded",
                "severity": "info"
              }
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionAnalysisObservation"
            }
          }
        },
        "required": [
          "observations"
        ]
      },
      "EthereumTransactionCraftingWithAnalysisResponse": {
        "type": "object",
        "properties": {
          "to": {
            "type": "string",
            "description": "target contract address",
            "example": "0x0000000000000000000000000000000000000000"
          },
          "data": {
            "type": "string",
            "description": "serialised calldata",
            "example": "0x02f86d59085208943b57d2c0f0db7b7a5e080c0"
          },
          "value": {
            "type": "string",
            "description": "ETH value to send with transaction (in wei)",
            "example": "1000000000000000000"
          },
          "nonce": {
            "type": "number",
            "description": "nonce value, this is based on the provided fromAddress",
            "example": 3
          },
          "gas": {
            "type": "string",
            "description": "Gas limit for the transaction",
            "example": "21000"
          },
          "chainId": {
            "type": "number",
            "description": "Ethereum network chainId",
            "example": 560048
          },
          "maxFeePerGas": {
            "type": "string",
            "description": "Maximum fee per gas in wei",
            "example": "20000000000"
          },
          "maxPriorityFeePerGas": {
            "type": "string",
            "description": "Maximum priority fee per gas in wei",
            "example": "1000000000"
          },
          "serialized": {
            "type": "string",
            "description": "serialized unsigned transaction made up of other returned fields",
            "example": "0x02f86d01808459682f00825208943b3b57de6e72c0f0db7b7a73b3e3e5e5e5e5e5e588016345785d8a000080c0"
          },
          "analysis": {
            "description": "Transaction analysis including validations and observations",
            "allOf": [
              {
                "$ref": "#/components/schemas/TransactionAnalysis"
              }
            ]
          }
        },
        "required": [
          "to",
          "data",
          "value",
          "nonce",
          "gas",
          "chainId",
          "maxFeePerGas",
          "maxPriorityFeePerGas",
          "serialized",
          "analysis"
        ]
      },
      "EthereumValidatorWithdrawDto": {
        "type": "object",
        "properties": {
          "fromAddress": {
            "type": "string",
            "description": "The address to send the transaction from, this is required for accurate gas estimation and nonce calculation",
            "example": "0x0000000000000000000000000000000000000000"
          },
          "gasEstimateMultiplier": {
            "type": "number",
            "description": "multiplier to apply to gas estimate, defaults to 1.2",
            "example": 1.2
          },
          "validatorPubkey": {
            "type": "string",
            "description": "Validator public key to withdraw from",
            "example": "a20d2ba70419cb3922985488e339736ab32e6184f11708d2333f65b14f70cf47365b538c32eff237cdaf293ea2bcfb03"
          },
          "amountGwei": {
            "type": "string",
            "description": "Amount of ETH to withdraw in gwei",
            "example": "1000000000"
          }
        },
        "required": [
          "fromAddress",
          "gasEstimateMultiplier",
          "validatorPubkey",
          "amountGwei"
        ]
      }
    }
  }
}
```