Please indicate when reprinting from the "Biteye" community
Author: Biteye core contributor Crush
Community: @BiteyeCN
*The full text is about 4,500 words, and the estimated reading time is 8 minutes
1. Basic knowledge
(1) What is Lightning Network
As we all know, the block generation speed of BTC is about once every 10 minutes, which is very slow. The Lightning Network (also known as Lightning or LN) is a scalability solution built on top of Bitcoin that allows users to send and receive Bitcoin quickly and with virtually no fees.
If compared with the Ethereum ecosystem, the Lightning Network is equivalent to those L2 networks that have made various improvements around the ETH mainnet.
The basic principle is to carry out user transactions off-chain to ensure speed. All transactions are then aggregated to the Bitcoin mainnet for unified settlement to reduce handling fees.
(2) What is SAT (SAT)
SAT (Satoshi) is the smallest unit of BTC. 1 BTC = 100 million Satoshi. The current price of 1 Satoshi is about 0.00037U.
The English name evolved from the name of Satoshi Nakamoto, the founder of the Bitcoin protocol, with "SAT" in English and "SAT" in Chinese.
The launch of the smallest unit "Satoshi" makes payments on the Bitcoin Lightning Network more convenient.
(3) What is Alby wallet?
Alby is a Lightning Network wallet. Like the Metamask wallet that everyone usually uses, it can also be used to complete transfers, payments, signatures and other operations.
Its biggest highlight is the integration of the Nostr social protocol, a project promoted by the former CEO of Twitter. Anyone can build a social application based on the Nostr protocol.
Alby official website: https://getalby.com/
Alby Official Twitter: https://twitter.com/getAlby
Github homepage: https://github.com/getAlby/lightning-browser-extension
(4) The relationship between Alby and Nostr
Nostr is a censorship-resistant social underlying protocol. Its developer Fiatjaf is also a developer of Bitcoin and Lightning Network, so the Nostr protocol natively supports Lightning Network.
Alby, as a Lightning Network wallet, has built-in Nostr account generation function. When users register an Alby wallet, they can use Alby to generate the Nostr public key. Based on this public key, users can experience some applications of the Nostr protocol.
For example, participate in the development of the recently popular project Nostr Assets, transfer and receive payments in Nostr Assets, etc.
Note: Nostr Assets is an application of the Nostr ecosystem, which introduces Taproot Assets and Satoshis (the smallest unit of Bitcoin) into the Nostr ecosystem. Users can use Nostr's public and private keys to send and receive them at the Nostr protocol layer.
(5) Explanation of different payment addresses
BTC address
The BTC mainnet address is the same as the ETH mainnet address. Common addresses include the following types:
The address starting with “1” is the original BTC address;
Those starting with "3" are upgraded P2SH (Pay-to-Script-Hash) addresses, which support more complex functions than traditional addresses;
The address starting with "3" is the Nested Segwit Address (an expansion upgrade of BTC);
The address starting with "bc1q" is the Native Segwit Address (Native Segwit Address, which further reduces the amount of information stored in the transaction and greatly reduces the cost);
The address starting with "bc1p" is the address after the latest Taproot upgrade. After the Taproot soft fork, more new smart contract functions are enabled for Bitcoin addresses and the privacy of such transactions is improved.
These addresses can usually transfer funds to each other, but just in case, it is best to conduct a small test before transferring money.
Currently, the mainnet BTC address that Alby supports for recharge starts with "bc1q". Alby will use a third-party service to cross the mainnet BTC to the Lightning Network and display it in the form of SATS.
The third-party service here will charge a 1.5% handling fee, and only supports a maximum of 0.05 BTC.
Lightning Network Address
BTC’s second-layer network has fast transfer speed;
Usually, invoices are used to collect payments. The invoice requires the payee to set the payment amount by himself, in the form of a QR code or a string of addresses starting with "lnbc". Since it will expire after timeout, the invoice address is different every time;
With the development and upgrading in recent years, addresses starting with "LNRLxxx" and email addresses like "xxx@getalby.com" have appeared;
The above two addresses belong to a transfer agreement. When the user enters the address to transfer, these addresses will actively generate an invoice, without the need for the payee to actively generate an invoice, to simplify the transfer steps.
Nostr address
The address of the Nostr social protocol starts with "npub". This kind of address can be generated in the Alby wallet, and there is a corresponding seed phrase.
(6) The difference between Alby and Metamask
Metamask users may feel unfamiliar with Alby wallet when they first use it. Here are some differences between the two that I have summarized to help you better understand Alby, a new wallet.
Whether it is the mainnet or other L2, Metamask's wallet address is the same. But Alby’s Lightning Network address is completely different from the BTC mainnet address;
Metamask can directly enter other people's wallet addresses to transfer funds. In most cases, Alby can only use invoices to collect payments, and the payee needs to actively issue invoices. Under special use cases, it can be operated like Metamask, which will be described in detail later;
To transfer funds between Metamask users, domain names such as ENS can be used to shorten wallet addresses, but these domain names usually require money to purchase. Alby can set up an email address by itself, but it can only be used for payment collection and has no other functions;
Metamask's account recovery relies on seed phrase, while Alby relies on a more centralized wallet connection credential. In addition, if you register the Nostr public key through Alby, you need to save Nostr's seed phrase to restore your account in the future;
…
2. Usage tutorial
In this part, I will talk about the use of related functions in detail to help everyone better understand the above text.
(1) Create wallet
1. Download the wallet plug-in
First, open the wallet plug-in download address and install the wallet. It is recommended to use browsers such as Google, Firefox, and Edge. Other browsers may have plug-in incompatibilities.
https://chromewebstore.google.com/detail/alby-bitcoin-lightning-wa/iokeahhehimjnekafflcihljlcjccdbe
2. Register an Alby account
After installation, the account registration interface pops up.
If you have used other wallets, you can directly connect and import your old account.
If this is the first time you use it, usually click "Connect using Alby" on the left.
Alby will read your login status on the official website. If you have already registered and logged in on the official website, click "Log in to connect" here to directly complete the import of the wallet. New users need to register a new Alby account.
Users need to prepare an email address and complete registration through a verification code.
For subsequent logins, click "One-time login code" below to log in through a one-time email verification code.
3. Pin the plug-in and set the unlock password
After registering an account, you will see the following prompt. The picture below is a tutorial for fixing plug-ins to the toolbar for user convenience.
The unlocking password here also needs to be set. It is the same as the password of the Metamask wallet. It is the password that needs to be used to unlock the wallet.
At this point, your wallet has been registered. Let’s take a look at the related functions.
(2) Transfer/receipt
1. Create a payment invoice
The first recharge requires a payment invoice, and the user needs to fill in the payment amount and remarks.
You can fill in the remark information casually or leave it blank, but do not fill in any sensitive or private information because it is public.
After the creation is completed, we will see a QR code and a button that can be clicked to get the invoice link.
Then we open the exchange, buy some BTC, and choose BTC to withdraw.
For example, when we implement it on OKX, users can directly choose to scan the QR code or paste the invoice link, and the exchange will automatically recognize the invoice.
Using the Lightning Network to withdraw cash requires a handling fee of 0.037U, while the Bitcoin mainnet below requires a handling fee of 7.4U. In comparison, the Lightning Network is much cheaper.
2. Introduction to Alby wallet payment methods
Click the payment directly on the wallet page, and three payment methods will pop up.
Lightning invoice - invoice collection method, similar to the fixed amount Alipay payment code, but valid for one time.
Bitcoin address - Receive payment through a Bitcoin address. This transaction is similar to the Ethereum main network, and the handling fee is very high. After receiving the payment, Alby will use Deezy 's Swap service to convert BTC into SAT. The conversion fee is 1.5%, and a minimum transfer of 3,000 SAT equivalent BTC is required.
Redeem - a Bitcoin gift card based on the Lightning Network. It is sold at some gas stations, timeouts, and grocery stores abroad. Usually the denomination is between 10 and 250 US dollars. Users can redeem it by scanning the QR code or entering a Code starting with Lnurl. .
In addition, the email addresses and LNURL addresses mentioned above can receive payments.
However, Alby's email address and LNURL address can only be used to transfer funds between Alby wallets.
Once you use the exchange to recharge the wallet, you can still only use the invoice to solve the problem. The exchange cannot recognize Alby's email or LNURL address.
3. Validity period for invoice collection
There is a validity period for invoice collection, such as 30 minutes or 1 hour. If it expires, it will be invalid.
4. Tip the home page
Alby will directly assign a web homepage to the user, such as https://getalby.com/p/crush . When the user visits this webpage, he or she can decide the amount of the reward and generate the corresponding invoice.
(3) Wallet security
Wallet security requires starting from the following aspects:
register e-mail
connection credentials
Unlock password
Nostr seed phrase
1. Register email
Due to the characteristics of the Lightning Network, when registering for Alby, we use our email address to directly obtain the verification code to complete the login and registration.
This means that if your email is stolen by others, others can also use your email to log in to Alby's wallet and then transfer your assets.
2. Connection credentials
As mentioned above when using the mobile APP, the connection credential is similar to the seed phrase in the Metamask wallet. If this is leaked, others can also log in on other devices through this credential, and then transfer your Assets were looted.
3. Unlock password
The unlock password is similar to the lock screen password of our mobile phones. It is the outermost layer of protection, but it is far more important than the lock screen password.
Users who have used Metamask know that when the computer is controlled by a virus program, once it obtains your unlock password, it can complete the wealth transfer directly in your wallet.
4.Nostr seed phrase
In the basics, we talked about the Nostr social protocol. After registering an Alby account, we can click "Account Settings" in the upper right corner of the wallet and select "Generate Master Key".
The master key is a string of seed phrase. After the seed phrase is generated, the Nostr public key here will be displayed.
The public key is equivalent to an external address. Through the Nostr public key, you can interact with some protocols in the Nostr ecosystem, such as the recently popular Nostr Assets.
What needs special attention here is that the Nostr master key and Alby are separate. Even if the user saves Alby's account or connection credentials, it does not mean that he can retrieve the Nostr key and public key at that time.
(4) Open multiple accounts to interact with Nostr Assets
Nostr Assets, introduced above, is an open source decentralized protocol designed to seamlessly integrate Taproot Assets and Bitcoin into the Nostr ecosystem.
Nostr Assets will soon launch the Fair mint function. For specific participation steps, please refer to Biteye’s tweet.
https://x.com/BiteyeCN/status/1724682768305844483?s=20
Multiple number principle
The same Alby account can be imported repeatedly. Each time you import, you can set a new Nostr seed phrase and the corresponding Nostr public key.
Note that there is no connection between the Alby account and the Nostr key. Here we only provide the generation and saving functions. If you recharge funds into some Nostr applications when interacting with Nostr ecological projects, be sure to save the Nostr master key, otherwise all your funds will be lost.
Steps
Open the wallet plug-in, click Account in the upper right corner, select "Add New Account", and then select "Connect using Alby".
Up to 13 wallets can be generated here, which means the import can be repeated 13 times.
Then we go to each wallet to generate a Nostr public key and seed phrase.
As mentioned above, the seed phrase must be kept well. There is no one-to-one correspondence between the Alby account and the Nostr public key.
Finally, recharge each Ably account, and then recharge the money into Nostr assets through different Nostr addresses generated by Alby.
https://mainnet.nostrassets.com/#/receive
(5) Budget setting
When we use Metamask to connect some projects for interaction, we are always worried about authorization issues, fearing that too many authorized assets will affect the security of our funds.
The Alby wallet can set a separate budget for each project. After this budget is exceeded, no transactions will be initiated unless the budget is changed again.
Seeing this, if you are interested in payment, Lightning Network or Bitcoin ecosystem, then hurry up and use it! The above is the complete instructions on how to use Alby wallet. I have just tried it in a hurry. If there are any omissions or errors, you are welcome to correct me.
About Biteye
Biteye is Asia's leading Web3 research community. It produces forward-looking investment research content and tools through community and AI-driven methods to help community members explore the Web3 rabbit hole.
Community homepage: https://biteye.info/
Twitter: https://twitter.com/BiteyeCN
Discord: https://discord.com/ME582FXR4F
TG daily subscription: https://t.me/biteyeddaily
Open source free on-chain tools: https://chaineye.tools