Skip to content

​What Does Setting Authority Do?

Setting authority changes or revokes specific authority roles on a mint or token account. Mint accounts can store a mint authority and a freeze authority. Token accounts store an owner and can optionally store a close authority. Each role controls a specific permission set, and setting an authority to None permanently removes the selected authority role. The Token Extension Program also defines additional authority types for specific extensions.

​How to Set Authority

Changing an authority uses the Token Program’s SetAuthority instruction. Each call updates one authority type on one mint or token account. The current authority signs the change, and the new authority may be another address or None to revoke the selected authority permanently.

​Source Reference

ItemDescriptionToken ProgramToken Extension Program
MintThe mint state stores mint_authority and freeze_authority.SourceSource
AccountThe token account state stores owner and close_authority.SourceSource
AuthorityTypeThe authority roles that SetAuthority can update.SourceSource
SetAuthorityAn instruction that changes or revokes one authority on a mint or token account.SourceSource
process_set_authorityShared processor logic for authority updates.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.