I sent my tokens to the correct principle ID, but on the optional line for "Sub Account ID" I pasted my main Account ID. My tokens never arrived. HELP PLEASE

Hey Community,

I used Sonic to swap tokens, and when I went to send my tokens back to my NNS Wallet, below the Principle ID line theres a line that states “Optional Sub Account ID”.

Because it said optional, I assumed that it couldn’t hurt to paste my main ICP ID there just as a precaution. After all, I pasted my correct Principe ID on the line that actually matters, so its not like the optional line would effect the transaction. Other than maybe just to further insure that my tokens would arrive at the correct wallet; right?

At least thats what I was thinking at the time. However, the tokens have never arrived and now I’m left here with a pit in my stomach, hoping that I didn’t just lose close to 100 $ICP tokens.

As you can tell I am new to the ICP network, so if anyone who has a heck of a lot more knowledge than me can help me recover my tokens I will be extremely grateful!

In any other situation I wouldn’t even have wasted my energy writing this but I SENT MY TOKENS TO THE CORRECT PRINCIPLE ID ADDRESS. I don’t even know what a Sub Account ID is but its said it was OPTIONAL LOL.

Please Help me if possible. Thank You friends.

1 Like

As the zoomers would say “gg no re”

Sorry I’m not familiar with that terminology.

@rem.codes @chepreghy @bjoern @peterparker looks like I’m not the only one who had this issue. Who are the best people to tag on this post? Would be nice to see a utility someday that can make recovery easy.

3 Likes

This probably happend because you used sonic try using kongswap.io next :gorilla:

Can someone please provide me with the correct information I need to recover my funds, or the contact information for someone who can assist me with this. The tokens I transferred are $GOLDAO so maybe you can help me? @GOLDDAO

I submitted a ticket to the Sonic Discord yesterday but they have yet to reply; though it is still the weekend.

I also emailed DFINITY support and they asked me if I sent “them” the correct wallet address, but I’m not sure who the “them” they are referring to is.

Here is a screenshot of the transaction on ICP DASHBOARD:

If you click on the Address my tokens were sent to, you will see that they were sent to my correct Principle ID. I cant post a link on here directly, but if you go on ICP Dashboard here is the full address its under so you can see for yourself.

sleoa-qv72u-h3jtz-3um3z-7qhei-wcxxm-a3yjz-ek32d-566ar-lbmxt-5ae-hjpz2eq.388ede87294df5ebb0ce3c6822e71f1f3ed64a2330a3a6b1131ecf1eef3dc9d8

If you look that address up on ICP DASHBOARD and click on it you will see that my Principle address is correct. but under “Subaccount” it shows my main ICP Account ID.

Im sure theres a way to retrieve my tokens, as they were sent to the correct principle address, but I cant seem to get in touch with the right support to help me with this.

I greatly appreciate any feedback that can help me with this. I also want to thank @wpb for tagging all of those people on this post.

Thank You

Actually, I just realized that my comment was relevant to an ICP address. I’m not sure if my comments are relevant for an SNS token address.

Here is the full forum I posted regarding this issue.

Thanks Again @Bugslayer

Hey. If you have access to the key pair starting with sleoa-…2eq, then technically you also have access to the subaccounts. In fact, when you transfer to a principal, you’re transferring to the default account with the subaccount 0000…0000. But in your case, you made the transaction to a non-default subaccount. From here, it all depends on the wallet you’re using or the other key manager you rely on. So don’t worry — it’s most likely recoverable.

It would be nice to see someone build this recovery feature. As far as I know, it doesn’t exist yet.

1 Like

It’s just a few lines of code. I don’t know which wallet you’re using, but you need to extract the delegation or key pair and run a simple script.


