LedgerHQ / ledger-live-desktop

⛔️ DEPRECATED - Ledger Live (Desktop)
https://www.ledger.com/live
MIT License
954 stars 297 forks source link

Generate more than one new address #1279

Open nicoodeimos opened 5 years ago

rothos commented 5 years ago

A big +1 to this.

Right now in Ledger Live, I can't create more than one new clean Bitcoin address (which is confusingly called an "account" despite the conventional language of Bitcoin having UXTOs instead of accounts) at a time. If I try, I get the error

There are no transactions on your last created Bitcoin 2 account. You must first receive crypto assets on that account before you can add a new one.

This is crippling!—and nonsensical. Creating lots of new addresses to receive funds is an extremely common use case. Where is my endless list of HD-generated addresses?

meriadec commented 5 years ago

@rothos this decision has been made to prevent having gap of empty accounts between non-empty accounts when scanning. It's convenient to be able to know when Ledger Live can stop scanning and assume there is no more accounts to discover. But yes, this is a good practice/convention rather than a technical limitation.

For your other point about the addresses changing, I confirm you that a new address is generated each time you receive funds (the freshAddressPath is updated at synchronization). This is done for every account. So if you use the "Receive" modal to share your address, you are ensured that it's a fresh address.

For now, as a workaround if you really want ability to add as many accounts as you want, you can remove this condition and build the app for yourself (see README).

MortalKastor commented 5 years ago

@rothos you're confusing addresses and accounts, here.

BIP32 (the HD Wallets standard), tells us that

An HDW is organized as several 'accounts'.

The BIP44 standard for multi-accounts HD wallets expressly demand to prevent creating accounts if the previous one has no transaction:

Software should prevent a creation of an account if a previous account does not have a transaction history (meaning none of its addresses have been used before).

We're just following widely accepted standards here, and it's not what the current issue is about.

This issue is about generating several HD receive addresses for one account, rather than one at a time.

nutmix commented 5 years ago

For most of my customers, ledger live is useless because they need to generate many addresses for many customers (and be able to see the balances and make withdrawals form the wallet). Developers not wanting to scan a few addresses is not a reason to not implement a critical required feature with a simple and widely adopted solution. Trezor wallet has a discovery gap limit of 20. This means you can quite happily and effortlessly create 20 new addresses, and give each one to a new customer, or use each one for a different invoice etc. Electrum allows the discovery gap to be set in the configuration, so you can set it to be say 100 or 1000. Yes it will take a bit longer to scan those addresses, but this is not an excuse to cripple the system. Trezor takes less than a second to scan the 20 accounts. If you do a transaction on the 20th account, you can generate another 20 and see them all in the wallet.

Configurable discovery gap, which is perhaps a days development work, is absolutely critical feature for small to medium business to allow them to issue multiple invoices to multiple customers in parallel. Any regulated business is also required to segregate customer funds, so it is a requirement in such industries.

I have requested configurable gap limit from Trezor also. The first one to implement it will become our companies standard for small business users.

gre commented 5 years ago

@nutmix we're following BIP44 spec here.

Address gap limit

Address gap limit is currently set to 20. If the software hits 20 unused addresses in a row, it expects there are no used addresses beyond this point and stops searching the address chain.

I think this spec is fine for most users. configurable gap limit can be a feature yes, but we're diverging from this spec if we do so (just a fact, i don't have a strong opinion on if it's acceptable or not to change this gap limit. the problem i can see is that if you extend this limit on what side, all other compatible wallets will have to follow the same to have your funds discovered, otherwise user starts to gets missing funds. we can't infinitely grow this gap neither because it means slower first synchronisation in a classical non-full-node client<>server approach as ledger explorer do).

if you're saying some wallets already support the option, and if more & more users use that option, i think inevitably we'll need the same feature. happy to discuss it more.

nutmix commented 5 years ago

I would question "its fine for most users". In my years of experience helping companies with blockchain they ALL want to create multiple accounts, but can't. I spoke to one today, and they called Ledger who told them it was not possible, so they assumed it was a technical issue. I pointed out that not only is it possible, but most other wallets have this feature (including Trezor wallet, Electrum, skycoin and many more). You are simply ignoring/abandoning all these small business, and pro users who need to invoice different customers etc. There is simply no viable excuse for not allowing multiple accounts - its the most basic accounting need. Yes I know that if they have to "restore" they will need to figure out what the gap limit was, but this is totally acceptable compared with the manual option below:

I visited a customer last week, who has 10 ledger blues. They employ a person full time just to make accounts in 18 currencies. They first create 1 account, then they have to transfer funds into it. They they wait 1 hour (in BTC case), so that you allow a second to be added to the wallet. They then have to transfer the funds out, so that when a customer gets given the account to pay his next invoice or payment on account (credit up front), they are not shocked that there is money in it. Then they wait another hour. They spend all day doing this. I told them to complain to leger, and they were actually told it was impossible to create multiple accounts, and they believed it. So I showed them the trezor wallet, which only requires "charging" every 20th account, and them Electrum, where I set it up to allow 1000 accounts to be generated. They were utterly stunned. They have now all purchased trezors, and they will migrate over. Note, the Trezor is also not perfect, e.g. you cant easily pull the extended public key. We are still waiting to find a small business friendly wallet which can use HW for the keys.

