interlock-network / threatslayer

A Chrome browser extension that protects you from malicious sites.
GNU General Public License v3.0
12 stars 3 forks source link

Show amount of token earned #1

Open DecentralizedDan opened 2 years ago

DecentralizedDan commented 2 years ago

UI should show how much token the user has earned

TASKS:

GanttStart: 2023-09-01 GanttDue: 2023-11-30

jmercouris commented 2 years ago

Agreed!

blairmunroakusa commented 2 years ago

(I believe) User wallet balance should also display. Also, rewards generated should be posted/displayed every time they are 'claimed'. Further, rewards should be batched (perhaps displaying rewards total and rewards earned during a day). Batching (daily?) must be employed to lower costs of Interlock processing rewards transactions on-chain !OR! we will need to make the extension into a wallet, which may be way too costly dev-wise to implement (which would allow users to sign their own rewards collection transactions, paying tx fee in AZERO). Further, it may actually be impossible to (securely) process rewards transaction from the extension client...it may need to be an Interlock relay transaction, but this latter bit is probably more appropriate for a different issue. At the least, we need to have a discussion, in tandem with issue 6.

@DecentralizedDan @jmercouris

DecentralizedDan commented 2 years ago

@blairmunroakusa

User wallet balance should also display

Why? For the MVP at least I envision simply showing how much token they've ever earned historically, not their realtime balance of tokens.

jmercouris commented 2 years ago

For the MVP we can simply show an estimate of how much they've earned by doing some calculations based on the actions they've submitted. There is no need to integrate with the wallet and show the real amounts ,or the historical amounts. This way we do not actually incur any transaction costs. We could have a button that they can click that will send an intent to open up the wallet app on their system to show their real balance.

DecentralizedDan commented 2 years ago

@jmercouris

an estimate of how much they've earned

Is this an estimate of how much they've earned in these two weeks? By "historical" I meant how much they've ever earned all put together (running total). Is that different than what you mean?

jmercouris commented 2 years ago

It's not different with regards to information displayed. I am suggesting that we make no connection to the actual wallet whatsoever. We simply show estimates from the user data client side. So, we can show whatever data we like, whether it is historical, past two weeks etc, but calculate it all client side.

DecentralizedDan commented 2 years ago

Maybe for the MVP what you're describing would be enough. I'm inclined to not trust client-side data for this in particular bc the extension could uninstalled and reinstalled, making the user think they've lost all their data, etc.

blairmunroakusa commented 2 years ago

FWIW this is different than their wallet contents, bc I only ever want to show them how much they've earned total, not their current balance after selling etc Yeah, MVP rewards contract will have a public state mapping for total rewards awarded to a given address. This way people can verify that they were actually rewarded what they were told.

It's not different with regards to information displayed. I am suggesting that we make no connection to the actual wallet whatsoever. We simply show estimates from the user data client side. We only need to connect a wallet if we are forcing users to pay fee for rewarding on smart contract. Since we probably wont be doing this, we will only need knowledge of the account the user wishes their rewards transferred to. In any case, user will need to input this address into the extension directly, and this will be the identifier we use to get reward info for user on clientside.

Why? For the MVP at least I envision simply showing how much token they've ever earned historically, not their realtime balance of tokens. Good catch, this is what I meant (a historic total).

So, likewise clientside, displaying information from the blockchain can all be done from client. Getting any information from the blockchain is free. Thus, UI displays can be updated as needed, to display real time information about historic rewards or wallet balances without needing to integrate any wallets into extension.

jmercouris commented 2 years ago

That's good to know, thanks for the info Blair!