Batch sign n times call at once for wallet

Hi devs,

I’m working for a project that handle deposit multiple tokens to a vault. Example:

  • Transfer 100 Chat to Vault
  • Transfer 100 EXE to Vault
  • Transfer 1 ICP to Vault
  • Transfer 0.1 ICP to fee wallet

Some tokens not support ICRC2 so I have to call icrc1_transfer for easy code in frontend

In the UX side, if I’m using NFID wallet or Plug wallet

  • User will need approval 4 transaction to transfer token 4 times

Asking doing atomic transaction for token in ICP is impossible right now. So why don’t we alow confirm batch transactions in one time?

1 Like

Do you have any specific fungible token ledger canister ids that do not support an approval flow?

Most ICRC ledgers do support ICRC-2 these days as far as I’m aware. The other non ICRC fungible token standard that I’m aware of is DIP20 and that also supports an approval flow.

Like example above EXE - you can check rh2pm-ryaaa-aaaan-qeniq-cai

But even all token support ICRC2, likely when I approve it, it will ask you approve allowance 3 or 4 times for going next step

As for batch ICRC-49 calls, that’s been a discussion in ICRC-39 but has been de-prioritized in the past due to other WG standards having a higher priority at the time.

1 Like

good to know you guys work on this

do you have the link to ICRC39

I would recommend asking the EXE dev to add support for ICRC-2 (if possible), this would simplify transaction flows significantly for all devs.

As for multiple approvals, I agree it’s not a great pattern as you describe, you have the same problem on other chains with this approach.

I would recommend to create approvals for higher allowance amounts initially so these approvals can be used for multiple transactions instead of a single transaction.

Also here’s a related fun read regarding “infinite allowances” in ERC20 tokens Unlimited ERC20 allowances considered harmful

Here’s the link wg-identity-authentication/topics/icrc_39_batch_calling.md at main · dfinity/wg-identity-authentication · GitHub

It’s listed as draft the in the Identity & Authentication WG overview, so no wallets have implemented support yet. It’ll probably need to be first brought up again in the WG meeting for discussion to see how to move it forward from draft.

Your multiple token approvals use case is definitely a valid use case that hasn’t brought up before, highly appreciate this input :slightly_smiling_face:

2 Likes