Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NewAddress returns duplicate addresses #8697

Open
remnantdev opened this issue Apr 26, 2024 · 4 comments
Open

NewAddress returns duplicate addresses #8697

remnantdev opened this issue Apr 26, 2024 · 4 comments
Labels
bug Unintended code behaviour missing reproduction wallet The wallet (lnwallet) which LND uses

Comments

@remnantdev
Copy link

Background

We have noticed that gRPC call to NewAddress did return the same address twice.

From what I can see in our logs the node was in the process of starting.

Is getting a new address guaranteed to return a new address or was it an invalid assumption on our part?

Your environment

  • version of lnd : lnd.017.2.beta
  • which operating system: Alpine Linux v3.18

Steps to reproduce

Not able to reproduce

@remnantdev remnantdev added bug Unintended code behaviour needs triage labels Apr 26, 2024
@alexbosworth
Copy link
Contributor

In address type, which type did you select? The options:

    WITNESS_PUBKEY_HASH = 0;
    NESTED_PUBKEY_HASH = 1;
    UNUSED_WITNESS_PUBKEY_HASH = 2;
    UNUSED_NESTED_PUBKEY_HASH = 3;
    TAPROOT_PUBKEY = 4;
    UNUSED_TAPROOT_PUBKEY = 5;

@remnantdev
Copy link
Author

In address type, which type did you select? The options:

    WITNESS_PUBKEY_HASH = 0;
    NESTED_PUBKEY_HASH = 1;
    UNUSED_WITNESS_PUBKEY_HASH = 2;
    UNUSED_NESTED_PUBKEY_HASH = 3;
    TAPROOT_PUBKEY = 4;
    UNUSED_TAPROOT_PUBKEY = 5;

We only use WITNESS_PUBKEY_HASH

@guggero
Copy link
Collaborator

guggero commented Apr 29, 2024

With WITNESS_PUBKEY_HASH you should be guaranteed to receive a new address every time. Are you sure you didn't use UNUSED_WITNESS_PUBKEY_HASH? Which would return the same address until some on-chain funds are detected on it (marking it as "used").
If you can reproduce, then please share the logs of both calls.

@remnantdev
Copy link
Author

We are sure we used WITNESS_PUBKEY_HASH . We have one usage of UNUSED_WITNESS_PUBKEY_HASH but it is in a totally different context.

I was not able to reproduce, we only noticed it occuring this time because the address was actually used in a transaction but going through our db I could find some duplicate address going all the way back to 2021.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour missing reproduction wallet The wallet (lnwallet) which LND uses
Projects
None yet
Development

No branches or pull requests

4 participants