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
"map" JSON field."zeronet" fields whose value is a string instead of a JSON object.Describe alternatives you've considered
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.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.
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!