Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PolkaGate MetaMask Snap: Enhancing User Experience with Integrated Token Management and Staking Features #2488

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 199 additions & 0 deletions applications/polkamask-follow-up.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# PolkaGate MetaMask Snap (formerly known as PolkaMask)

- **Team Name:** PolkaGate
- **Payment Details:**
- **DOT**: 17VdcY2F3WvhSLFHBGZreubzQNQ3NZzLbQsugGzHmzzprSG
- **Payment**: 17VdcY2F3WvhSLFHBGZreubzQNQ3NZzLbQsugGzHmzzprSG (Asset Hub USDC)
- **[Level](https://github.com/w3f/Grants-Program/tree/master#level_slider-levels):** 2


## Project Overview :page_facing_up:

This application seeks funding for the next phase of the PolkaGate MetaMask Snap, aiming to introduce additional features and functionality in [PolkaMask: Polkadot with Metamask, milestone 1](https://github.com/w3f/Grant-Milestone-Delivery/pull/1120) [1]

[Polkagate](https://polkagate.xyz) is a dedicated team of Polkadot enthusiasts actively engaged in advancing the Polkadot ecosystem. Our diverse contributions include the development of the Polkagate extension, the PolkaGate MetaMask Snap, and the efficient management of Polkagate’s Polkadot and Kusama staking pools.

Since the release of the first version of the Polkagate Snap (initially named PolkaMask), significant advancements have been made on MetaMask’s end, introducing new features and enhanced programming capabilities for Snap developers. As the only Polkadot Snap listed in the MetaMask Snap directory, we are dedicated to leveraging these updates to deliver full control of Polkadot ecosystem tokens directly within the MetaMask extension.

### Overview
This project goes beyond being just a signer—it aspires to become a comprehensive Polkadot wallet integrated into MetaMask. With this wallet, you can effortlessly transfer funds, stake tokens (both solo and pooled staking), and manage all your staking activities, including unstaking, claiming rewards, selecting validators, configuring reward destinations, and more—all within the convenience of the MetaMask interface.</p>

![Figure 1](https://raw.githubusercontent.com/PolkaGate/snap/refs/heads/main/docs/images/fig1.png)


### Project Details

In this milestone of the PolkaGate Snap, users can select tokens they want to view from an extensive list of supported tokens, including testnet tokens such as Westend and Paseo. Token balances are conveniently displayed on the home page, allowing users to quickly review their holdings. Additionally, users can transfer tokens directly within the MetaMask interface, eliminating the need to rely on external dApps or leave MetaMask, ensuring a seamless and efficient experience.

Below, we showcase some screenshots of the PolkaGate MetaMask Snap’s user interface as part of this milestone:

- Selecting favorite chains, retrieving addresses in different chain formats, and transferring funds

![Figure 2, 3 , 4](https://raw.githubusercontent.com/PolkaGate/snap/refs/heads/main/docs/images/fig234.png)

- Various staking-related pages:

Users can view various tokens available for staking or already staked, along with their balance information and staking rates. In the staking info section, users will find useful information they need to be aware of before initiating staking.

![Figure 5, 6](https://raw.githubusercontent.com/PolkaGate/snap/refs/heads/main/docs/images/fig56.png)


The Snap automatically suggests the most suitable staking type based on the amount of tokens users wish to stake. It also recommends optimal settings, while still allowing users the flexibility to customize their configurations as desired.

![Figure 7, 8, 9](https://raw.githubusercontent.com/PolkaGate/snap/refs/heads/main/docs/images/fig789.png)


Below, you can see the solo and pooled staking pages after the user has staked their tokens. On these pages, users have the option to adjust their staked amount, add or remove tokens, and modify various staking settings as needed.

![Figure 10, 11](https://raw.githubusercontent.com/PolkaGate/snap/refs/heads/main/docs/images/fig1011.png)


Finally, here are some screenshots of the review and confirmation page, showcasing the process before finalizing actions.

![Figure 12, 13](https://raw.githubusercontent.com/PolkaGate/snap/refs/heads/main/docs/images/fig1213.png)


There are also additional pages, including those for selecting and changing validators, viewing their status (active, waiting, or elected), checking and paying out pending rewards, monitoring unstaking token status, and viewing the list of staking pools along with their details. Additionally, there’s a voting page that lists supported dApps, and a settings page where users can export their account data along with other settings and information.

Our project primarily leverages unique coding techniques tailored specifically for MetaMask Snaps, including TypeScript, specialized components, coding styles, UI updates, and data management. These elements are designed to handle data exchange and interface interaction within the constraints and limitations specific to MetaMask Snaps.

### Ecosystem Fit

Where and how does your project fit into the ecosystem?

PolkaGate Snap is designed to seamlessly integrate with the Polkadot and Kusama ecosystems, enhancing interaction between MetaMask and Substrate-based chains. It goes beyond offering just a Signer Snap—it delivers a complete non-custodial wallet experience within the world-renowned MetaMask extension, joining the ranks of other leading crypto ecosystems that have their own dedicated Snaps.

Who is your target audience (parachain/dapp/wallet/UI developers, designers, your own user base, some dapp's userbase, yourself)?

Our target audience includes dApp developers, everyday users of the Polkadot and Kusama ecosystems, MetaMask users, as well as new users who are familiar with Ethereum but new to Polkadot. The Snap offers a seamless experience for both developers looking to integrate Polkadot and Kusama with MetaMask, and users who want an easy-to-use non-custodial wallet for staking, transfers, governance and etc.

What need(s) does your project meet?

PolkaGate Snap overcomes the challenge of integrating Substrate-based chains (like Polkadot and Kusama) with the Ethereum-based MetaMask wallet. While there are multiple extensions for Polkadot ecosystems, users often face the difficulty of managing separate wallets for different blockchains, leading to fragmented experiences and complex interfaces. PolkaGate Snap simplifies this by seamlessly bringing Polkadot and Kusama support directly into MetaMask, allowing users to easily manage staking, transfers, and other activities all within one unified interface, eliminating the need to switch between multiple wallets or extensions.

Are there any other projects similar to yours in the Substrate / Polkadot / Kusama ecosystem?

Previously, ChainSafe developed a Polkadot Snap; however, this Snap has been delisted from the MetaMask Snap directory, leaving the PolkaGate Snap as the sole listed solution for integrating the Polkadot and Kusama ecosystems into MetaMask.

The PolkaGate Snap stands out by offering seamless functionality as both a signer and a fully non-custodial wallet. It ensures a smooth and user-friendly experience for both developers and end-users. This unique approach positions PolkaGate Snap as a key tool for onboarding users to the Polkadot ecosystem through MetaMask.

## Team :busts_in_silhouette:

### Team members

- [G. Kami Ekbatanifard](https://www.linkedin.com/in/ekbatanifard)
- [Morteza Chalaki](https://www.linkedin.com/in/mchalaki)
- [Mehran Pourvahab](https://www.linkedin.com/in/mehran-pourvahab)
- [Martin Azarbad](https://www.linkedin.com/in/mehranazarbad)
- [Amir Ekbatani](https://www.linkedin.com/in/amir-ekbatani-4b7399201)

### Contact

- **Contact Name:** G. Kami Ekbatanifard
- **Contact Email:** [email protected]
- **Website:** [polkagate.xyz](https://polkagate.xyz/)

### Team's experience

We are a dedicated team of Polkadot ecosystem enthusiasts with a strong track record of contributing to the blockchain space. Our mission is to make common Polkadot functionalities more accessible to end users. As the creators of the Polkagate extension, and MetaMask Snap, we have already demonstrated our commitment to enhancing the Polkadot experience.

Our team members bring diverse expertise:

Kami: Holds a Ph.D. in software systems and works as a blockchain engineer and full-stack developer. Kami's experience includes developing applications for both private and public sources, such as centralized and decentralized crypto exchanges, NFT markets on Ethereum, and more. Kami also has a notable research track record, which you can explore [here](https://scholar.google.com/citations?user=pJ0HwqEAAAAJ&hl=en).

Morteza: Our CFO, Morteza, has an impressive background in financial systems, ensuring strong financial management for our projects.

Mehran: As a dedicated blockchain researcher, Mehran contributes to in-depth research within the Polkadot ecosystem.

Martin: Martin, a senior UX designer, who is working on enhancing the user experience of our softwares.

Amir: Amir, our meticulous test engineer, is responsible for implementing various tests to guarantee the smooth performance of our developments.

With the successful development of the Polkagate products, we have already established our commitment to the Polkadot ecosystem. Together, we are determined to continue making Polkadot more user-friendly and accessible, building on our collective expertise and passion.

Previous Web3 Foundation Grants:

- Polkadot js plus Extension - [Details](./Plus.md)
- Polkadot js plus / Social Recovery Wallet (Follow-up Grant) - [Details](./Plus-social-recovery-wallet.md)
- Polkadot js plus / Nomination Pools (Follow-up Grant) - [Details](./Plus-follow-up.md)
- PolkaMask - [Details](./polkamask.md)

Note: Polkadot js plus has been re-branded as the Polkagate extension.

### Team Code Repos

- https://github.com/PolkaGate/snap
- https://github.com/PolkaGate/polkagate-extension
- https://github.com/PolkaGate/polkadot-Js-Plus-extension
- https://github.com/Nick-1979/Eligibility
- https://github.com/Nick-1979/fastUnstakeTest
- https://github.com/Nick-1979/stuckTokens

Please also provide the GitHub accounts of all team members. If they contain no activity, references to projects hosted elsewhere or live are also fine.

- https://github.com/Nick-1979
- https://github.com/AMIRKHANEF
- https://github.com/mehran-pourvahab

### Team LinkedIn Profiles (if available)

- https://www.linkedin.com/in/ekbatanifard
- https://www.linkedin.com/in/mchalaki
- https://www.linkedin.com/in/mehran-pourvahab
- https://www.linkedin.com/in/mehranazarbad
- https://www.linkedin.com/in/amir-ekbatani-4b7399201


## Development Status :open_book:

The Snap’s code is hosted on the following GitHub repository, along with its related packages, which are published at the URLs listed below:

- [GitHub Repository](https://github.com/PolkaGate/snap)
- NPM Packages:
- @polkagate/snap: [NPM Link](https://www.npmjs.com/package/@polkagate/snap)
- @polkagate/extension-dapp: [NPM Link](https://www.npmjs.com/package/@polkagate/extension-dapp)


## Development Roadmap :nut_and_bolt:

### Overview

- **Total Estimated Duration:** 15 weeks
- **Full-Time Equivalent (FTE):** 2
- **Total Costs:** 30,000 USD
- **DOT:** 50%

### Milestone 1 - Enhancing PolkaGate Snap – Advanced Features and Usability Upgrades

- **Estimated Duration:** 15 weeks
- **FTE:** 2
- **Costs:** 30,000 USD


| Number | Deliverable | Specification |
| -----: | ----------- | ------------- |
| **0a.** | License | Apache 2.0 / GPLv3 / MIT / Unlicense |
| **0b.** | Documentation | Our documentation will include both inline code explanations and a comprehensive tutorial to guide users on how to work with the Polkagate Snap. This tutorial will effectively showcase the functionality of PolkaGate Snap.|
| **0c.** | Testing and Testing Guide | Core functions will be fully covered by comprehensive unit tests to ensure functionality and robustness. In the guide, we will describe how to run these tests. |
| **0d.** | Docker | We will provide a Dockerfile(s) that can be used to test all the functionality delivered with this milestone. |
| 0e. | Article | We will publish an **article** that explains what was done/achieved as part of the grant. |
| 1. | New home | A new homepage that displays all tokens and allows users to enable or disable networks, providing easy access and control over their preferences. |
| 2. | Transfer fund | Allow users to transfer tokens across Polkadot chains directly within MetaMask. |
| 3. | Export account | The Snap account can be exported as a JSON file for secure backup. |
| 4. | Sign offline | Importing metadata, signing messages offline with the data, and delivering the signed message and signature to dApps. |
| 5. | Solo Staking | Users can stake tokens by nominating validators and manage their staking directly within MetaMask, offering a seamless and convenient experience. |
| 6. | Pool Staking | Users can opt into staking pools, manage their staked funds, and claim rewards, all within MetaMask, providing a complete staking solution. |


## Future Plans

Since smart contracts are currently hosted on Westend asset hubs by Parity developers, we are exploring opportunities for how the PolkaGate Snap can contribute to this. While this concept is still new and in progress on the testnet, PolkaGate has already conducted some initial tests, as shown in the screenshot below. As smart contracts on asset hubs continue to evolve, we are eager to explore further opportunities and expand the capabilities moving forward.

![Image](https://raw.githubusercontent.com/PolkaGate/snap/refs/heads/main/docs/images/remix.png)

*Figure 14: PolkaGate Snap Insights on Smart Contract Interactions*


## References

[1]: Due to MetaMask’s guidelines, snaps should not include ‘Meta’ or ‘Mask’ in their names. Therefore, we have adopted the name ‘PolkaGate Snap’ instead of ‘PolkaMask’.
Loading