Error Codes Reference
Complete reference for all error codes in the GhostSpeak SDK and smart contracts, with troubleshooting steps and recovery strategies.Error Categories
GhostSpeak errors are organized into categories for easier debugging:| Category | Code Prefix | Description |
|---|---|---|
| Network | NETWORK_* | RPC connection, timeout, rate limiting |
| Transaction | TRANSACTION_* | Transaction failures, simulation errors |
| Validation | VALIDATION_* | Input validation, data format errors |
| Authorization | UNAUTHORIZED_* | Permission denied, access control |
| Program | PROGRAM_ERROR_* | Smart contract execution errors |
| Account | ACCOUNT_* | Account not found, invalid account state |
| System | UNKNOWN_* | Unexpected errors, system failures |
SDK Error Codes
Network Errors
NETWORK_ERROR
NETWORK_ERROR
Code:
NETWORK_ERRORCause: RPC connection failure, network timeout, or connectivity issues.Message: “Network connection failed”Retryable: Yes (automatic retry with exponential backoff)Troubleshooting:- Check internet connection
- Verify RPC endpoint is accessible
- Try alternative RPC provider (Helius, QuickNode)
- Check Solana Status
TIMEOUT_ERROR
TIMEOUT_ERROR
Code:
TIMEOUT_ERRORCause: Operation exceeded timeout duration (default 30 seconds).Message: “Operation timed out”Retryable: YesTroubleshooting:- Increase timeout in client configuration
- Use faster RPC endpoint
- Reduce transaction complexity (fewer instructions)
- Check network congestion
RATE_LIMIT_EXCEEDED
RATE_LIMIT_EXCEEDED
Code:
RATE_LIMIT_EXCEEDEDCause: Too many requests to RPC endpoint (429 status).Message: “Rate limit exceeded. Please wait X seconds before trying again.”Retryable: Yes (after delay)Troubleshooting:- Implement request batching
- Use paid RPC provider with higher limits
- Enable SDK caching
- Reduce request frequency
Transaction Errors
TRANSACTION_ERROR
TRANSACTION_ERROR
Code:
TRANSACTION_ERRORCause: Generic transaction execution failure.Message: “Transaction failed to execute. Please check the details and try again.”Retryable: Sometimes (depends on cause)Troubleshooting:- Check transaction logs for specific error
- Verify all accounts are correct
- Ensure sufficient SOL for transaction fees
- Validate instruction data format
INSUFFICIENT_FUNDS
INSUFFICIENT_FUNDS
Code:
INSUFFICIENT_FUNDSCause: Wallet doesn’t have enough SOL for transaction + rent.Message: “Insufficient funds to complete the transaction. Please add more funds and try again.”Retryable: No (requires funding wallet)Troubleshooting:- Check wallet balance:
solana balance YOUR_ADDRESS --url devnet - Request devnet SOL from faucet
- For mainnet: transfer SOL to wallet
- Reduce transaction size if possible
SIGNATURE_VERIFICATION_FAILED
SIGNATURE_VERIFICATION_FAILED
Code:
TRANSACTION_ERROR (subtype)Cause: Invalid transaction signature or signer mismatch.Message: “Invalid transaction signature”Retryable: No (signature issue)Troubleshooting:- Verify correct signer is used
- Check signer has authority over account
- Ensure signer matches expected public key
- Regenerate signature if needed
BLOCKHASH_NOT_FOUND
BLOCKHASH_NOT_FOUND
Code:
TRANSACTION_ERROR (blockhash expired)Cause: Transaction blockhash expired (>60 seconds old).Message: “Transaction blockhash expired”Retryable: Yes (fetch new blockhash)Troubleshooting:- SDK automatically fetches fresh blockhash on retry
- Reduce time between signing and sending
- Use
getLatestBlockhashimmediately before sending
Validation Errors
VALIDATION_ERROR
VALIDATION_ERROR
Code:
VALIDATION_ERRORCause: Invalid input data or format.Message: “Invalid . ”Retryable: No (fix input)Troubleshooting:- Check field format requirements
- Validate against schema
- Review error message for specific field
- Check SDK documentation for expected format
INVALID_INSTRUCTION_ERROR
INVALID_INSTRUCTION_ERROR
Code:
VALIDATION_ERROR (instruction subtype)Cause: Malformed instruction data.Message: “Invalid instruction data”Retryable: NoTroubleshooting:- Verify instruction accounts match IDL
- Check data serialization format
- Ensure all required fields are provided
- Update SDK if using outdated version
Account Errors
ACCOUNT_NOT_FOUND
ACCOUNT_NOT_FOUND
Code:
ACCOUNT_NOT_FOUNDCause: Account doesn’t exist at the specified address.Message: “The account was not found. Please verify the address.”Retryable: No (account missing)Troubleshooting:- Verify address is correct
- Ensure account was created
- Check if using correct network (devnet vs mainnet)
- For PDAs, verify derivation seeds are correct
UNAUTHORIZED_ACCESS
UNAUTHORIZED_ACCESS
Smart Contract Error Codes
DID Module Errors (6000-6009)
| Code | Hex | Name | Description | Solution |
|---|---|---|---|---|
| 6000 | 0x1770 | AlreadyDeactivated | DID document is already deactivated | Cannot reactivate, create new DID |
| 6001 | 0x1771 | TooManyVerificationMethods | Maximum 10 verification methods reached | Remove unused methods before adding new |
| 6002 | 0x1772 | TooManyServiceEndpoints | Maximum 20 service endpoints reached | Remove unused endpoints before adding new |
| 6003 | 0x1773 | DuplicateMethodId | Verification method ID already exists | Use unique method IDs |
| 6004 | 0x1774 | DuplicateServiceId | Service endpoint ID already exists | Use unique service IDs |
| 6005 | 0x1775 | MethodNotFound | Verification method not found | Verify method ID exists in DID document |
| 6006 | 0x1776 | ServiceNotFound | Service endpoint not found | Verify service ID exists in DID document |
| 6007 | 0x1777 | InvalidDidFormat | DID format is invalid | Use format: did:sol:{network}:{address} |
| 6008 | 0x1778 | UnauthorizedDidOperation | Unauthorized DID operation | Use DID controller or authorized key |
| 6009 | 0x1779 | DidDeactivated | DID is deactivated | Cannot use deactivated DID |
Common Program Errors
AlreadyDeactivated (6000)
AlreadyDeactivated (6000)
When: Attempting to deactivate an already deactivated DID.Example Error:Fix:
TooManyVerificationMethods (6001)
TooManyVerificationMethods (6001)
When: Adding more than 10 verification methods to DID.Fix:
UnauthorizedDidOperation (6008)
UnauthorizedDidOperation (6008)
Error Handling Best Practices
Retry Logic
Error Logging
User-Friendly Error Messages
Debugging Tools
Transaction Inspector
Account Diagnostics
Common Error Scenarios
- Agent Not Found
- Insufficient SOL
- Rate Limited
- Wrong Network
Scenario: Fetching non-existent agentError:
ACCOUNT_NOT_FOUNDSolution:Support Resources
Discord Support
Get help from community and GhostSpeak team
GitHub Issues
Report bugs and request features
Troubleshooting Guide
Step-by-step debugging guide
Network Status
Check Solana network health
