phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

Support for non-standard lightning addresses

Open dpad85 opened this issue 3 years ago • 2 comments

Both the Android and iOS apps fail to read non-"standard" lightning address, for example addresses with Chinese domain names, such as:

...@比特幣.組織.香港

dpad85 avatar Apr 15 '22 16:04 dpad85

Dev notes:

This gets translated into a URL: https://比特幣.組織.香港/.well-known/lnurlp/username

If you paste ^this^ into a browser, it will work, and properly download the JSON. (Obviously need to replace "username" with a valid username in their system.) But it won't work in something like curl. Nor will it work in Kotlin.

This is because the domain needs to be converted to punycode: https://xn--zvt121a27e.xn--uc0atv.xn--j6w193g/.well-known/lnurlp/username

(Modern browsers perform the punycode conversion automatically in the background.)

robbiehanson avatar Apr 27 '22 16:04 robbiehanson

Dev notes:

  • Potential library for iOS: PunycodeSwift
  • I believe Android already has support: IDN
  • If we want to do this automatically within the shared Kotlin layer, then we'll need an expect/actual setup for performing the Punycode. And we'll need to add a built-in Xcode project, similar to the PhoenixCrypto setup we have for lightning-kmp.

robbiehanson avatar Oct 25 '22 08:10 robbiehanson