Closed 34ro closed 5 years ago
This would be very useful. Maybe lncli walletbalance
can return addresses and balances.
I missed new field of walletbalance
.
Thanks.
By address list, do you mean the list of all addresses ever used by lnd
?
Each call to newaddress
will give you a unique address.
My understanding is the possibility to list all used addresses, and their current balance.
Yes, we need a way to list the addresses and their balance, not just total balance of the wallet.
@gabbello It's already possible to do this with listchaintxns
. It lists all transactions, and the addresses involved in those transactions. The missing aspect is including the outpoints produced and consumed. These are already stored within the database. Once this is in place, it's very straight forward to subtract all spends from credits from an address to derive the "balance" for an address.
I don't really see this being useful at all though as by default, the RPC interface will always rotate addresses.
Thanks for your answer, I agree that this is just a nice to have given the above workaround. I encountered this need because I was generating multiple addresses (of different types) and then using faucets to credit them. Now since this was on testnet (and some faucets don't work/know how to send coins to SegWit addresses) I didn't note down the transactions or addresses.
After some time (e.g. next day) I noticed that I still don't have enough funds in my segwit address, but couldn't track what were the addresses which I tried to credit (so I can check them on some blockchain explorer). In the end it was proven that indeed the faucet I was using didn't broadcast the transaction correctly.
I agree, a way to get the list of all wallet addresses generated in the past for this wallet would be great.
I can find it in listchaintxns
(transactions[].dest_addresses
) but this list other addresses there, so it's not easy to parse.
I was searching for that too yesterday. I spotted listchaintxns, but it lists other on chain addresses, and a lot of additional metadata, so it is hard to figure out things there. A list that shows a bit reversed view of just a list of elements like:
address -> { confirmed_balance, unconfirmed_balance, total_balance, total-input, total-output, [list-of-transaction-ids-and-amounts-sorted-by-block-height-or-something] },
with new addressed being simply:
address -> { 0, 0, 0, 0, 0, [] },
or something like this.
I think we should recheck the correct address list before creating funding transactions.
But listchaintxns
doesn't show all controlled addresses inclusively.
Just using newaddress
is not completely safe if lnd is adding in a big payment system.
Another use case I just encountered that would greatly benefit from this feature: you start a lnd node and create a wallet and send some BTC to it for funding channels, then a few weeks later you want to send more to fund more channels.
I had to rely on the address I saved in the exchange for sending the first transaction to cross-check with listchaintxns
. I would have been a lot more confident to get this info from the lnd command-line. Please consider adding this feature.
In this case can't you just make a new address? You should try to not ever re-use addresses under normal circumstances.
An address list is useful for those addresses that have been "created" but never used, especially if many addresses are generated and the wallet is used elsewhere.
This is also something I have been wondering about.
When I started lnd, I didn't really know what I was doing. I ended up creating newaddresses. I forgot them as I was testing, but I'm struggling to find a command to list them. I definitely don't know how to use this software yet. So this is a noobs experience so far.
Maybe it isn't necessary? I guess I will follow roasbeef's advice and just make a new one.
I think @Roasbeef is right, but as @Derek701 pointed out there is some legitimate use case for this feature. I guess we can call it "nice to have"
can i be sure, that LND does never reuse an old address?
@aggroLINUS Users can reuse their addresses but LND doesn't reuse old addresses when you request for a new address with command lncli newaddress ...
.
I just want to see in which address I have how much bitcoin, in order to know the best strategy to open channels new channels (with the lowest amount of transaction)
@MrManPew 0.6 will include a listunspent
command that will show the wallet's utxos and amount in each
With the addition of the ListUnspent
RPC and its accompanying lncli listunspent
command in the master branch, I think this can be closed.
I know this issue is closed and was considered resolved with listunspent but I have another use case that's not covered by that feature. Please let me know if opening a new issue is more appropriate.
I'd like to fund my ln wallet directly from my Gemini account because they don't charge for withdrawals/on-chain transactions. However, they have a 7 day waiting period for new withdrawal addresses, so my scenario is:
However, it'd be very nice if during step 4 I could double check the address in lnd one last time before sending the transaction. I can't simply create a fresh address for my lnd wallet because then I'm back to step 2. Currently there still doesn't seem to be a way to list addresses that were created but haven't been transacted with in lnd.
Currently there still doesn't seem to be a way to list addresses that were created but haven't been transacted with in lnd.
Correct. Feel free to open a new issue if you'd like, but given the somewhat niche use case, it may not be implemented/accepted without more demand.
Is there any way to find address list except note
newaddress
output? I think it is useful for checking address between lnd and wallet application. Does it intend preventing address reuse or just not yet?