Hey everyone! I’m a bit of a Solana rookie so bare with me please :)
On EVM, you can take a Method ID and Contract Address and essentially describe what the transaction does. For example, you could say that any Ethereum transaction for contract address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
where the method id = 0xd0e30db0
is a wrap transaction. I’m not super technical so something important to me is that a simple REST API returns both of these pieces of data (the contract address and method id). Conveniently, Etherscan’s APIs return both of these. Additionally, none of the above information needs to be decoded to describe what is happening in a transaction (or, the function of the transaction - wrap).
What is the equivalent of this on Solana? I’m looking for a way to essentially categorize transactions. I believe the program id/address is the equivalent of a contract address on EVM, but what would be equivalent to the method id? I am guessing it has to be derived from the instruction data. The only pattern I am seeing is that the first couple characters of the instruction data for transactions are matching. For example, in the following Orca add liquidity transactions (randomly pulled from Solscan), I noticed the first characters of the Increase Liquidity instruction data are 2e9cf3760dcdfbb2
:
hJuoxaWqekQrCiyy7ja4M1mVQzeLk1fNyRdwQYehQPPzyN2q66fcFakwpgca4NsqwyZo45i651hoo5h2bza2iZn
25evH5FmDHgoSQqqcNUTyDKTmHFQXNQFJvNj2wpybdcWkykh8Ko6emd27X6y7La6DnMt1NBtB836Uj11FY8vCcE5
4ZywKdTDqX8FZ6nvhchmPQQBVeznz62miMWLDyrV7WBQoFeEfPySAfXtzhhxAxfm5vTWmrDDitzhGqbDFVkKQRmR
Therefore, do the first couple characters of the instruction data uniquely describe the function that is being executed?
I might be thinking about this completely wrong, but any suggestions on how to categorize various types of Solana transactions would be immensely helpful.
Thank you!