Web: gitcoin ENS subdomains

Created on 14 Feb 2018  ·  63Comments  ·  Source: gitcoinco/web

What

Enable anyone to create their own ENS subdomain by asserting that they own a github username.

For example, using this product, I should be able to claim owocki.gitcoin.ETH ( ..ETH)

Bounty

  • Create a prototype of this application

    • Desired use case:



      1. Oauth to github to show that you own a username, then get redirected back to gitcoin


      2. on gitcoin, assert that user has metamask installed and is on the mainnet


      3. user is shown their new ENS subdomain, and clicks 'confirm'


      4. after their tx confirms, they own that ENS domain!


      5. profit!



  • PR it back to this repo.
  • Don't worry about Frontend stuff. we'll clean up the frontend later.
backend in progress waiting on contributor

Most helpful comment

good thinking! i think the approach i'd use is to only allow one subdomain request per user per week.

All 63 comments

__This issue now has a funding of 0.5 ETH (452.24 USD) attached to it.__

  • If you would like to work on this issue you can claim it here.
  • If you've completed this issue and want to claim the bounty you can do so here
  • Questions? Get help on the Gitcoin Slack
  • $10035.02 more Funded OSS Work Available at: https://gitcoin.co/explorer

__Work has been started on the 0.5 ETH (459.25 USD) funding by__:

  1. @scottydelta

__Please work together__ and coordinate delivery of the issue scope. Gitcoin doesn't know enough about everyones skillsets / free time to say who should work on what, but we trust that the community is smart and well-intentioned enough to work together. As a general rule; if you start work first, youll be at the top of the above list ^^, and should have 'dibs' as long as you follow through.

On the above list? Please leave a comment to let the funder (@owocki) and the other parties involved what you're working, with respect to this issue and your plans to resolve it. If you don't leave a comment, the funder may expire your submission at their discretion.

So what I am thinking is, I can add this as a tool under 'Tools in Beta'. On click, redirect to an html page which gets github username if logged in(otherwise redirected to github sign-in) and then use that username to let users create their subdomain ENS address. What will the sub domain form look like?

Also here at the ENS docs, it says this about transferring ownership of sub-domain to someone else:
ens.setSubnodeOwner(namehash('somename.eth'), web3.sha3('foo'), someAccount, {from: eth.accounts[0]});

Where would someAccount,eth.accounts[0] come from? is it Metamask? How will the TLD gitcoin.eth get authenticated in order to create sub-domains?

thanks

@owocki I had started working on this issue on gitcoin but now its like I never started work according to gitcoin, possible bug?

@scottydelta @owocki This is a known bug on our side, we're working through this right now.

@iamonuwa please defer to @scottydelta on this one for now. Apologize for the confusion here.

sorry about the erroneous gitcoinbot issues.. i am triaging as we speak.. expect an update soon

just put in a fix for the gitcoinbot craziness. gonna monitor for the next few hours to make sure we're all good.

@vs77bb noted

@owocki re-tagging you to the comment in case you missed it.

@owocki re-tagging you to the comment in case you missed it.

sorry, ETHDenver destroyed my inbox

So what I am thinking is, I can add this as a tool under 'Tools in Beta'. On click, redirect to an html page which gets github username if logged in(otherwise redirected to github sign-in) and then use that username to let users create their subdomain ENS address.

<3 it. lets do it

What will the sub domain form look like?

how about .getgitcoin.ETH

Also here at the ENS docs, it says this about transferring ownership of sub-domain to someone else:
ens.setSubnodeOwner(namehash('somename.eth'), web3.sha3('foo'), someAccount, {from: eth.accounts[0]});

Where would someAccount,eth.accounts[0] come from? is it Metamask? How will the TLD gitcoin.eth get authenticated in order to create sub-domains?

i... dont know the answer here... this is part of why i bountied it! :) im hopeful theres some open source implementation of an ENS subdomain smart contract that we can repurpose and use for this

@owocki ok let me research about it and update you. thanks

@owocki do you own the domain getgitcoin.eth since it's unavailable for registration. Do you own gitcoin.eth, it would be better to have gitcoin.eth than getgitcoin.eth?

I think I figured it out, I just started auction for a dummy ens domain to play around with. Once I have access to the domain, I think it shouldn't take time.

i own getgitcoin.eth but not gitcoin.eth -- i know the owner of gitcoin.eth if we really really feel its important

@owocki It's not really required but would have been nice to use gitcoin.eth as the ENS tld. Is it fine to reuse the frontend form at /tip/send/2/?

It's not really required but would have been nice to use gitcoin.eth as the ENS tld.

i'm working on it

Is it fine to reuse the frontend form at /tip/send/2/?

yes!

howdy @scottydelta I know you're working on this... any update as of now? Hope you're doing well 🙂

