# How to transfer ICP to a dapp's account

**URL:** <https://forum.dfinity.org/t/how-to-transfer-icp-to-a-dapps-account/33610>\
**Category:** Developers\
**Created:** [July 25, 2024, 10:03pm UTC](https://forum.dfinity.org/t/how-to-transfer-icp-to-a-dapps-account/33610 "2024-07-25T22:03:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [July 25, 2024, 10:03pm UTC](https://forum.dfinity.org/t/how-to-transfer-icp-to-a-dapps-account/33610/1 "2024-07-25T22:03:57Z")

</div>

I want the following:

1. associate to each user’s principal in my dapp an ICP-holding account
2. make it easy for a user to top-up this account

The first I don’t know to do, because I know about [nns.icp0.app](https://nns.ic0.app) accounts, but I need this account not on `nns.icp0.app` but on app UI. So, how? (How a dapp can create an account for itself?)

The second, is there an easier way than the user manually copying&pasting the account address to `nns.icp0.app` to pay? The payments may be done by the user multiple times; should he/she copy&paste every time?

---

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [July 26, 2024, 5:24am UTC](https://forum.dfinity.org/t/how-to-transfer-icp-to-a-dapps-account/33610/2 "2024-07-26T05:24:08Z")

</div>

[README.md](https://github.com/dfinity/examples/blob/master/motoko/icp_transfer/README.md) explains how to do it. Particularly, it tells that

```bash
dfx ledger account-id --of-canister icp_transfer_backend

```

command can be used to know the account ID that the canister controls.

It remains the questions, however, how to do this in Motoko, rather than in `dfx` command line.

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [July 26, 2024, 8:40am UTC](https://forum.dfinity.org/t/how-to-transfer-icp-to-a-dapps-account/33610/3 "2024-07-26T08:40:57Z")

</div>

Here’s some Motoko functions you can copy/paste that I wrote a while back: [memeployer/src/memeployer\_backend/Account.mo at 07e5c69e7121f8524851124d36193a6edeb22d69 · sesi200/memeployer · GitHub](https://github.com/sesi200/memeployer/blob/07e5c69e7121f8524851124d36193a6edeb22d69/src/memeployer_backend/Account.mo#L28-L48)
