Solana: address lookup table does not compress addresses as expected
A recent transaction on the Solana blockchain revealed a problem with the address lookup table, which is a critical component of the network’s decentralized finance (DeFi) ecosystem. The problem occurs when a user tries to view their own address in Solana Explorer.
Transaction
On December 2, the developer shared a transaction on Solana’s blockchain explorer, Explorer.Solana.com, which demonstrated a problem with the address lookup table. In particular, the transaction included sending a transaction with the following data:
- Transaction ID
:
5FvqJxfoffeBGMwQHh618KzZcNSHCmfdvY4xwNJBsSDyfNEqWpJ9R1FZSWRccyKkrsUDt4ZG3YaZEdvmawHSPT2X
- Cluster:
devnet
Problem
When reviewing the transaction, it became obvious that the address lookup table was not compressing the address as expected. In Solana, addresses are usually presented in a specific format that includes a checksum of the entire address, which is used to verify the authenticity and integrity of the transaction. However, when this checksum is calculated for an address, it does not always match the original address.
Problem
The problem arises because the address lookup table uses a simple hash function to calculate the checksum of each address. Although this approach may seem sufficient in many cases, it is not robust enough to handle certain types of addresses or edge cases. In particular:
- Single character address: When using a single character address (eg
abc
), the address lookup table calculates the checksum incorrectly.
- Address Extensions
: Some Solana addresses have extensions that require additional data that may be lost when calculating the checksum.
Conclusion
The problem with Solana’s address lookup table is an important one that should be addressed. Although the blockchain design has many strengths, its reliance on a simple hash function to calculate checksums can lead to errors and inconsistencies in certain cases. Developers and users should be aware of this potential problem when working with addresses on the Solana network.
Recommendations
To mitigate this problem, developers are encouraged to:
- Use more reliable address formats, such as multicharacter addresses or addresses with extensions.
- Implement additional checks to confirm the integrity of an address before using it for transactions.
In addition, users should be careful when working with addresses on the Solana network and consider contacting experienced developers or Solana experts for help if they have any problems with the address lookup tables.