question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

generate segwit addresses?

See original GitHub issue

I would like to see both P2SH (3...) and bech32 (bc1...) segwit addresses alongside each regular P2PHK (1...) address, since those are generated by Bitcoin Core since the most recent release.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
doogluscommented, Mar 27, 2018

When I created this issue I wasn’t aware that you had already added tabs for segwit addresses.

Bitcoin Core’s HD wallet implementation appears to use a single index for all 3 types of addresses it supports. So the first 100 addresses (m/0’/0’/0’ through m/0’/0’/99’) in my wallet are ‘legacy’ P2PHK addresses, then the next 20 (m/0’/0’/100’ through m/0’/0’/119’) are P2SH wrapped segwit addresses, and from there on they’re all bech32 addresses, except for when I come across a site that won’t accept a bech32 address to withdraw to, in which case I use a P2SH address.

So when I generate a bech32 receiving address in Bitcoin Core, but the site I give it to rejects it, I would like to be able to quickly find the corresponding 1… or 3… address to give to the site instead. I can do this by switching tabs, but then I have to somehow figure out what the yprv or zprv extended private key is (Bitcoin Core only tells you the xprv key), and wait for it to regenerate the addresses.

Maybe if it automatically switched the xprv for the corresponding yprv or zprv when I switch tabs and/or script semantics it would be less frustrating. I’m entering the xprv in the “BIP32 Root Key” field, which blanks the mnemonic field, but the value I enter isn’t changed when I switch tabs, and I see an error “Invalid root key”. I think that all that would need doing would be to replace the first 4 bytes of the base58-decoded xprv with the magic bytes for yprv or zprv keys as required.

0reactions
Querzelcommented, Jun 14, 2019

Perhaps my issue regarding LTC xprv -> BIP49 & BIP84 is relevant here ? https://github.com/iancoleman/bip39/issues/96#issuecomment-501747295

Read more comments on GitHub >

github_iconTop Results From Across the Web

SegWit Paper Wallet
Create Segregated Witness (SegWit) Addresses in your browser that can be ran offline to create paper wallets or bulk addresses.
Read more >
How to create SegWit (Bech32) BTC wallet address? - CoinDeal
Step 3: Choose the type of wallet (for our purposes, Standard is enough) · Step 4: Select 'Create a new seed' from the...
Read more >
How to generate a native Segwit address and P2SH Segwit ...
1 Answer 1 · Use base58-decode to convert the base58 string to bytes; Strip the first byte (network byte) and the last 4...
Read more >
Segregated Witness Wallet Development Guide - Bitcoin Core
For receiving payments, the wallet must be able to create a P2SH address based on a P2WPKH script (defined hereinafter), and be able...
Read more >
Creating a P2SH Segwit Wallet with Electrum
Electrum's usual segwit wallets are not p2sh. They have bech32 (bc1..) addresses. That means that you may not be able to receive money...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found