How to analyze deployed Solana programs using their Program ID
Program ID analysis allows you to analyze Solana programs that are already deployed to the blockchain. This method is useful for security analysis of live programs or verifying the security of contracts you interact with.
When using Program ID analysis, Believe Security fetches the program's bytecode directly from the Solana blockchain and performs analysis on the executable data.
To analyze a program using its Program ID, you need:
Program ID analysis works with bytecode and does not have access to the original source code. This may result in less detailed findings compared to source code analysis. For best results, use GitHub Repository or File Upload when possible.
Key limitations of Program ID analysis include:
From the Dashboard, click on "New Analysis" and select "Program ID" as your analysis source.
Enter the following information:
7Y8VDzehoewALqJpgGrKdEQssmJpbxBRJooaK6ZYxFqt
)Click "Start Analysis" to begin. Believe Security will:
If you don't know the Program ID you want to analyze, you can find it in several ways:
Most Solana projects document their Program IDs in their:
You can query the Solana blockchain programmatically to find Program IDs:
// Using the Solana Web3.js library
const connection = new Connection("https://api.mainnet-beta.solana.com");
const programAccounts = await connection.getProgramAccounts(
new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")
);
You can customize the depth of bytecode analysis:
If you're analyzing programs on congested networks or need faster response times, you can specify a custom RPC endpoint:
Using a private RPC endpoint can significantly improve analysis speed, especially for larger programs or during times of network congestion.
If you encounter a "Program not found" error:
If the analysis times out:
If you receive limited or non-specific results:
Program ID analysis is particularly useful in these scenarios: