# \[Build with Nym SDKs\] Grant for the miniapp: Telegram NYM Wallet

**URL:** <https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480>\
**Category:** Phase 1: Proposals\
**Tags:** missions\
**Created:** [July 30, 2024, 4:20pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480 "2024-07-30T16:20:01Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [July 30, 2024, 4:20pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/1 "2024-07-30T16:20:01Z")

</div>

Squad craftdome.space presents the concept of Telegram Nym Miniapp Wallet.

Budget: 100k $NYM for 6 months  
Platform: Telegram miniapp  
Presentation: [craftdome.space-nym-miniapp-wallet.pdf — Яндекс&nbsp;Диск](https://disk.yandex.ru/i/ZVzgHF7YtVLmlw)

 ![Grant1-Milestones](https://forum.nym.com/uploads/default/original/1X/89c8e0475d26c5b8afc875a623ad7acfe3636502.jpeg)

Main privacy question from Simon:  
Q:

> One question I have for you is about security. A wallet is risky business - how can you ensure the security of the app?

A:

> Brief intro: Telegram miniapps have user-linked CloudStorage accessible via API where miniapps can store key-value data.
> 
> How user seed-phrases will be protected:  
> PrivateKey (Seed Phrase) encrypts by telegram-user-id + user-PIN
> 
> Telegram CloudStorage - key-value user’s storage available to the Telegram user only.
> 
> As you may have noticed, this grant doesn’t include a backend. Since it’s really not needed for the wallet work. Everything happens on the client side. The data is stored in the user’s KV-storage only.
> 
> This app is a compromise between convenience and security.

---

<div class="post-metadata">

**Author:** ![Beyond](https://forum.nym.com/user_avatar/forum.nym.com/beyond/32/2094_2.png) [@Beyond](https://forum.nym.com/u/Beyond)\
**Post date:** [July 31, 2024, 8:10am UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/2 "2024-07-31T08:10:38Z")

</div>

Integration can be interesting

---

<div class="post-metadata">

**Author:** ![max-nym](https://forum.nym.com/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@max-nym](https://forum.nym.com/u/max-nym)\
**Post date:** [August 28, 2024, 11:11am UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/3 "2024-08-28T11:11:28Z")

</div>

First of all, great looking presentation of the plan, and the UI mockups look great.

I have a few questions:

- What is the added functionality here that isn’t covered by the existing explorer which allows you to e.g. stake and delegate already via Keplr?
- Are you going to integrate a version of the Keplr wallet into this proposed app?
- Can you please expand on an answer to a previous question: if there is cloud storage, it seems like the grant doesn’t have a backend in that you’re not writing your own, but is infact relying on Telegram’s backend? Re:

> Telegram CloudStorage - key-value user’s storage available to the Telegram user only.

> Telegram miniapps have user-linked CloudStorage accessible via API where miniapps can store key-value data.

Does this mean that the seed phrase is encrypted but still stored in the ‘CloudStorage’ KV store?

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [August 28, 2024, 12:13pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/4 "2024-08-28T12:13:17Z")

</div>

> [@max-nym](#):
>
> What is the added functionality here that isn’t covered by the existing explorer which allows you to e.g. stake and delegate already via Keplr?

There should be no differences in functions (for the current stage). This is another implementation of the explorer. Since we plan to develop the project for several grants, we plan to add the functionality of delegation recommendations/tips/advices in the next grant.

> [@max-nym](#):
>
> Are you going to integrate a version of the Keplr wallet into this proposed app?

No

> [@max-nym](#):
>
> Can you please expand on an answer to a previous question: if there is cloud storage, it seems like the grant doesn’t have a backend in that you’re not writing your own, but is infact relying on Telegram’s backend?

The current grant doesn’t have a backend part, except that [github.io](http://github.io) to host the frontend.

> [@max-nym](#):
>
> Does this mean that the seed phrase is encrypted but still stored in the ‘CloudStorage’ KV store?

Yes. The purpose of the app, first of all, is to reduce the threshold of entry into the nym-ecosystem. So yes.

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [August 28, 2024, 12:16pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/5 "2024-08-28T12:16:08Z")

</div>

Goal for several grants

 ![Goal](https://forum.nym.com/uploads/default/original/1X/3fffcfc0fcc4fa558ba8b5611a6416713dea596a.jpeg)

---

<div class="post-metadata">

**Author:** ![max-nym](https://forum.nym.com/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@max-nym](https://forum.nym.com/u/max-nym)\
**Post date:** [August 28, 2024, 2:02pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/6 "2024-08-28T14:02:18Z")

</div>

> There should be no differences in functions (for the current stage). This is another implementation of the explorer. Since we plan to develop the project for several grants, we plan to add the functionality of delegation recommendations/tips/advices in the next grant.

I like the tip/recommendation idea, but I’m wondering why the need to reimplement parts of the explorer instead of e.g. trying to port that to a mobile-friendly context.

> Yes. The purpose of the app, first of all, is to reduce the threshold of entry into the nym-ecosystem. So yes.

Whilst it may be reducing the threshold to entry, the idea of storing even encrypted seed phrases anywhere outside of the users device does not seem like a good practice. Why this, instead of storing them locally on the device? Have there been audits of the KV store that are public? Given the public worries regarding some of the other crypto standards used by the Telegram app this is especially important.

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [August 29, 2024, 7:14am UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/7 "2024-08-29T07:14:54Z")

</div>

> [@max-nym](#):
>
> I’m wondering why the need to reimplement parts of the explorer instead of e.g. trying to port that to a mobile-friendly context.

Now users do not have a mobile version of the wallet and explorer.

> [@max-nym](#):
>
> Why this, instead of storing them locally on the device?

This is a site inside the Telegram client. Telegram does not give access to the system files. It also doesn’t have browser extensions.

But we intentionally want to use linking a wallet to user’s Telegram account, in order to increase usability and reduce the entry threshold for an amateur. Just like trading exchanges do. Each user decides for himself what information security he needs, balancing between convenience and security.

> [@max-nym](#):
>
> Have there been audits of the KV store that are public? Given the public worries regarding some of the other crypto standards used by the Telegram app this is especially important.

I haven’t watched any KV Store security audits. But do you think they would have launched TON wallet ([Telegram: Contact @wallet](https://t.me/wallet)) as a miniapp if it was unsafe?

Of course, this cannot be an argument, but it is still a fact. People have to trust others, otherwise the world would exist without them.

What do you think about Telegram’s reputation in terms of storing personal data compared to crypto exchanges like bybit, okx, etc?

---

<div class="post-metadata">

**Author:** ![max-nym](https://forum.nym.com/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@max-nym](https://forum.nym.com/u/max-nym)\
**Post date:** [August 29, 2024, 9:02am UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/8 "2024-08-29T09:02:14Z")

</div>

> [@craftdome](#):
>
> But do you think they would have launched TON wallet ([Telegram: Contact @wallet](https://t.me/wallet)) as a miniapp if it was unsafe

I still don’t think it is a good security practice, even if others have done it.

> What do you think about Telegram’s reputation in terms of storing personal data compared to crypto exchanges like bybit, okx, etc?

Personal data is one thing, seed phrases which give access to an account is another. I also think we should move away from the CEX model to a decentralised one, or at least don’t need to replicate it in terms of placing unnecessary trust on e.g. a centralised exchange over users holding their own seed phrases.

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [August 29, 2024, 10:00am UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/9 "2024-08-29T10:00:03Z")

</div>

> [@max-nym](#):
>
> I also think we should move away from the CEX model to a decentralised one, or at least don’t need to replicate it in terms of placing unnecessary trust on

In this case, we will not be able to make the wallet on Telegram miniapp.

There is no way to store the seed phrase securely, even on the user’s device. In this regard, web2 is safer, since there are antifraud systems that cannot be in web3.

**Any suggestions?**

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [August 29, 2024, 10:26am UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/10 "2024-08-29T10:26:27Z")

</div>

It seems that the security provided by symmetric encryption algorithms is sufficient. How can a potential attacker crack a seed phrase encrypted without user password? How is this different from the keplr extension?

---

<div class="post-metadata">

**Author:** ![max-nym](https://forum.nym.com/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@max-nym](https://forum.nym.com/u/max-nym)\
**Post date:** [August 29, 2024, 1:12pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/11 "2024-08-29T13:12:06Z")

</div>

> [@craftdome](#):
>
> There is no way to store the seed phrase securely, even on the user’s device

Strong disagree: if your device is rooted then having a conversation regarding the security of any file is imo pointless.

> In this regard, web2 is safer, since there are antifraud systems that cannot be in web3.

Sure, in that way it is.

> **Any suggestions?**

There are multiple other frameworks and architectures to make a mobile wallet with e.g porting the existing Tauri app framework to mobile [Announcing the Tauri Mobile Alpha Release | Tauri](https://v2.tauri.app/blog/tauri-mobile-alpha/)

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [August 29, 2024, 1:33pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/12 "2024-08-29T13:33:08Z")

</div>

> [@max-nym](#):
>
> Strong disagree: if your device is rooted then having a conversation regarding the security of any file is imo pointless.

That’s exactly what I meant.

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [August 29, 2024, 1:34pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/13 "2024-08-29T13:34:06Z")

</div>

> [@max-nym](#):
>
> There are multiple other frameworks and architectures to make a mobile wallet with e.g porting the existing Tauri app framework to mobile [Announcing the Tauri Mobile Alpha Release | Tauri](https://v2.tauri.app/blog/tauri-mobile-alpha/)

It’s not in our area of expertise.

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [August 29, 2024, 1:38pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/14 "2024-08-29T13:38:56Z")

</div>

What kind of attack are you defending against? Any android and iphone (up to 12) are broken by a single flash drive (see GroupIB).

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [September 19, 2024, 10:51am UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/15 "2024-09-19T10:51:26Z")

</div>

> **[GitHub - craftdome/nym-tg-wallet-proposal: A concept of Telegram Nym Miniapp Wallet](https://github.com/craftdome/nym-tg-wallet-proposal)**
>
> A concept of Telegram Nym Miniapp Wallet

- A crate with pdf.

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [September 22, 2024, 2:40pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/16 "2024-09-22T14:40:47Z")

</div>

Hey Max  
What about the proposal?

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [October 28, 2024, 12:25pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/17 "2024-10-28T12:25:05Z")

</div>

I have a suggestion to improve the security of user data.

We can store an encrypted seed phrase in the local storage of the user’s device (e.g. cookies) instead of Telegram CloudStorage.

This will reduce the usability of the app, because the user will have to enter a seed phrase a little more to gain wallet access, but this way the data will be controlled by his device, not Telegram.

---

<div class="post-metadata">

**Author:** ![sudonym](https://forum.nym.com/user_avatar/forum.nym.com/sudonym/32/665_2.png) [@sudonym](https://forum.nym.com/u/sudonym)\
**Post date:** [October 29, 2024, 2:17pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/18 "2024-10-29T14:17:04Z")

</div>

That sounds better as long as it doesn’t make the app unusable - how often would the user have to enter their seed phrase?

---

<div class="post-metadata">

**Author:** ![craftdome](https://forum.nym.com/user_avatar/forum.nym.com/craftdome/32/312_2.png) [@craftdome](https://forum.nym.com/u/craftdome)\
**Post date:** [October 31, 2024, 12:19pm UTC](https://forum.nym.com/t/build-with-nym-sdks-grant-for-the-miniapp-telegram-nym-wallet/480/19 "2024-10-31T12:19:29Z")

</div>

Re-entering the seed-phrase can be called in the cases provided for the WebView component (Android/IOS):

1. Reinstalling the app (Telegram)
2. Clearing the app data in the phone settings
3. Expiration of cookies
