Anchor discriminator calculator
Type an Anchor instruction name to get its 8-byte discriminator: the first 8 bytes of sha256("global:<name>").
Try an example:initialize
Anchor programs route instructions by an 8-byte prefix on the instruction data. Matching that prefix tells you which instruction a transaction calls, which is how explorers and decoders label Anchor calls.
Use the snake_case name from the program's IDL, for example initialize or claim_rewards.
AI agents can run this through the SwapChan MCP tool solana_address. Set up MCP
FAQ
- How is it computed?
- sha256("global:" + name), first 8 bytes. Names are the snake_case Rust function names.
- Does it work for account discriminators?
- This computes instruction discriminators (global: namespace). Account discriminators use the account: namespace and the struct name.
- Is it safe?
- Yes. It only reads public data you paste. Nothing is stored or logged, and you never need a private key or seed phrase here.