Problem with Versioned Transaction Program ID in Solana
As a developer using the web3.js library to create versioned transactions, you may be familiar with the process. However, I have encountered an issue with one specific statement: the use of the ix
program ID on Altcoins.
After carefully reviewing the documentation and experimenting with various examples, I am writing to report an issue with the use of the ix
program ID in versioned transactions. According to the specification [1], for transactions created with version 7 or later, the programId
must be a versioned transaction (VTX).
Unfortunately, the Altcoin ix
program ID does not appear to be supported by this feature. If ix
is used as the program ID in versioned transactions, the resulting statements will fail to create the correct VTX.
Problem Resolution
To resolve this issue, you can use a different program ID for versioned transaction statements. Here are some options:
- Use
programId: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
– This is the recommended program ID for VTX in web3.js.
- Use an empty string (
""
) – If you want to test specific statements, you can use an empty string as the program ID.
Updated Statements
Here is an example of how to create a versioned transaction using a supported program ID:
const versionedTransaction = await web3.eth.createVersionedTransaction({
data: txData,
from: accountAddress,
nonce: web3.eth.getTransactionCount(accountAddress),
});
// Create VTX instructions
const vtxInstruction = {
...versionedTransaction.instructions,
Program ID: "0x000000000000000000000000000000000000000000000000000000000000001",
};
// ... Set VTX instructions...
Conclusion
Finally, using the Altcoin program ID ix
in versioned transactions is not supported. Alternatively, you can use alternate program IDs such as programId: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000001"
or an empty string (""
). This will ensure that your transactions are created correctly.
Recommendations
For future reference:
- Please see the documentation for the latest information on supported program IDs and instructions.
- Try different instruction formats to find the one that works best for you.