Open ecdsa521 opened 6 years ago
I think you're using it incorrectly. I tried to use it like this and it works perfectly. You don't need to supply the full path but only the index.
wallet = BTC::Keychain.new(xpub: "xpub6EEtgK5WdTq4FK4BwU38C8g2FKAANdMoxCoKXwkjFSm3p2qCqbGQPehPBKi5PdeGM3JqZR4y5mFsAexSCCS8vogQpv9CV6vFPeznEUTjvMX")
wallet.derived_key(0).address.to_s # 151BbmtNVLduGhumeq1vuxFvp5PejuQdtC
Which is the same when I use tool like https://coinomi.com/recovery-phrase-tool.html
@iamarmanjon this is old style address, not Segwit.
Segwit addresses are either old style, embedded in P2SH, starting with "3", or new style (bech32) starting with "bc1"
Any plans to add SegWit (BIP49/BIP84) support? @oleganza
Hello
Is it possible to generate segwit style addresses as defined in BIP49? It should be compatible with BIP44 and only require change to derivation path, but I am not able to generate proper segwit addresses. It also seems impossible to generate addresses using custom derivation path without private key part?
The result is
BTC::BTCError: Not possible to derive a hardened keychain without a private key (index: 49).
If I do initialize it with xprv instead, for example
It does generate address, but not segwit style.
Can you please tell me if I am doing something wrong? Ideally I want to generate segwit style addresses with only xpub.