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

BIP 49/84 segwit receive addresses cannot be used when btcwallet is ran as a daemon #762

Open
AlexSSD7 opened this issue Aug 26, 2021 · 9 comments

Comments

@AlexSSD7
Copy link

No description provided.

@AlexSSD7
Copy link
Author

Oh, ok. Why only legacy addresses are being generated then?

@guggero
Copy link
Collaborator

guggero commented Aug 26, 2021

You probably need to specify the key scope to use: https://github.com/btcsuite/btcwallet/blob/master/waddrmgr/scoped_manager.go#L154

@AlexSSD7
Copy link
Author

AlexSSD7 commented Aug 26, 2021

How to do that? (I'm running the daemon via CLI, not calling it from the code FYI)

@guggero
Copy link
Collaborator

guggero commented Aug 26, 2021

I'm not very familiar with the CLI. What command are you using exactly?

@AlexSSD7
Copy link
Author

./btcwallet --testnet --btcdusername xxx --btcdpassword xxx -u xxx -P xxx

@AlexSSD7
Copy link
Author

AlexSSD7 commented Aug 26, 2021

getnewaddress RPC method generates a legacy address, not P2SH segwit or native bech32 address.

{
  "jsonrpc": "1.0",
  "result": "n12UeNcL4ruCiHbmgEgieAwXVbFNZrobQh",
  "error": null,
  "id": 1
}

@guggero
Copy link
Collaborator

guggero commented Aug 26, 2021

Yes, you're right. It looks like the functionality to generate SegWit addresses was only added to the internal DB but never exposed to the RPC interface.

@AlexSSD7
Copy link
Author

Oh, okay. Thank you.

Also I had no idea that I can use btcwallet programmatically without running the actual CLI daemon.

@AlexSSD7 AlexSSD7 changed the title Are BIP 49/84 segwit addresses supported? BIP 49/84 segwit receive addresses cannot be used when btcwallet is ran as a daemon Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants