New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAlias support #213

Merged
merged 18 commits into from Jun 20, 2018

Conversation

Projects
None yet
3 participants
@aguycalled
Member

aguycalled commented May 18, 2018

This PR completes the implementation of the open alias protocol in the NavCoin Core client.

OpenAlias is an standard created by the Monero Core project used in the Monero wallet and some other clients like Bitcoin Electrum which allows to translate email addresses into cryptocurrency addresses using custom TXT entries in the DNS records of a domain.

More details about the specification can be found at www.openalias.org

Part of the code is based in the original Monero implementation. Main differences are:

  • Prefix of the TXT entry is required to be set to oa1:nav
  • The only parsed parameter is recipient_address
  • NavCoin enforces by default the use of DNSSEC
  • Originally Unbound was used to resolve the entry. This created issues when linking the library in some systems, so alternatively support for using Google's DNS over HTTPS service has been implemented. Future implementation of libunbound+dnscrypt is highly recommended to reduce dependence on 3rd parties

Other modifications in the NavCoin client:

  • New RPC command resolveopenalias resolves an OpenAlias address to a NavCoin address
  • Added support for sending to OpenAlias addresses in the GUI, when parsing URIs and the RPC commands validateaddress and sendtoaddress
  • New argument -requirednssec to set whether DNSSEC validation is required to resolve openalias addresses (true by default).
  • Update copyright notice

@aguycalled aguycalled changed the title from V4.2.0 open alias to OpenAlias support May 18, 2018

@red010b37

This comment has been minimized.

Member

red010b37 commented Jun 1, 2018

Don't want to add any more to v 4.2.0-rc, this should be its own minor release

@zanuka

zanuka approved these changes Jun 2, 2018

@aguycalled aguycalled changed the base branch from v4.2.0-rc to master Jun 12, 2018

@@ -54,13 +70,15 @@ namespace
* the unbound library.
*/
#ifdef HAVE_UNBOUND

This comment has been minimized.

@red010b37

red010b37 Jun 18, 2018

Member

what does HAVE_UNBOUND relate to in this context?

This comment has been minimized.

@aguycalled

aguycalled Jun 19, 2018

Member

if the library unbound is present we will use it to resolve the dns entry instead of dns over https

*
* @return a navcoin address (as a string) or an empty string
*/
std::vector<std::string> addresses_from_url(const std::string& url, bool& dnssec_valid)

This comment has been minimized.

@red010b37

red010b37 Jun 18, 2018

Member

Should we have a test for this?

curl_easy_cleanup(curl);
if (httpCode == 200) {
UniValue request;

This comment has been minimized.

@red010b37

red010b37 Jun 18, 2018

Member

There seem to be a lot of ways to get addresses. Is this correct? as we seem to be just calling https://dns.google.com/resolve

What is the common path through here?

This comment has been minimized.

@red010b37

red010b37 Jun 18, 2018

Member

or are we just returning an empty vector on error?

This comment has been minimized.

@aguycalled

aguycalled Jun 19, 2018

Member

exactly, an empty vector is returned when no result is found (whatever the reason for this is)

LogPrintf("DNSSEC not available for checkpoint update at URL: %s, skipping.", url);
}
if (!valid[cur_index])
bool dns_records_match(const std::vector<std::string>& a, const std::vector<std::string>& b)

This comment has been minimized.

@red010b37

red010b37 Jun 18, 2018

Member

and a test for this as double for loops can be a pain

@aguycalled aguycalled merged commit 7b71e8e into master Jun 20, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@aguycalled aguycalled deleted the v4.2.0-open-alias branch Jun 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment