custom program error: 0x0
The program returned error code 0x0 (decimal 0), which is the first variant in that program’s custom error enum.
What 0x0 means
Solana programs define their own error codes starting from 0. The runtime displays them in hex prefixed with custom program error:. Error 0x0 is the first entry in the program’s error list — its meaning depends entirely on which program threw it.
Common meanings across popular programs:
| Program | Error 0x0 meaning |
|---|---|
| SPL Token | NotRentExempt — account balance too low for rent exemption |
| Anchor | First custom error in the program’s ErrorCode enum |
| Serum/OpenBook | InvalidMarketFlags |
How to fix
- Identify the program. Check the transaction logs for the program ID that returned the error. The line
Program <ID> failed: custom program error: 0x0names the program. - Look up the error enum. Find the program’s source code or IDL and check what error index 0 maps to.
- For SPL Token
NotRentExempt: ensure the account has enough SOL for rent exemption. Use getMinimumBalanceForRentExemption to check the required amount.
How to decode any custom program error
The hex value after 0x is the error index. Convert to decimal and look it up in the program’s error enum:
0x0 → 0
0x1 → 1
0x1770 → 6000 (Anchor error range starts at 6000)
For Anchor programs, errors 6000+ map to the program’s #[error_code] enum starting from the first variant.
FAQ
Why does the error show in hex?
The Solana runtime formats all custom program errors in hexadecimal. Convert with parseInt("0x0", 16) to get the decimal index.
How do I find the program’s error list? Check the program’s GitHub repository for the error enum, or use the IDL (Interface Description Language) if the program published one. For Anchor programs, the IDL includes all error definitions.
Error text variants
-
custom program error: 0x0 -
Program error 0x0 -
Custom error: 0
Updated: