gitcoinco / web

Grow Open Source
https://gitcoin.co
Other
1.78k stars 772 forks source link

As a user who is contributing to Gitcoin Grants, I want to do so via a L2, so I can avoid high gas costs. #7127

Closed owocki closed 3 years ago

owocki commented 4 years ago

User Story

As a user who is contributing to Gitcoin Grants, I want to do so via a L2, so I can avoid high gas costs.

Why Is this Needed

Summary: Gas costs are too high with bulk checkout, according to vitalik "the tech is ready"

Description

Type: Feature

Current Behavior

Bulk Checkout

Expected Behavior

Definition of Done

See above

Data Requirements

How many ppl opt to checkout via each checkout tech?

Additional Information

owocki commented 4 years ago

loopring chat w @ceresstation and @Brechtpd :

API call docs https://docs.loopring.io/en/

@PixelantDesign we'll probably need to have two checkout payment options on grants checkout (akin to choosing to pay with amazon checkout, paypal, in a normal e-commerce checkout flow)

coolcryptomaniac commented 4 years ago

Yes many L2 tech like Loopring, matic, celr can be tested also any Gitcoin Grants related to gas economics and reduction of gas can be funded.

My idea is very simple --- Transactions must be categorized , A transaction must have some code or marker in it telling which type of transaction is it A) monetary transactions like trading etc, sending payments B) Non monetary transactions , playing games and using non financial dapps For second category a minimum fixed near zero fee can be used and for first category as usual depends on demand and supply. Miners have to accept minimum 50% non monetary transactions , So miners will get two income stream 1- Variable with financial transactions 2- fixed with near zero transactions ( huge number of transaction will slowly accumulate to significant fees) .

danlipert commented 4 years ago

I'm thinking XDAI is probably the lowest lift but im not too familiar with the others, but XDAI is pretty simple. Would we need to support 2 flows here? a) someone has all funds on L1, checkout process automates L1->L2 and then onto destination b) someone already has L2 funds and can skip the first portion.

developerfred commented 4 years ago

I opened this issue #6905 in a while to adopt the L2 looping protocol, my short term solution strategy and insert the gitcoin community into L2 seriously enabled or loopring a TIP wheel from townsquare.

so we will have 80% of gitcoin users signed on the network to do loopring.

When September comes, a curve for the use of L2 will be minimal.

but it is interesting to have other protocols available and tag the buttons to see which one is being used most in Grants

coolcryptomaniac commented 4 years ago

Yes experimenting with all the L2 solution and integrate with it would be good idea and recommending the best one according to user responses or testing , with time only very good L2 options can be shown and rest can be removed. MATIC,LOOPRING,OMISEGO,CELER and there are other L2 solutions to look up for... The important thing to remember is to integrate in such a way that if there comes any problem in L2 solution we can decoupled from it or show legacy option also ( for e.g if some users faces bags , he should get the option to transact via old way as we are doing now )

owocki commented 4 years ago

from @apbendi

The private key for your loop ring account is derived from a signature made with your MetaMask account. So I believe we’d have to prompt them for that signature, but after that, we’d have the private key in memory and be able to use it for as many signatures as we wanted.

@brechtpd do you know if this is true? is there any way we can avoid having to prompt the user for N transaction signatures to send N grant payments on the grants checkout page?

apbendi commented 4 years ago

To clarify, @owocki, I think we'd only need 1 signature, then we'd have the pk. But I'm not 100% on that, so I'd love your input @Brechtpd

Brechtpd commented 4 years ago

The private key for your loop ring account is derived from a signature made with your MetaMask account. So I believe we’d have to prompt them for that signature, but after that, we’d have the private key in memory and be able to use it for as many signatures as we wanted.

That's exactly right @apbendi @owocki, that's how we currently do things on loopring.io as well. Users "log in" by signing the message, and then they can create as many orders they want with us signing those transactions in the background with the generated private key.

In the future with MetaMask plugins we'll be able to do this even without needing this "log in" (and the pk used for signing the transactions never leaves MetaMask), but seems very unlikely MetaMask plugins will be ready for round 7.

owocki commented 4 years ago

then they can create as many orders they want with us signing those transactions in the background with the generated private key.

got it; so only 1 or 2 metamask confirmations per checkout?

thats huge. awesome!

Brechtpd commented 4 years ago

Just 1, assuming the person already has the necessary funds on Loopring of course.

willsputra commented 4 years ago

Thinking about the rough flows from my understanding, assuming owners and donors don't have a Loopring account:

Grant owners

Grant donors

Are these correct? Let me know if I missed anything 🙂

Brechtpd commented 4 years ago

Sound about right!

  • Upon clicking "Pay via Loopring":

    • Sign 1st transaction (275k gwei) to "get a Loopring account"
    • Sign 2nd transaction (100k gwei + grant amount) to "deposit funds to Loopring"
    • Sign 3rd transaction to "send funds to grant owners"
    • Total 3 transactions?

Step 1 and 2 or course only when necessary for the user. For step 2 the user will also have to approve our contract for the amount that's going to be deposited for everything except ETH.

If step 1 and 2 are both necessary then they can also be combined in a single Ethereum tx using updateAccountAndDeposit, with the total cost around the same as just creating a new account separately.

For creating accounts it will also be necessary to let users first the "log in" message, because to create an account the public keys for the account need to be set. So step 3 should be done first in that case.

Upon clicking "Pay via Loopring":

SilentCicero commented 4 years ago

Hey Kevin, is this issue still open, Fuel would like to chat @owocki

owocki commented 4 years ago

Yes pls! @SilentCicero wanna email me to set soemthing up? kevin@gitcoin.co

SilentCicero commented 4 years ago

On it @owocki

walidmujahid commented 4 years ago

Grant owners

  • There will be an option on https://gitcoin.co/grants/new to enable grant donations via Loopring

    • We need to inform them that not all tokens are available on Loopring
  • If they select that option, upon creating a grant, they will be asked to sign a transaction (275k gwei) to "get a Loopring account".

Should there be a temporary button on existing grants to allow those who want to create a loopring account for their grant?

SilentCicero commented 4 years ago

Yep, I’ll email you.

On Tue, Sep 1, 2020 at 9:45 AM Walid Mujahid وليد مجاهد < notifications@github.com> wrote:

Grant owners

-

There will be an option on https://gitcoin.co/grants/new to enable grant donations via Loopring

  - We need to inform them that not all tokens are available on
  Loopring

-

If they select that option, upon creating a grant, they will be asked to sign a transaction (275k gwei) to "get a Loopring account".

Should there be a temporary button on existing grants to allow those who want to create a loopring account for their grant?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gitcoinco/web/issues/7127#issuecomment-684864781, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACK2CXQYULDUT6FCVZGIAATSDT3HNANCNFSM4PDTMDSA .