@vs77bb hey, I have been adding comments at the PR #509. To give you an update, I am trying to setup a local eth node since I cannot execute write functions on remote node(like infura). Also, since web3.ens doesn't support ENS registry hosted on testnet(didn't realize this until I registered a domain on testnet and setup a local testnet node), I cannot test in on testnet.

👋 I have gitcoin.eth

Happy to transfer it over. Glad to see this project being built!

@flysonic10 dziękuję my Polish brother 🇵🇱🇵🇱🇵🇱👍🏻👍🏻👍🏻

yay.... thanks for the domain @flysonic10 !

@scottydelta how goes the local geth node?

cc @mbeacom -- weve talked a little bit about setting up a local geth node at gitcoin

this seems like it might be useful.. theres a whole section on setting up subdomains https://www.reddit.com/r/ethereum/comments/6clvs6/a_quick_guide_on_getting_an_ens_name_and_setting/

@owocki I have made some progress on this, will update commits after running tests and cleaning it up. To be able to set up sub domain for users, it will require a local node AFAIK

Added the forms for registration and deletion along with verification using Metamask signature and github handle validation. I will work in next few days to see how we can handle un-mined transactions for ENS contract interaction.

@owocki We should also limit them on how many times they can register/update an address(probably allow one registration and one address change per github account) to a subdomain since it will cost gas to interact with the contract.

We should also limit them on how many times they can register/update an address(probably allow one registration and one address change per github account) to a subdomain since it will cost gas to interact with the contract.

does this mean that you expect gitcoin to pay the gas for the tx? the standard way of doing this in the dapp thus far has been to expose the tx signing to the user in metamask, so that they have to sign it with their own private key (and thus pay their own gas). therefore, this concern is completely delegated to the end user

does this mean that you expect gitcoin to pay the gas for the tx? the standard way of doing this in the dapp thus far has been to expose the tx signing to the user in metamask, so that they have to sign it with their own private key (and thus pay their own gas). therefore, this concern is completely delegated to the end user

ok makes sense, I didn't realize that we could just get the signed transaction from the user, I had assumed we were using metamask to validate the wallet and github handle ownership. I will make necessary changes. thanks, appreciate the guidance 👍

@owocki I remember now why I assumed gitcoin would pay the txn fee. Please refer to this conversation on ethereum/web3.py, since the transaction needs to be signed by the domain owner, it would be tricky to make the user pay for the gas for registering sub-domains.

ah okay.. this makes sense to me that gitcoin would pay the gas then.. i think we'll just need to make sure we don't get sybil attacked (i.e. someone doesnt go around creating 100s of domains just so we have to pay for the gas)

@owocki One way is to budget/limit the ether for sub-domain registration every week. Once this ether runs out, users need to wait for the subsequent week and then try again. It can be on first come first basis and github profiles with zero activity can be barred from using this feature(a msg can be shown to contact admins via github issues/slack channel if they really want a sub-domain).

good thinking! i think the approach i'd use is to only allow one subdomain request per user per week.

was telling someone about this feature over the weekend.. we are really exciited for it!

@owocki I am working on it, will try to give a demo soon.

I'm just going to chime in here. You should be able to do this without requiring that gitcoin pays the gas. You will need to implement a custom resolver and set that as the resolver for gitcoin.eth. Gitcoin owns the resolver, but the subdomains are "owned" by someone who has legit github oauth token for the given subdomain name. The source of truth in who owns the domain is a valid oauth token from github for the given domain, but also store a secondary owner which is the ether address from the payer. Again, I see NO reason that gitcoin should have to pay any gas fees to manage the subdomains and I'd be happy to continue this conversation and I am open being incorrect here, but I feel that it's possible and less complicated then @scottydelta is getting into.

@ghthor your help is definitely welcome and if we can get away without Gitcoin having to pay for the gas then that's what should be done, do you think we can discuss this further on the slack channel?

Yes, that's fine. I've sent you a message on gitcoin slack.

On Sun, Mar 25, 2018, 02:07 scottydelta notifications@github.com wrote:

@ghthor https://github.com/ghthor your help is definitely welcome and
if we can get away without Gitcoin having to pay for the gas then that's
what should be done, do you think we discuss this further on slack channel?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/gitcoinco/web/issues/450#issuecomment-375947971, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAJyKvsVzfjCrFMLBbw8nyUyHzNgobh3ks5thzQvgaJpZM4SGGPO
.

@ghthor and I have decided to work on this together to make it such that user pays for the gas by using a custom resolver and we plan on sharing the bounty.

thanks for the update. very exciting to see this coming along

@scottydelta @ghthor Would one of you mind re-claiming the bounty? Somehow ended up in an 'open' status, probably due to 1 week inactivity somewhere down the line.

https://gitcoin.co/issue/gitcoinco/web/450

@scottydelta are you still working on this? if not, let us know so we can ask for help from someone else

can i work on this @owocki? I love work an app that integrate with ENS :heart_eyes:

