0. Intro
SN is offering you many ways to be a sovereign bitcoiner and remove your stash from its custodial node. Some options are free, actually FOSS! Just cost you some time to set it up and the energy/connection to keep it running. Consider taking action! My previous post to Easily attach Coinos.io wallet to SEND & RECEIVE sats from SN and HODL
was much easier and faster to set up. This one for
phoenixd
will require you some tech skills and hands on terminal. Are you ready?The goal of this guide is to help you set up
phoenixd
as your SN attached wallet for both, sending to and receiving froom sats. In this way, we can help SN reach the 100% non-custodial status that is aiming to achieve, and for us stackers, to be more responsible with our sats and zaps. On top of that, how cool is to see this little p2p
tag on the notification page!One of the premises for deciding to attach this wallet, is that you need a machine that will ideally stay up and running 24/7. You can also do it for just for fun and to learn something new.
I'll start from zero, assuming you never heard of
phoenixd
, nor even opened a terminal window. It will be a bit geeky, but not that hard as you may think. These below are the three goals we'll achieve:In case you don't want to go through all this trouble and technicalities, you can check @t0m's Nodana - Phoenixd As A Service, or install it on your Start9 node and head straight to the point...
1. Installing phoenixd
You can find more information about
phoenixd
from the official website //phoenix.acinq.co/server
Download and unzip the latest of
phoenixd
source code available in the github repository and save it in your computer. It should be available from https://github.com/ACINQ/phoenixd/releasesYou will need
gpg
for signing, you can get the key from the links provided in the release page above. Once downloaded (remove the .txt extension if required) save it in the same phoenixd
unzipped folder. cd
into the same folder via terminal and run:gpg --import padioupm.asc
to verify the key you'll also need
sha256sum
installed in your environment. You can open another terminal window and check if theere with gpg --version
and if not there, install it. Then proceed with:sha256sum -c SHA256SUMS.stripped
Open your terminal and verify the gpg signature. Once done, you are now ready to run the daemon with:
$ ./phoenixd
The terminal will provide some initial explanation on how the backup and continuous liquidity work:
Backup This software is self-custodial, you have full control and responsibility over your funds. Your 12-words seed is located in /Users/xxx/.phoenix, make sure to do a backup or you risk losing your funds. Do not share the same seed with other phoenix instances (mobile or server), it will cause issues and channel force closes. Please confirm by typing [I understand]:
Continuous liquidity Liquidity management is fully automated. When receiving a Lightning payment that doesn't fit in your existing channel: - If the payment amount is large enough to cover mining fees and service fees for automated liquidity, then your channel will be created or enlarged right away. - If the payment is too small, then the full amount is added to your fee credit, and will be used later to pay for future fees. The fee credit is non-refundable. Please confirm by typing [I understand]:
You'll be asked to type
I understand
multiple times. Type it and press enter
If there are no error, you should be seeing phoeninxd
running:Phoenix server is about to start, use phoenix-cli or the http api to interact with the daemon. This message will not be displayed next time. Press any key to continue... datadir: /Users/sintetiko/.phoenix chain: Mainnet autoLiquidity: 2000000 sat nodeid: 0318aa189af0ba0c616647954bea00c0bb6b2c4a8af2891174c21caa72ed6a24c7 offer: lno1zrxq8pjw7qjlm68mtp7e3yvxee4y5xrgjhhyf2fxhlphpckrvevh50u0q250urkyzyzcw3637xeul30j74g94f5jkntx6cewmen62dqmlukzuqszpaj7spt5w0l0a6gdrpdrxg4kmqrqc0hs5xt944ac575v2yy0q93qqvaynn3268guwvegwwnznw4ccnpxs0w4fld2ae43m90xj2zvwx67w5rqfmnkay6rsww0m8yf0mpzzxwxjs0hqgp56fpaq7xgn7xphsn6f20sr2c0lguzwmxug9rzphselw9h5hdukqqsaqqnl0elfqrt4vvd5m02ge9hjq connecting to lightning peer... connected to lightning peer listening on http://127.0.0.1:9740
Perfect! Now open a new terminal window and type to double check:
./phoenix-cli getinfo
the output will be something like:
{ "nodeId": "0318aa189af0ba0c616647954bea00c0bb6b2c4a8af2891174c21caa72ed6a24c7", "channels": [ ], "chain": "mainnet", "blockHeight": 862274, "version": "0.3.4-1a872b4" }
Look's like everything is running! You can play around with the deamons if you like and try to generate a Lightning invoice:
./phoenix-cli createinvoice \ --description "my first invoice" \ --amountSat 12345
Can you see it? Nice! Now we need to...
2. Make phoenixd publicly accessible
If we refer to the output above, we could see
phoenixd
is listening to an internal IP 127.0.0.1
at the post :9740
. This obviously will not work as it's not accessible from the internet.There's no need these days to be a network engineer to have locally running applications publicly available. Luckily, technology evolved exponentially, and today we have multiple ways and many tools available to fix this issue, DYOR! For this guide,
ngrok
is probably the go-to solution: technically isnβt free, more like freemium, but the free tier costs zero dollars and is sufficient for most development purposes, like this.First thing first, install it on your machine:
brew install ngrok/ngrok/ngrok
Run the following command to add your authorization token to the default ngrok.yml configuration file.
ngrok config add-authtoken 3mPlIq6APs8jVPPdXEgj6Oubln4_5kxeqidDwwy437T3o4GMQ
Now let's put
phoenixd
online at an ephemeral domain, forwarding to your upstream service:ngrok http http://127.0.0.1:9740
Once running, your endpoints will be listed on the
ngrok
endpoints page.If you are planning to keep
phoenixd
running 24/7 it's worth to protect it by securing ingress, defining some parameters that are easy and free to use. Some options to have it done are OAuth, webhook verification and OpenID connect.What's important now is that we finally got our url to access
phoenixd
publicly and securely!https://44f4-146-70-194-38.ngrok-free.app/
Can you see it? Nice... Let start now setting up the connection with SN.
3. Attach phoenixd to SN
From your SN user menu in the top right of your desktop screen, let's go to
SN > wallet > attach wallet > phoenixd
or just click on this link https://stacker.news/settings/wallets/phoenixd
The first url input is the IP or domain your
phoenixd
is accessible from. That one that we just set in the previous section:Go back to a new terminal window and type1:
sudo nano .phoenix/phoenix.conf
ππ¨ππ: πβπ πππππππ‘.ππππ ππππ π βππ’ππ ππ πππππ π ππππ ππππ π¦ππ’π ππππ π’π ππ ππππππ, π¦ππ’ πππ ππππ ππ‘ π€ππ‘β π¦ππ’π πππππππππ π‘ππ₯π‘ ππππ‘ππ.
In this file, you'll find:
- the primary password for sending as
http-password
, together with - the secondary password for receiving as
http-password-limited-access
.
Now, finally, copy and paste this values in the respective input fields.
We are nearly there... set:
- desired balance =
0
, - max fee to a min of
1%
and... - . ... click on the yellow [ attach ] button.
4.0 That's it!
You just did your first step into bitcoin sovereignty!
In case you are serious with your
phoenixd
node and want to keep it and use it, there's a supercool Ui you can self-host or set up from pwallet.app. Or as the master @Darthcoin teach us, If I want to use phoenixd node, run it as a backend to LNbits or Alby HUb.
I have waaaaay more options to manage and use it... And with that you can get NWC and multiple accounts too, with the same server.2Footnotes
-
You can find more info and documentation on https://phoenix.acinq.co/server/api#security β©
ngrok
on a private SN instance?