Skip to content

​What Does Revoking a Delegate Do?

Revoking a delegate clears the token account’s current delegate and resets the delegated amount to zero. After revocation, the previous delegate no longer has authority to transfer or burn tokens on behalf of the token account.

​How to Revoke a Delegate

Revoking a delegate uses the Token Program’s Revoke instruction. The Revoke instruction clears the delegate fields on the source token account. The token account owner or the current delegate signs the revocation, in both the Token Program and the Token Extension Program. The Token Program deployed on Solana today is p-token, a reimplementation of the original program written with Pinocchio, and the Token Program links below point to its source. The original implementation (program@v9.0.0) accepts only the owner’s signature for Revoke.

​Source Reference

ItemDescriptionToken ProgramToken Extension Program
AccountThe token account state stores the delegate and delegated amount.SourceSource
RevokeAn instruction that removes the current delegate from a token account.SourceSource
process_revokeShared processor logic for delegate revocation.SourceSource

​Kit

These examples use @solana/kit.

​Web3.js v3

These examples use the class-based @solana/web3.js v3 API with @solana-program instruction builders.
Instructions

​Rust

Add these dependencies to Cargo.toml (tested with Rust 1.89 and 1.98):
Cargo.toml
Rust

​Python

This example uses solana (solana-py) 0.41 and solders:
Terminal
Python

​Web3.js (legacy)

These examples use legacy @solana/web3.js 1.x with @solana/spl-token.
@solana/web3.js 1.x is no longer actively maintainedIt receives critical fixes only. Use Kit for new code. To migrate existing code, follow the Kit upgrade guide, or the web3.js v3 migration guide to keep the class-based API.To run this code, install 1.x with npm install @solana/web3.js@1. A plain npm install @solana/web3.js installs v3, which this code doesn’t run on.