To stop staking, validators need to submit a SignedVoluntaryExit transaction. This is signed with the validator keys that Staked holds. Request a voluntary exit and submit it or hold it offline for submission at a later date.
To exit validators either submit a signed challenge containing the validators to exit or request the encrypted exits, decrypt them on your end, and then submit.
constchallenge=JSON.stringify({ intentToExit:"I am signing this message and requesting that Staked exit the following validators from the network", validatorIndexes: [1234,1235,1236],// REQUIRED: list of validator indexes date:Date.now().toString(),// optional, timestamp this was signed address: withdrawal_address,// REQUIRED: the signing address},null,2)constsignature=awaitweb3.eth.personal.sign(challenge, withdrawal_address);constpacked_challenge=web3.utils.toHex('\u0019Ethereum Signed Message:\n'+challenge.length.toString() + challenge);
Staked supports EOA and EIP-1271 compliant signatures when requesting voluntary exits.
Request Staked to exit a set of validators for a given withdrawal address. The list of validators comes from a challenge that must be signed with the withdrawal address. See the above code snippet for constructing the body for this method.
NOTE: If the challenge and signature check out, this submits the voluntary exits and will initiate the process for exiting validators. This method does not return the voluntary exits. If you need the voluntary exits you must request the encrypted exits.
Query Parameters
Name
Type
Description
key*
String
The withdrawal key to exit
Request Body
Name
Type
Description
signature*
String
The signature by the withdrawal key to
challenge*
String
The packed message to be signed (see above). This specifies which validators to exit.
All exits submitted successfully.
Some voluntary exits failed to submit. The error for each failed exit is returned. Ignored exits were successful.
Voluntary exits are encrypted with the validator's withdrawal credential's public key. The public key address must have at least one outgoing transaction to be discoverable for encryption. You also have the option of providing your own ecies pubkey to staked to override this default encryption key. Example of using ecies to create a pubkey is below, please contact our support desk if you need to use this override pubkey.
Exit messages are stored and delivered encrypted so that only the staker can initiate voluntary exits. The voluntary exit for every validator with a shared withdrawal credential public key is encrypted in one batch to reduce the burden of decrypting, however multiple batches may be returned (though n<=5).
Request voluntary exits for a type-0x01 withdrawal address
Returns all SignedVoluntaryExits for validators using the given withdrawal credential.
signed_exits contents are encrypted with the same withdrawal key and will need to be decrypted before submission, but may contain more than one encrypted blob of SignedVoluntaryExits.
NOTE: this does not submit these exits, it just returns the encrypted exits for storage or decryption by the API consumer.
Path Parameters
Name
Type
Description
withdrawal_address*
String
Return exits for the set of validators using this ETH address as the basis for their 0x01 withdrawal credentials
Query Parameters
Name
Type
Description
api_key*
String
Your Staked API key
Not all voluntary exits have been created for every validator using this withdrawal credential, but those that have been are returned.
"No active validators found with given credential" or "Found active validators, but could not find prepared exit txns"
Exiting is separate from withdrawing. After successfully submitting an exit, validators will continue to stake until out of the exit queue and completely exited. Once finalized, the withdrawal process will take additional time to return all funds to the withdrawal address.
NOTE: if an exit is submitted before the validator has a type-0x01 ETH withdrawal credential funds will not be returned until a SignedBLSToExecutionChange has been submitted.
Submit voluntary exits for a type-0x01 withdrawal address