Samourai-Wallet / sentinel-android

Watch Only bitcoin wallet tracker for Android

Home Page:http://samouraiwallet.com/sentinel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for Segwit XPUBs

prusnak opened this issue · comments

Accept Segwit XPUBs starting with "ypub" - see https://github.com/spesmilo/electrum/blob/0a648e2b1cdb7852d80c0626c62984ef01c1c7e9/lib/bitcoin.py#L50 for magic constants (0x049d7cb2 for segwit p2sh).

By using a different magic for Segwit XPUBs, you don't need to ask user what kind of XPUB is being scanned.

Suggestion: just detect automatically, don't ask user.

commented

This will be a welcome addition.

commented

YPUBs are now supported as of v2.6.

Thanks!

Off-topic: @SamouraiDev please don't write me using keybase, but use my email stick@satoshilabs.com. Thanks!

commented

@SamouraiDev When you add a new Segwit wallet, it's described as "Segwit XPUB (BIP49)". Shouldn't it be referred as YPUB (consistently with the Samourai app)?

commented

Actually, should mention both since BIP49 XPUBs are still accepted.

JFYI: https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki

If you plan to include support for Native Segwit zpubs, https://iancoleman.io/bip39/ has already implemented the change

The same link https://github.com/spesmilo/electrum/blob/0a648e2b1cdb7852d80c0626c62984ef01c1c7e9/lib/bitcoin.py#L50 contains constants for zpub: 0x4b24746