lnbits-legend/lnbits/extensions/watchonly
2022-12-01 12:24:27 +00:00
..
static feat: allow decimal fee rate 2022-11-17 14:21:12 +02:00
templates/watchonly chore: version bump 2022-09-27 17:20:33 +03:00
__init__.py feat: add support for static files 2022-07-28 15:03:22 +03:00
config.json doc: update extension name Watch Only -> Onchain Wallet 2022-07-28 15:03:22 +03:00
crud.py fix: give a companion to single item tuples 2022-11-30 21:50:13 +02:00
helpers.py feat: add on-chain watch-only functionality 2022-07-28 15:04:13 +03:00
migrations.py add missing f-string for SQL 2022-11-28 19:02:31 +01:00
models.py fix: remove user from model (#1067) 2022-10-21 14:49:17 +02:00
README.md Corrected casing of LNbits (not LNBits) throughout repo 2022-11-30 14:14:31 +00:00
views_api.py fix: remove user from model (#1067) 2022-10-21 14:49:17 +02:00
views.py general cleanup and unused imports removal 2021-11-25 18:52:16 +00:00

Onchain Wallet (watch-only)

Monitor an onchain wallet and generate addresses for onchain payments

Monitor an extended public key and generate deterministic fresh public keys with this simple watch only wallet. Invoice payments can also be generated, both through a publically shareable page and API.

You can now use this wallet on the LNbits SatsPayServer extension

Video demo

Wallet Account

  • a user can add one or more xPubs or descriptors
    • the xPub must be unique per user
    • such and entry is called an Wallet Account
    • the addresses in a Wallet Account are split into Receive Addresses and Change Address
    • the user interacts directly only with the Receive Addresses (by sharing them)
    • see BIP44 for more details
    • same xPub will always generate the same addresses (deterministic)
  • when a Wallet Account is created, there are generated 20 Receive Addresses and 5 Change Address
    • the limits can be change from the Config page (see screenshot 1)
    • regular wallets only scan up to 20 empty receive addresses. If the user generates addresses beyond this limit a warning is shown (see screenshot 4)
  • an account can be added From Hardware Device

Scan Blockchain

  • when the user clicks Scan Blockchain, the wallet will loop over the all addresses (for each account)
    • if funds are found, then the list is extended
    • will scan addresses for all wallet accounts
  • the search is done on the client-side (using the mempool.space API). mempool.space has a limit on the number of req/sec, therefore it is expected for the scanning to start fast, but slow down as more HTTP requests have to be retried
  • addresses can also be rescanned individually form the Address Details section (Addresses tab) of each address

New Receive Address

  • the New Receive Address button show the user the NEXT un-used address
    • un-used means funds have not already been sent to that address AND the address has not already been shared
    • internally there is a counter that keeps track of the last shared address
    • it is possible to add a Note to each address in order to remember when/with whom it was shared
    • mind the gap (screenshot 4)

Addresses Tab

  • the Addresses tab contains a list with the addresses for all the Wallet Accounts
    • only one entry per address will be shown (even if there are multiple UTXOs at that address)
    • several filter criteria can be applied
    • unconfirmed funds are also taken into account
    • Address Details can be viewed by clicking the Expand button

History Tap

  • shows the chronological order of transactions
  • it shows unconfirmed transactions at the top
  • it can be exported as CSV file

Coins Tab

  • shows the UTXOs for all wallets
  • there can be multiple UTXOs for the same address

New Payment

  • create a new Partially Signed Bitcoin Transaction
  • multiple Send Addresses can be added
    • the Max button next to an address is for sending the remaining funds to this address (no change)
  • the user can select the inputs (UTXOs) manually, or it can use of the basic selection algorithms
    • amounts have to be provided for the Send Addresses beforehand (so the algorithm knows the amount to be selected)
  • Show Change allows to select from which account the change address will be selected (defaults to the first one)
  • Show Custom Fee allows to manually select the fee
    • it defaults to the Medium value at the moment the New Payment button was clicked
    • it can be refreshed
    • warnings are shown if the fee is too Low or to High

Check & Send

  • creates the PSBT and sends it to the Hardware Wallet
  • a confirmation will be shown for each Output and for the Fee
  • after the user confirms the addresses and amounts, the transaction will be signed on the Hardware Device

Share PSBT

  • Show the PSBT without sending it to the Hardware Wallet

Screensots

  • screenshot 1: image

  • screenshot 2: image

  • screenshot 3: image

  • screenshot 4: image