solana-labs / solana-program-library

A collection of Solana programs maintained by Solana Labs
https://solanalabs.com
Apache License 2.0
3.5k stars 2.04k forks source link

Retrieve SPL tokens from an associated token account which associated to an SPL token account #2517

Closed yushizhao closed 2 years ago

yushizhao commented 2 years ago

I am not sure whether I am the first one to meet this issue... The story is, I requested a token transfer to my Solana USDC SPL token account from an exchange. Instead of directly making a token transfer, this exchange created an associated token account for the Solana USDC SPL token account, and then transfer to that associated token account. Then, we have a nested ownership of SPL tokens: associated token account -> Solana USDC SPL token account -> system account, the real owner. I do not have the private key of that USDC SPL token account, since it is just an token account. When I try transfer with the key of the owner of the USDC SPL token account, it says "owner not match". Well, the owner of the associated token account is the USDC SPL token account, not that owner. So, is there a way to retrieve the token from the associated token account?

yushizhao commented 2 years ago

I just found https://github.com/solana-labs/solana-program-library/issues/2248 is a similar issue. The difference I have is, the account in the middle of the ownership chain is not an ATA account. I hope we can have a way to prove the chain of ownership to the SPL token program, then we can solve these problems.

Moserious commented 2 years ago

Did you resolve this matter and if so how?

yushizhao commented 2 years ago

@Moserious Are you also in the same situation? No. I didn't solve it. I think it need to modify the SPL token program to solve it.

Moserious commented 2 years ago

@yushizhao Yes, same situation I think. I was using FTX app and when I was transferring USDC to another exchange, the FTX prompted me to enter an USDC or SOL address. I entered a SOL address, not sure why I chose to do that, but now the USDC is "stuck" so to speak via the Associated Token Account Program. The "owner" of the USDC is reflected as my Solana account address, but I'm not sure as of yet how to send the USDC from the Token Account, but am working on it. Keep me posted, and I'll do the same.

yushizhao commented 2 years ago

@Moserious I think, if the situation is:

Your NATIVE sol (not wrapped sol) account -> own the ATA USDC account.

Then you are good, you can transfer the token! Well, as long as you hold the NATIVE sol account's private key. Or, if you mean the private key is hold by the another exchange. You can try ask them, they should be able to transfer the USDC with the private key!

Hope everything goes well!

t-nelson commented 2 years ago

Hi! We don't use Github for support requests. Please join us in #wallet-support on https://solana.com/discord instead!