Closed agraebe closed 3 years ago
The blockchain does not support native segwit addresses (and never has). It only supports p2pkh and p2sh (including p2wpkh-p2sh and p2wsh-p2sh, not to be confused with native p2wpkh and native p2wsh). Moreover, there is no way to convert a Bech32 address into a p2sh address that I'm aware of.
CC @kyranjamie to double check in the desktop wallet - although I believe I recall explicitly testing with bech32.
To be clear, if you put a bech32 address into the code here, it will produce a well-formed p2sh address. However, it won't be spendable. That's the bug -- the code should be erroring out.
Thanks @hstove, yeah the wallet handles this already
Describe the bug Native segwit addresses are not supported on the Stack blockchain. However, the Stacking library currently allows setting these addresses (starting with bc1). The library currently decodes this format into a different one and submits it to the stacking contract calls, resulting in unexpected reward addresses inside contract calls.
The main method in question is
decodeBtcAddress
.Expected behavior The library should reject native segwit addresses.
cc @yknl @jcnelson @cuevasm