Zeronet: ZeroName updater should use "map" field for subdomains

Created on 4 Jan 2019  路  5Comments  路  Source: HelloZeroNet/ZeroNet

Is your feature request related to a problem? Please describe.

In Namecoin's domain names specification, the JSON "map" field is used to designate subdomains. Unfortunately, ZeroNet is using a nonstandard subdomain designation via setting the "zeronet" field to a JSON object. This mismatch makes it substantially more difficult for Namecoin-related software (such as ncdns) to properly interoperate with ZeroNet (e.g. the draft ncdns feature that interoperates with ZeroNet's transproxy feature).

(Note that I discussed this subject with Tamas at Decentralized Web Summit 2018.)

Describe the solution you'd like

  • The ZeroName updater should walk subdomains via the "map" JSON field.
  • The ZeroName updater should accept "zeronet" fields whose value is a string instead of a JSON object.
  • It's fine with me if the ZeroName updater continues to accept the existing nonstandard notation as a fallback, so that existing sites don't break due to the update.

Describe alternatives you've considered

  • I considered requesting that the ZeroName updater discontinue support for the existing nonstandard notation, but I'm fine with pushing back that discussion for a future date, since it's higher priority for me that the standard notation work properly in ZeroNet, and breaking backwards compatibility would probably entail extra delay and work in making sure that everyone updates.
  • Long-term I'd suggest that ZeroNet consider the possibility of using a JSON field in Namecoin that maps to a DNS record type (e.g. a TXT record), but the discussion about that would probably be more involved than the simple change that I'm requesting here, so I'm fine with pushing back that discussion for a future date.
enhancement

Most helpful comment

@rllola using an empty string as a map key is technically allowed in Namecoin, but has been deprecated for years and I don't see any reason for ZeroNet to support that syntax. The preferred syntax for your example would be:

~
{
"zeronet":"19rXKeKptSdQ9qt7omwN82smehzTuuq6S9",
"map": {
"staging": {"zeronet":"1MzSDy3x8cFrt3P2YkXNN7ogYDFfKX6hnP"}
}
}
~

Also note that it's totally possible for recursive maps to be used, i.e. a subdomain's JSON object can itself include a "map" field.

Besides those details, looks like you're on the right track. Thanks for helping with this!

All 5 comments

As far as I understand the issue today Zeronet register subdomains using this format :

{
    "zeronet": {
        "": "19rXKeKptSdQ9qt7omwN82smehzTuuq6S9", 
        "staging": "1MzSDy3x8cFrt3P2YkXNN7ogYDFfKX6hnP"
    }
}

but the standard way would be :

{
    "map": {
        "": { "zeronet":"19rXKeKptSdQ9qt7omwN82smehzTuuq6S9"}, 
        "staging": {"zeronet":"1MzSDy3x8cFrt3P2YkXNN7ogYDFfKX6hnP"}
    }
}

I guess the processNameOp need to be to accept "map" JSON node with "zeronet" field. (see https://github.com/HelloZeroNet/ZeroNet/blob/master/plugins/Zeroname/updater/zeroname_updater.py#L17)

Also adding some test for the new standard.

@HelloZeroNet If this what there is to do I can do it ?

I think that's it and you only need to modify that plugin as other ones not in use right now. (please also keep the current style format support for backward compatibility)

@rllola using an empty string as a map key is technically allowed in Namecoin, but has been deprecated for years and I don't see any reason for ZeroNet to support that syntax. The preferred syntax for your example would be:

~
{
"zeronet":"19rXKeKptSdQ9qt7omwN82smehzTuuq6S9",
"map": {
"staging": {"zeronet":"1MzSDy3x8cFrt3P2YkXNN7ogYDFfKX6hnP"}
}
}
~

Also note that it's totally possible for recursive maps to be used, i.e. a subdomain's JSON object can itself include a "map" field.

Besides those details, looks like you're on the right track. Thanks for helping with this!

@JeremyRand Just to be sure having both style in Namecoin is not possible ? I am wondering if we can have :

{
    "zeronet":"19rXKeKptSdQ9qt7omwN82smehzTuuq6S9",
    "map": {
        "staging": {"zeronet":"1MzSDy3x8cFrt3P2YkXNN7ogYDFfKX6hnP"}
    },
    "zeronet": {
      "dev": "1MzSDy3x8cFrt3P2YkXNN7ogYDFfKX6hnP"
  }
}

Should I just keep the standard Namecoin value and ignore the second one ?

EDIT: I just notice my mistake. You cannot have twice the same "zeronet" key use and so it will be just overwrite and this case is not possible. Sorry.

This can be closed. It has been merged and tested.

Was this page helpful?
0 / 5 - 0 ratings