doutv / wallet-unity

https://wallet-unity.vercel.app
Apache License 2.0
0 stars 0 forks source link

Integration Challenges #2

Open doutv opened 11 months ago

doutv commented 11 months ago

Before I dig into CCTP details, I thought all I need to do is burn some USDC on the source chain, then I just wait Circle mint USDC on the target chain.

However, it turns out that I should send 3 transactions:

  1. Approve the Circle contract to spend my USDC on the source chain.
  2. Burn USDC on the source chain.
  3. Mint USDC on the target chain.

I tried cctp-sample-app, it takes several minutes to bridge USDC from ETH to OP for testnets. For mainnets, the confirmation time is much longer.

Users have to wait for a long time to ensure their USDC are successfully bridged. Also, they have to pay gas fee on both chains. I think it is not a good experience.

image

doutv commented 11 months ago

Are there any ways that can smooth user experience?

For example, reduce the transaction number from 3 to 1. User only need to burn USDC on the source chain, then the app will handle the rest of all complex processes.

ERC20 Approve transaction -> Permit2 signature

Deploy a custom smart contract, use Permit2 to approve the contract to burn my USDC.

This reduces transaction count by 1.

Mint on behalf of user

Create an app backend:

  1. Fetch signed attestation from Circle
  2. Complete transfer on destination chain on behalf of user

This reduces transaction count by 1.