let delegation = Ed25519KeyIdentity.fromKeyPair(.....) //your source key pair or some other way to create delegation
  
  const agent: Agent = new HttpAgent({ host: "https://ic0.app", identity: delegation})
  const Account = IDL.Record({
    owner: IDL.Principal,
    subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
  })
  const TransferArg = IDL.Record({
    to: Account,
    fee: IDL.Opt(IDL.Nat),
    memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
    from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
    created_at_time: IDL.Opt(IDL.Nat64),
    amount: IDL.Nat,
  })
  const Icrc1TransferResult = IDL.Variant({
    Ok: IDL.Nat,
    Err:  IDL.Variant({
      InsufficientFunds: IDL.Record({ balance: IDL.Nat }),
    }),
  })
  const idlFactory: IDL.InterfaceFactory = ({ IDL }) =>
    IDL.Service({
       icrc1_transfer: IDL.Func([TransferArg], [Icrc1TransferResult], []),
  })
  const actor: ActorSubclass = Actor.createActor(idlFactory, {
    agent,
    canisterId: "ryjl3-tyaaa-aaaaa-aaaba-cai", // your SNS canister
  })
  let requst = {
    to:  {
      owner: Principal.fromText("SOME_PRICNCIPAL"), //your target account
      subaccount: [],
    },
    fee: [],
    memo: [],
    from_subaccount: ["YOUR_SUBACCOUNT"],
    created_at_time: [],
    amount: 10000, //AMOUNT TO TRANSFER FROM
  }
  const result = (await actor[
    "icrc1_transfer"
    ](request))
 console.log(result)```
2 Likes

Thanks @Oleksii.

Hey @rem.codes is this the kind of thing that you can build into the toolkit so it is more user friendly? Hey @bjoern @chepreghy @yhabib do you think the code above would work? Is there any chance of integrating this kind of recovery feature into the NNS dApp?

1 Like

This comes down to this GitHub - rem-code-s/yolosns

But it’s not possible to build this into toolkit because we don’t have access to the principal that is domain specific to the NNS domain

@Oleksii would your solution work with just getting the data out of local storage or indexDB?

1 Like

Absolutely right. The NNS uses a domain-specific account, which can’t be used in a third-party dApp — and it shouldn’t be, as that would be insecure.

If we’re talking about the NNS, then we’re really talking about Internet Identity. As far as I know, those guys store the delegation in an indexed DB. And yes, if you extract and handle it properly, the script should work.

If we’re talking about a DEX, then it’s most likely a wallet/extension or again II. You need to extract the identity data and plug it into the script.

So it’s a very individual task — depends entirely on what you’re working with. But still possible and not really complicated.

2 Likes

Hi @cryptosophy @wpb and everyone

We will explore various solutions for this type of problem. I will update this chat once we have a clearer idea.

3 Likes

Hey @Oleksii Im very new to Internet Identity so I’m a little confused.

Im using the NNS wallet and my principe ID is the sleoa-…2eq address so yes I have access to my wallet but the tokens are not accessible to me and my account balance is $0.

Can you please walk me through the steps I need to take to access my subaccounts.

Keep in mind that I accidentally sent my tokens to the Subaccount address thats actually my main ICP ID address.

Furthermore, I believe that subaccount addresses are less digits than main ICP IDs so that is also another confusing matter to consider.

I really appreciate your help, thank you!

Thank you so much @yhabib I look forward to hearing from you!

@cryptosophy I checked — NNS (Internet Identity) stores the identity in CryptoKey format, and it’s not extractable. So you can’t just copy it and plug it into a script — it’s protected by the browser.

If this were a serious necessity, I’d suggest a more advanced workaround: adding a temporary device (or using a recovery phrase) to Internet Identity and requesting a delegation directly through the API. But that’s a longer route and requires technical skills.

I think the best option is to wait for a solution from the DFINITY team — that’s the most appropriate way to handle this situation.
Especially since the team is already on it — the solution shouldn’t be far off.

2 Likes

Thank you for all your time and valuble information @Oleksii

Yes the DFINITY team is great, so I know they will get back to me soon.

1 Like