hoprnet / hopr-bounty-submission

Bounty Submission Repository
2 stars 5 forks source link

Implement RPCh in Liquality wallet #7

Closed nionis closed 10 months ago

nionis commented 1 year ago

Job Story

Using RPCh's SDK, a wallet may send and receive RPC methods without leaking the user's data. In this bounty, you are challenged to integrate the RPCh SDK (or one of RPCh's adaptors) into Liquality wallet.

Description

Read the RPCh getting started guide and implement RPCh in Liquality wallet. A user should be able to select network named "Gnosis over RPCh" which will route all RPC requests through RPCh's SDK.

Definition of Done

How to Apply

How to submit

What is RPCh?

Find out more about RPCh at the following links:

What is HOPR?

Find out more about HOPR at the following links:

This bounty is part of The Bounty Program

hieple7985 commented 1 year ago

Is that available to work?

nionis commented 1 year ago

hey https://github.com/oguzutku1745, we have been in communication in TG, can you update here so @MartinBenediktBusch can proceed with the payout?

oguzutku1745 commented 1 year ago

Hello @hieple7985! I had a few problems with the injection logic of the Liquality wallet. While other wallets, such as Block Wallet use a provider to utilize them, Liquality directly injects the providers (this also includes the wasm file of rpc-h) into the webpage. I did not want to change the way the Liquality Wallet works because it didn't feel safe. If you have more experience on this topic, I would be more than happy to talk and collaborate about it!

Even though the direct injection is problematic in dApps, there is no problem with the basic implementation (sending, storing & receiving funds anonymously).

Here is the Liquality Wallet with simple rpc-h implementation: Wallet interface Core Functions

nionis commented 1 year ago

@oguzutku1745 IMO injecting RPCh as the provider shouldn't be an issue, it only adds additional privacy to the webpage, could you proceed with updating it so it injects RPCh's provider?

oguzutku1745 commented 1 year ago

The main difference is that the wasm file is not being fetched in the other example integrations because they have built a communication channel between the website and the background script instead of injecting providers directly (blankProvider in blockWallet). This can be seen in the webpack configuration.

The enKrypt example is worth taking a look at. Even though they have built the background and content scripts differently, they still use a communication channel and avoid directly injecting scripts into the website.

When we inject the wasm file, abnormal behaviors such as the inability to fetch prices/tokens start to appear in dApps. That also reflects to swap actions.

The current example already injects the RPCh into the websites. To give it a try: 1- First, clone both of the files I shared above. 2- Change the paths specified in package.json according to the path of wallet-core.

There are also some minor dependency errors depending on the system that can be fixed by manually editing the yarn.lock file.

Also, note that the current version of the vue-cli is not the same as the Liquality wallet's, so I advise you to directly clone from my repo. I updated it to increase the wasm file support.