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

bech32 (SegWit) long address #56

Open
xsoft opened this issue Jun 20, 2021 · 1 comment
Open

bech32 (SegWit) long address #56

xsoft opened this issue Jun 20, 2021 · 1 comment

Comments

@xsoft
Copy link

xsoft commented Jun 20, 2021

Hi,
address like:
bc1qa5wkgaew2dkv56kfvj49j0av5nml45x9ek9hz6 is working. But longer (valid) address like:
bc1qvpgyac88vqtslewxu7yu9dqwp8rd83zch55zpm3xgn3mgg72w3kqv0s8qa throws error:
"Invalid size input for address: expected 21 bytes but got 33 bytes instead."

./bitcoin-tool \
    --network bitcoin \
    --input-type address \
    --input-format bech32 \
    --input "bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97" \
    --ignore-input-errors \
    --output-type public-key-rmd \
    --output-format hex

Invalid size input for address: expected 21 bytes but got 33 bytes instead.

---
./bitcoin-tool \
    --network bitcoin \
    --input-type address \
    --input-format bech32 \
    --input "bc1qhmc0vk4xzr37ayv7tlyhns7x4dk04tyvflk8ey" \
    --ignore-input-errors \
    --output-type public-key-rmd \
    --output-format hex

bef0f65aa610e3ee919e5fc979c3c6ab6cfaac8c

Also please note that --input-format bech32 is NOT at title page neither help --help.
Is there really req. for "bech32" param? Isn't "address" enought?
To add 1xxx, 3xxx also bc1xxx and bc1xxx....xxx address types.

Note: SegWit #26

@streamofstars
Copy link

Those long bech32 addresses are Pay-to-Witness-Script-Hash (P2WSH) and ripemd-160 is not used when constructing them, but sha-256. So it is not possible to decode such an address to ripemd. See the graph under Address map at https://en.bitcoin.it/wiki/Invoice_address

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

3 participants
@xsoft @streamofstars and others