# How to build a usdc/usdt custodial wallet on icp?

**URL:** <https://forum.dfinity.org/t/how-to-build-a-usdc-usdt-custodial-wallet-on-icp/35962>\
**Category:** Developers\
**Created:** [October 8, 2024, 11:24am UTC](https://forum.dfinity.org/t/how-to-build-a-usdc-usdt-custodial-wallet-on-icp/35962 "2024-10-08T11:24:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AliSci](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/alisci/32/33799_2.png) [@AliSci](https://forum.dfinity.org/u/AliSci)\
**Post date:** [October 8, 2024, 11:24am UTC](https://forum.dfinity.org/t/how-to-build-a-usdc-usdt-custodial-wallet-on-icp/35962/1 "2024-10-08T11:24:30Z")

</div>

My goal is to create a wallet for my own website where people can deposit and withdraw, Just imagine I am building a Binance version on icp

---

<div class="post-metadata">

**Author:** ![jennifertran](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jennifertran/32/11558_2.png) [@jennifertran](https://forum.dfinity.org/u/jennifertran)\
**Post date:** [October 11, 2024, 1:57am UTC](https://forum.dfinity.org/t/how-to-build-a-usdc-usdt-custodial-wallet-on-icp/35962/2 "2024-10-11T01:57:21Z")

</div>

Thinking out loud, have you considered this architecture?

You create an ICP canister.

For each user, within the ICP canister, you create ECDSA key with the `derivation path` as a user ID.

Users can send the native USDC and USDT to their ECDSA key.

If they need to send their USDC or USDT somewhere, the canister can sign on their behalf.

I am describing this quite high level at the moment but let me know if you need a deep dive in a specific area!

---

<div class="post-metadata">

**Author:** ![AliSci](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/alisci/32/33799_2.png) [@AliSci](https://forum.dfinity.org/u/AliSci)\
**Post date:** [October 16, 2024, 8:42am UTC](https://forum.dfinity.org/t/how-to-build-a-usdc-usdt-custodial-wallet-on-icp/35962/3 "2024-10-16T08:42:30Z")

</div>

> [@jennifertran](#):
>
> ECDSA

I am trying to use something like oisy now, and first step is to create eth wallet then call `encodePrincipalToEthAddress(Principal.fromText(profile.id))` but still tryting to figure out the code, i got all the theories by now  
I want to call scketh and from it swap to used and verify that the user made a deposit

i made this [https://codesandbox.io/p/sandbox/6pp95t](https://codesandbox.io/p/sandbox/6pp95t) just to get started with make usdc wallet and generate usdc address

---

<div class="post-metadata">

**Author:** ![jennifertran](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jennifertran/32/11558_2.png) [@jennifertran](https://forum.dfinity.org/u/jennifertran)\
**Post date:** [October 17, 2024, 4:22am UTC](https://forum.dfinity.org/t/how-to-build-a-usdc-usdt-custodial-wallet-on-icp/35962/4 "2024-10-17T04:22:35Z")

</div>

Thinking out loud again:

If you are trying to swap ckETH to USDC, it might make sense to swap to ckETH to ckUSDC and then convert ckUSDC to USDC with the deposit account as the ECDSA key that you generated for the user.

---

<div class="post-metadata">

**Author:** ![jennifertran](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jennifertran/32/11558_2.png) [@jennifertran](https://forum.dfinity.org/u/jennifertran)\
**Post date:** [October 17, 2024, 4:31am UTC](https://forum.dfinity.org/t/how-to-build-a-usdc-usdt-custodial-wallet-on-icp/35962/5 "2024-10-17T04:31:04Z")

</div>

> [@AliSci](#):
>
> `encodePrincipalToEthAddress(Principal.fromText(profile.id))`

I am not sure if this is the right approach since the Principal is not specific to your canister and a user id. For example, let’s say that your user’s id is “abc”, you are then converting “abc” to a principal and then to an ETH address without any regard to the user specifically using your canister. Another dapp could convert the same text “abc" to a principal and then an ETH address. Multiple users could potentially share the same principal and ETH address.

Have you looked into Threshold ECDSA examples?

---

<div class="post-metadata">

**Author:** ![AliSci](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/alisci/32/33799_2.png) [@AliSci](https://forum.dfinity.org/u/AliSci)\
**Post date:** [October 17, 2024, 6:35am UTC](https://forum.dfinity.org/t/how-to-build-a-usdc-usdt-custodial-wallet-on-icp/35962/6 "2024-10-17T06:35:24Z")

</div>

Yes, i was checking, oisy repo, and chain fusion example,  
for ECDSA examples i think it is the most helpful one, as they have send\_eth and ethereum\_address methods. I am assuming calling the ethereum\_address method is used to deposit. So u copy the address and put it in binance account to deposit

> **[examples/motoko/threshold-ecdsa at master · dfinity/examples](https://github.com/dfinity/examples/tree/master/motoko/threshold-ecdsa)**
>
> Example applications, microservices, and code samples for the Internet Computer - dfinity/examples

---

<div class="post-metadata">

**Author:** ![kristofer](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/kristofer/32/11135_2.png) [@kristofer](https://forum.dfinity.org/u/kristofer)\
**Post date:** [October 18, 2024, 11:34am UTC](https://forum.dfinity.org/t/how-to-build-a-usdc-usdt-custodial-wallet-on-icp/35962/7 "2024-10-18T11:34:14Z")

</div>

@AliSci Also check out this just published example app on how to build an ETH wallet on ICP. It doesn’t support ERC-20 tokens but that could easily be added.

> [@Building a multi user Ethereum wallet on ICP using Alloy](https://forum.dfinity.org/t/building-a-multi-user-ethereum-wallet-on-icp-using-alloy/36308):
>
> ic-alloy is an open source project to make the [Alloy.rs](https://alloy.rs) support libraries available to ICP developers. Using Alloy instead of interacting with the EVM RPC canister directly provides a drastically simpler developer experience. As an example of how to use Alloy on ICP and as a template/starting point for other projects I built a simple multi user Ethereum wallet. Live demo: [https://7vics-6yaaa-aaaai-ap7lq-cai.icp0.io](https://7vics-6yaaa-aaaai-ap7lq-cai.icp0.io) Frontend source code: [ic-alloy-basic-eth-frontend](https://github.com/kristoferlund/ic-alloy-basic-eth-frontend) Backend source code: [ic-all…](https://github.com/kristoferlund/ic-alloy-basic-eth)

---

<div class="post-metadata">

**Author:** ![jfgrissom](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jfgrissom/32/18621_2.png) [@jfgrissom](https://forum.dfinity.org/u/jfgrissom)\
**Post date:** [October 7, 2025, 2:47am UTC](https://forum.dfinity.org/t/how-to-build-a-usdc-usdt-custodial-wallet-on-icp/35962/8 "2025-10-07T02:47:25Z")

</div>

I’ve been playing around with setting up ckTestBTC and learned a lot from doing it. It’s not complete but it’s interesting for this kind of thing. Needed it to figure out how to create a custodial wallet for gifting crypto to others where a custodian holds funds from one user to be delivered to another.

Questions it answers:

- How do you handle local development features without access to ckTestBTC or Physical TestNet funds? (Mock canisters that conform to ckBTC (minter and leger) at [ic/rs/bitcoin at 65e12ce072d7e2c4961f327325f21b210298378b · dfinity/ic · GitHub](https://github.com/dfinity/ic/tree/65e12ce072d7e2c4961f327325f21b210298378b/rs/bitcoin) )
- How can you mint some ckTestBTC and deliver it to an Authenticate Principal without needing physical TestNet BTC? Grant access to the minter locally!
- How do you receive ckTestBTC as a custodian? Need a deposit mechanism to pass from an authenticated principal to your canisters custodial solution (needs mapping of funds using subaccounts).
- Other interesting goodies there too.

> **[GitHub - jfgrissom/ic-ckTestBTC: Solid client for exploring ckTestBTC on the...](https://github.com/jfgrissom/ic-ckTestBTC)**
>
> Solid client for exploring ckTestBTC on the Internet Computer.
