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

Not converting to Segwit nested in P2SH #2

Open
pekatete opened this issue Aug 8, 2018 · 2 comments
Open

Not converting to Segwit nested in P2SH #2

pekatete opened this issue Aug 8, 2018 · 2 comments

Comments

@pekatete
Copy link

pekatete commented Aug 8, 2018

Hi - this does not convert a Segwit Bech32 address to a Segwit nested in P2SH.
Should convert:
from (Segwit Bech32): bc1qcash96s5jqppzsp8hy8swkggf7f6agex98an7h
to (Segwit nested in P2SH): 3NULL3ZCUXr7RDLxXeLPDMZDZYxuaYkCnG

However the tests seem to assert the Bech32 equals the Bech32 (rather than the P2SH).

@DesWurstes
Copy link
Owner

This library just encodes and decodes Bech32. It intentionally doesn't convert them to Base58, since it's not possible to spend Bech32 funds from a P2SH address and vice versa. If I added that, probably someone would lose their funds.

@pekatete
Copy link
Author

pekatete commented Aug 8, 2018

My usecase was not to convert the Bech 32 address to a Base58 address in order to use the (Base58) address for spending / collecting but to query a node for the transactions on the Base58 address (thus Bech 32 as the latter is not query-able).
I can convert a base 58 to a Bech 32 however that also seems off, i.e:
3NULL3ZCUXr7RDLxXeLPDMZDZYxuaYkCnG returns bc1qye5fnk4zr9rx57ua7qksgq3hqc07k3zxld709m rather than bc1qcash96s5jqppzsp8hy8swkggf7f6agex98an7h

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