Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.27 KB

File metadata and controls

55 lines (40 loc) · 1.27 KB

ln-auth-python

From scratch implementation of LNURL-auth

Warning

This is a (probably) outdated educational project. Do not use in production!

  • ecc.py --> Eclliptic curve and ECDSA
  • der.py --> Decode DER encoded ECDSA signature
  • bech.py --> Bech32 encode lnurl string
  • app.py --> Flask server

How to test it with a real Lightning Network/Bitcoin wallet

  1. Install Tor and configure Tor
sudo apt install tor
mkdir ~/hidden_service
sudo nano /etc/tor/torrc
  1. Add two lines to your Tor config
HiddenServiceDir /home/your_username/hidden_service/
HiddenServicePort 80 127.0.0.1:5000
  1. Restart Tor
sudo service tor restart
  1. Clone this repository and install the dependencies
git clone https://github.com/ko-redtruck/ln-auth-python.git
cd /ln-auth-python
sudo pip3 install flask pyqrcode
  1. Run Tor and get your hostname
tor

Go to your /hidde_service dir, open the file hostname and copy the onion address and replace the the address in app.py, line 21 with your own.

  1. Run Flask
flask run

Open http://127.0.0.1:5000/auth in your web browser or your onion_address/auth in Tor and scan the QR-Code with a wallet that supports ln-auth.