Solana Version Transaction Program ID Issue
As a developer using the web3.js library to create versioned transactions, you are probably familiar with the process. However, I have encountered an issue with one specific instruction: using the Altcoin program ID ix
.
After digging into the documentation and experimenting with various examples, I am writing to report an issue with the ix
program ID used in Versioned Transactions. According to the specifications [1], for transactions created with version 7 or later, the programId
must be a versioned transaction (VTX) itself.
Unfortunately, it seems that the Altcoin program ID ix
is not supported by this feature. When using ix
as the program ID in Versioned Transactions, the resulting instruction will fail to create the correct VTX.
Workaround
To work around this issue, you can use a different program ID for the version transaction statements. Here are some alternatives:
- Use
programId: "0x000000000000000000000000000000000000000000000001"
: This is the recommended program ID for VTX in web3.js.
- Use an empty string (
""
): If you need to test a specific statement, you can use an empty string as the program ID.
Updated Instructions
Here is an example of how to create a versioned transaction using a supported program ID:
const versiondTransaction = await web3.eth.createVersionedTransaction({
data: txData,
from: accountAddress,
nonce: web3.eth.getTransactionCount(accountAddress),
});
// Create the VTX instruction
const vtxInstruction = {
...versionedTransaction.instructions,
program ID: "0x0000000000000000000000000000000000000000000001",
};
// ... process the VTX instruction...
Conclusion
In conclusion, the use of Altcoin’s ix
program ID in Versioned Transactions is not supported. Instead, you can use alternative program IDs, such as programId: "0x00000000000000000000000000000000000000000000001"
or an empty string (""
). This will ensure that your transactions are created correctly.
Recommendations
For future reference:
- Check the documentation for the latest information on supported program IDs and instructions.
- Test different instruction formats to find the one that works best for you.