Kukks commented 5 years ago

Please add a configurable gap limit. Ledger Live is useless to me and many other BTCPayServer Users and have to use Electrum or our built-in BTCPay Wallet manager to see transactions and recognize the actual balance. We get hundreds of invoices, each which generates its own address.

nutmix commented 5 years ago

To be clear, anyone who has more than one customer/invoice needs to be able to create multiple accounts and within each account multiple addresses, all of which can be empty (no transactions). We all know that when you restore a seed, it doesnt know how many accounts/addresses to search for, so a simple, acceptable and perfect solution is the configurable gap limit for accounts and for addresses within an account. It is also critical to have the option to transfer from a specific address within an account. Without this, leger live is useless. THe first wallet which adds this critical functionality will get a lot of users. Electrum is the nearest we have so far.

badokun commented 5 years ago

his decision has been made to prevent having gap of empty accounts between non-empty accounts when scanning. It's convenient to be able to know when Ledger Live can stop scanning and assume there is no more accounts to discover. But yes, this is a good practice/convention rather than a technical limitation.

For your other point about the addresses changing, I confirm you that a new address is generate

Came across this thread while looking into the privacy aspect of scanning for accounts in Ledger Live. Doesnt the response payload tie all those addresses into one user? https://twitter.com/rubberroad/status/1104164392227102720

nutmix commented 5 years ago

"to prevent having gap of empty accounts between non-empty accounts when scanning". This is completely missing the point. Business and sole traders want and need gaps between accounts.

"It's convenient to be able to know when Ledger Live can stop scanning" - this is relevant to the Users. whether it scans 1 ahead, 10 ahead or 100 ahead is irrelevant - its trivial. Completer can do this. Its 3 lines of code.

"this is a good practice/convention" - this is again the point - it is only convenient for users who never have more than 1 account at a time. For everyone else it is the opposite, it makes it unusable. Yes its in the original HD wallet BIP, but we have outgrown this. There is no business sense to cripple functionality and blame it on dogedly clinging to an old spec. We need innovation and features. Technically the change we want is trivial, and can easily be in an "advanced" section if we think users are not intelligent enough to use it, or in a "business" version that you charge an extra $100 for with only a few lines of code change.

nodecheck commented 5 years ago

+1 since we've also had issues with this.

AndresRohr commented 5 years ago

Yes, would also love to be able to create more than just 1 receive address

richwestcoast commented 5 years ago

I too wish for this functionality. Otherwise I must return this product to Amazon

olalonde commented 4 years ago

+1 ... configurable gap limit would be a simple solution. If you are worried about server load, maybe open source your backend server and let people run it or have a subscription plan for heavy users.

gre commented 4 years ago

gap limit is already customizable by the env variable KEYCHAIN_OBSERVABLE_RANGE (for instance KEYCHAIN_OBSERVABLE_RANGE=200)

however, that's off topic of this GitHub issue that is raising a feature request about giving to user the capability to iterate over the "next addresses" and not just one.

lviggiano commented 4 years ago

You can export the xpub from the desktop app, right-clicking on the account and choosing edit accountadvanced logs and copying the string starting with 'xpub' from the json shown. Once you have the xpub you can check the derived addresses using key utility 'ku' ( from http://github.com/richardkiss/pycoin ) at the command line:

$ ku -j -s 0/0-50 extendedxpub

or (for the change addresses)

$ ku -j -s1/0-50 extendedxpub

0/... stands for receiving addresses; 1/... stands for the change addresses; 0-50 tells ku to show addresses from 0 to 50 (you can choose as many as you want).

it will display a json with all the details, then you should pick the field with the proper address for your account (use grep or jq to filter - I used brew install jq on a mac).

Check the field 'address_segwit' for bech32/bc1 addresses or 'p2sh_segwit' for segwit/addresses starting with 3; double check with your previously used addresses for the specific account to be sure.

Flydancer commented 4 years ago

2 years later and still nothing happened.

Slyke commented 3 years ago

@Flydancer I just stumbled on this thread from Google.

It appears that they do in fact have this feature: image

It's under Experimental Features in the settings.

I haven't tested it out myself yet.

Edit:

Seems I still can't create new address without first sending bitcoin though. Based off the comments above, I think I might either return my Nano X for a Trezor, or just keep it as a backup wallet.

JeremyRubin commented 2 years ago

is there any plan to add the ability to generate new addresses with custom gap limit?

BTW does ledger use hardened or non hardened derivation? Can one just do non hardened derivation on an xpub?

dvcrn commented 2 years ago

I tried to get around this by using MEW to get a address that isn't used yet with a gap and sent some funds to it, but even with this method and manually set gap, ledger live refuses to find it :(

QChab commented 2 years ago

Any plan to change this "feature"? Becomes more and more problematic considering the number of EVM chains around, I don't care to see my balances, I just wanna be able to create more addresses on my device, that I bought for that.

When will that be possible please?

ScuttoZ commented 2 years ago

+1