-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add ENS and UD resolver #779
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a single minor change requested.
Good work using the UD resolution library 👍
if (bcData == null) { | ||
// check for OpenAlias | ||
bcData = parseOpenAlias(qrCode, false); | ||
} | ||
return bcData; | ||
} | ||
|
||
static public BarcodeData parseUD(String udString) { | ||
Timber.d("parseUD=%s", udString); | ||
if (udString == null || !Patterns.DOMAIN_NAME.matcher(udString).matches()) return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default DOMAIN_NAME
pattern probably won't match some crypto TLDs.
I can't double-check now, but looking at https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/util/Patterns.java#309 it looks like it won't match 888
and x
domains.
Since you are already handling any errors that may be returned from the library. What do you think about removing this check altogether?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point, I'll remove the domain check
}); | ||
udThread.start(); | ||
try { | ||
udThread.join(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why start a thread and then block the UI thread waiting for it to finish anyway?
how much data is leaked resolving UD (or even openalias, as UD is done first just-in-case) and to whom? |
From what I can see, the library uses 3 different resolvers for different domains. ENS domains will go through Cloudflare's Ethereum node, UNS domains will go through an Infura node, and Zilliqa domains will go through Zilliqa's API. For an invalid domain, the library defaults to UNS domains. As for what data is sent out, I'm not 100% certain. For ZNS, the namehash version of the domain is sent to the API, and for ENS and UNS, it seems like the raw domain string is sent. |
Is this also working if scanning a qr code? Is it possible to have it only have it perform a check if the address contains a period? |
Adds capabilities to resolve ENS and Unstoppable Domains via Unstoppable Domain's Java library. The ENS resolver connects to https://cloudflare-eth.com as the default ENS resolver has rate limits on ENS domain requests.
The app would check for OpenAlias addresses first, before using ENS and Unstoppable Domains addresses. A 1-2 second delay may be expected while waiting for the ENS and UD addresses to be resolved.