I have a Solana account with a USDC associated token account (PDA), and within that, a nested USDC associated token account (PDA). I'd like to recover all the USDC and close the nested account. I see this PR which looks to solve my problem, but I have no idea how to invoke it.

I saw this article which referenced this tool. As is, the tool only supports KIN and uses https://api.mainnet-beta.solana.com/ which results in Access forbidden, contact your app developer or [email protected], so I modified the tool with the js debugger to use my own node and change the KIN contract address to USDC. I got a little further but sadly ended with failure.

183-5d1f66cbd08544ef.js:1 publicKey_test: HGx7qY3ZDxiJe7B3ynBJYq5QPHSYPzdq6fvLZuYBVy4j
183-5d1f66cbd08544ef.js:1 kinTokenAccount: xzCdAwDAMxBquXR2upC5ptr3pi4pZvEY9M6yaaaN6vc balance: 9.06
183-5d1f66cbd08544ef.js:1 key NOT on curve (PDA): xzCdAwDAMxBquXR2upC5ptr3pi4pZvEY9M6yaaaN6vc
183-5d1f66cbd08544ef.js:1 kinTokenAccount_ata: xzCdAwDAMxBquXR2upC5ptr3pi4pZvEY9M6yaaaN6vc
183-5d1f66cbd08544ef.js:1 kinTokenAccount_nested_ata: HAH4KfwmaJtvyNzkPaNCLJJFUbjW5LTkvufChQhLQEXV
183-5d1f66cbd08544ef.js:1 kinTokenAccount_nested: HAH4KfwmaJtvyNzkPaNCLJJFUbjW5LTkvufChQhLQEXV balance: 10
183-5d1f66cbd08544ef.js:1 key NOT on curve (PDA): HAH4KfwmaJtvyNzkPaNCLJJFUbjW5LTkvufChQhLQEXV
Error processing Instruction 0: Cross-program invocation with unauthorized signer or writable account 
  • Without access to the source code of the tool, it's hard to tell what's going wrong. Most likely it's passing in an incorrect address somewhere. Can you provide any other info?
    – Jon C
    Jan 25, 2023 at 12:27
  • I created an account on this SE just to state the tool that @pepeIKO created worked perfectly. If it fails at all, try it again. Was able to recover tokens easily.
    – Shadow386
    Mar 18 at 15:11

1 Answer 1


If you haven't resolved this yet, I built a UI that attempts to recover nested ATAs: https://tools.blastctrl.com/spl-token-tools/recover-nested

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.