@owocki This feature was completed in my last PR(testing required) but it requires Gitcoin to pay for the gas. @ghthor suggested that he could help with deploying a custom resolver which would allow users to pay gas for the subdomains but he has been unable to make any progress so far.

@zoek1 if you think you can help me with the custom resolver part then I would be more than happy to work on the rest of the integration but if you want to do it own your own then you have that option too.

Thanks

@scottydelta are you talking about this PR? https://github.com/gitcoinco/web/pull/509 mind removing 'WIP' from the title? also, the checklist on the bounty desc is not complete.. is subdomain registration and deletion coming in a 2nd PR?

@owocki Sorry, I forgot to link the PR, #509 is the one. subdomain registration and deletion is not marked complete and still shows WIP because it is not tested properly and my implementation will require the ENS domain owner to bear the cost of gas which will be Gitcoin in this case.

If you want to go ahead with this implementation then I could use some help in testing. The tester needs to have a local synced node and I can provide access to a wallet which already owns an ENS domain.

subdomain registration and deletion is not marked complete and still shows WIP because it is not tested properly and my implementation will require the ENS domain owner to bear the cost of gas which will be Gitcoin in this case.

i dont mind having gitcoin pay the gas. but i would like to get this fully tested

The tester needs to have a local synced node and I can provide access to a wallet which already owns an ENS domain.

yes pls! can you send me the wallet details on gitcoin.co/slack or via email ([email protected])?

is there any way we can make it work with infura? does it have to be a local synced node?

i dont mind having gitcoin pay the gas. but i would like to get this fully tested

@owocki If that's the case, each Github user will be limited to one transaction per lifetime. Once the subdomain is transferred to the user's Metamask wallet address, the user can change the new ENS subdomain resolution wallet address as well as the ownership(any wallet address) as long as the top-level ENS domain owner doesn't revoke the access by changing ownership of that subdomain.

is there any way we can make it work with infura? does it have to be a local synced node?

AFAIK, this requires a local synced node. I will confirm this with @carver on the Web3.py Gitter channel and update you here.

Edit: I think local node is not required. I needed one because I was working with a private key and I couldn't use it with a remote node.

@scottydelta are you still working on this issue?

@scottydelta are you still working on this issue?

  • [x] warning 1 (3 days)
  • [x] warning 2 (6 days)
  • [ ] auto removal (10 days)

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@scottydelta has been removed for inactivity and the issue has been returned to an ‘Open’ Status. Let us know if you believe this has been done in error!

  • [x] warning (3 days)
  • [x] auto removal (6 days)

@scottydelta I'll just chime in here because the last time you posted your question on the web3.py channel if its possible to use ens without using a local node, I felt like I gave you an incomplete answer.

I think local node is not required. I needed one because I was working with a private key and I couldn't use it with a remote node.

Yes its possible to use ENS without using a local node. However, you'll need to plug this middleware to sign transactions that need the domain owners key. It's still WIP, but you can plug it yourself. Also worth looking at how raiden has solved it

this is very exciting news ^^

@scottydelta we have a local geth node synced, and the above route just presented itself.. if you want to take another stab here :) happy to increase the tip amount to make it worth your while

@voith thanks for giving more info on this. You had actually pointed me towards this pull request but it was still in dev at that point and I never got around to updating that info here.

@owocki yes sure, I will look at it over the weekend. If we just test it on a local node, the code is ready but to use a remote node, I will have to look into the resources which @voith pointed towards. thanks

@scottydelta great! @mbeacom has a sync'd local node he can hook you up with too if that helps

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


__Work has been started__.

  1. @scottydelta

    has committed to working on this project to be completed 1 week, 6 days ago.

@owocki, __please see the below comments / questions regarding approach for this ticket from the bounty hunter(s):__

@amitkumar991 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] warning (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@amitkumar991 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] warning (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

snoozing the gitcoin bot warnings now

@amitkumar991 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] warning (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@owocki how long did you snooze for 🤔 just snoozed for 100 days so we shouldn't hear from GC Bot for a bit

@scottydelta can you submit work here so we can pay you out?

⚡️ A tip worth 0.5 ETH (327.63 USD @ $655.25/ETH) has been granted to @scottydelta for this issue from Kevin. ⚡️

The sender had the following public comments:

thx! this is awesome!

Nice work @scottydelta! To redeem your tip, login to Gitcoin at https://gitcoin.co/explorer and select 'Claim Tip' from dropdown menu in the top right, or check your email for a link to the tip redemption page.

Issue Status: 1. Open 2. Expired


__The funding of 0.5 ETH (327.63 USD @ $655.25/ETH) attached to this issue has been cancelled by the bounty submitter__

Was this page helpful?
0 / 5 - 0 ratings

Related issues

christianbundy picture christianbundy  ·  3Comments

NukeManDan picture NukeManDan  ·  3Comments

frankchen07 picture frankchen07  ·  4Comments

IgorPerikov picture IgorPerikov  ·  3Comments

mbeacom picture mbeacom  ·  4Comments