Lightning addresses are pretty awesome, they're the things that look like email addresses. You can learn more about them here or at the github. Here's a diagram of how it works: https://imgprxy.stacker.news/HL_ufBExLodf_jgU73w7gQY09B9klHoptLROh8MkvjE/rs:fit:600:500:0/g:no/aHR0cHM6Ly9jYW1vLmdpdGh1YnVzZXJjb250ZW50LmNvbS8yNjhhYmM2MjE1ODViNjhmYmYxMjI5ZWFiNTFjM2M5MzQ0ODcwZWMzZjIyN2ExZmYyMzdjNzQyM2JhM2JhMjhlLzY4NzQ3NDcwNzMzYTJmMmY2OTJlNjk2ZDY3NzU3MjJlNjM2ZjZkMmY0NDQ5NTYzNTcxMzg3MTJlNzA2ZTY3
My question is about redirection. For example, If I have a lightning address with a hosted provider like myusername@zbd.gg or myusername@coinos.io etc, how do i set up the file at mydomain.com/.well-known/lnurlp/myusername so that when people send to myusername@mydomain.com it will automatically redirect them to the hosted provider, e.g. myusername@zbd.gg? Is that something that can be done? Thank you!
You're going to self host your own server but not self host your own lightning? Why??
Good question, this is for a community project. We want to offer our community their name@ourdomain.com lightning address & NIP-05 verification if they wish to represent @ourdomain. The idea would be that they could provide whatever lightning address they want to redirect it too.
Proxy the request to the destination LN address?
Or try 301/302 redirect. No idea if the spec or clients support redirects.
I've asked this to fiatjaf in the past and the response was that redirect is a cancer and it's not supported by spec. (Paraphrasing ) But some clients might follow the redirection.
Good to know! I figure proxy is the way.
Thank you, that sounds like what I think I'm trying to do. Can you point me in the right direction for where I can learn more about this? Thank you.
Depends on your application server. You might need to nginx proxy, or if it's a little more complex you might need a script to do the lookup.
301/302 redirects are quite standards web server behaviours, but you will have to do a lookup initially to know where to redirect to.
So some application coding might be needed.
Simple: use your own LNbits server with Split and Scrub extensions https://github.com/lnbits/lnbits/wiki/LNbits-Extensions
More about Lightning Address servers here https://darthcoin.substack.com/p/getting-started-lightning-address